blob: ea0ebf92ce428c4b5e8ae15b74c1b15d483f75f4 [file] [log] [blame]
Andrew Geissler7264d902019-02-27 09:46:40 -06001#include "src/associations.hpp"
2
3#include <iostream>
4
5// Some debug functions for dumping out the main data structures in objmgr
6
Brad Bishopa098a372022-05-05 15:19:04 -04007void dumpAssociationOwnersType(AssociationOwnersType& assocOwners)
Andrew Geissler7264d902019-02-27 09:46:40 -06008{
9 using namespace std;
10 cout << "##### AssociationOwnersType #####" << endl;
Brad Bishop1f623802022-05-31 18:22:10 -040011 for (const auto& i : assocOwners)
Andrew Geissler7264d902019-02-27 09:46:40 -060012 {
13 cout << "------------------------------------" << endl;
14 cout << setw(15) << left << "OBJ PATH:" << i.first << endl;
15
Brad Bishop1f623802022-05-31 18:22:10 -040016 for (const auto& j : i.second)
Andrew Geissler7264d902019-02-27 09:46:40 -060017 {
18 cout << setw(16) << left << "DBUS SERVICE:" << j.first << endl;
19
Brad Bishop1f623802022-05-31 18:22:10 -040020 for (const auto& k : j.second)
Andrew Geissler7264d902019-02-27 09:46:40 -060021 {
22 cout << setw(17) << left << "ASSOC PATH:" << k.first << endl;
23
Brad Bishop1f623802022-05-31 18:22:10 -040024 for (const auto& l : k.second)
Andrew Geissler7264d902019-02-27 09:46:40 -060025 {
26 cout << setw(18) << left << "ENDPOINT:" << l << endl;
27 }
28 }
29 }
30 cout << "------------------------------------" << endl;
31 }
32}
33
Brad Bishopa098a372022-05-05 15:19:04 -040034void dumpAssociationInterfaces(AssociationInterfaces& assocInterfaces)
Andrew Geissler7264d902019-02-27 09:46:40 -060035{
36 using namespace std;
37 cout << "##### AssociationInterfaces #####" << endl;
38 for (auto i : assocInterfaces)
39 {
40 cout << "------------------------------------" << endl;
41 cout << setw(15) << left << "OBJ PATH:" << i.first << endl;
42 auto intfEndpoints = std::get<endpointsPos>(i.second);
43
Brad Bishop1f623802022-05-31 18:22:10 -040044 for (const auto& k : intfEndpoints)
Andrew Geissler7264d902019-02-27 09:46:40 -060045 {
46 cout << setw(16) << left << "ENDPOINTS:" << k << endl;
47 }
48 cout << "------------------------------------" << endl;
49 }
50}
51
Brad Bishopa098a372022-05-05 15:19:04 -040052void dumpInterfaceMapType(InterfaceMapType& intfMap)
Andrew Geissler7264d902019-02-27 09:46:40 -060053{
54 using namespace std;
Brad Bishopa098a372022-05-05 15:19:04 -040055 cout << "##### interfaceMapType #####" << endl;
Brad Bishop1f623802022-05-31 18:22:10 -040056 for (const auto& i : intfMap)
Andrew Geissler7264d902019-02-27 09:46:40 -060057 {
58 cout << "------------------------------------" << endl;
59 cout << setw(15) << left << "OBJ PATH:" << i.first << endl;
60
Brad Bishop1f623802022-05-31 18:22:10 -040061 for (const auto& j : i.second)
Andrew Geissler7264d902019-02-27 09:46:40 -060062 {
63 cout << setw(16) << left << "DBUS SERVICE:" << j.first << endl;
64
Brad Bishop1f623802022-05-31 18:22:10 -040065 for (const auto& k : j.second)
Andrew Geissler7264d902019-02-27 09:46:40 -060066 {
67 cout << setw(18) << left << "INTERFACE:" << k << endl;
68 }
69 }
70 }
71 cout << "------------------------------------" << endl;
72}