summaryrefslogtreecommitdiffstats
path: root/src/test/util/debug_output.hpp
blob: 460f01f4e61ce8c1ac3c29192dd7bb4a78e515f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include "src/associations.hpp"

#include <iostream>

// Some debug functions for dumping out the main data structures in objmgr

void dump_AssociationOwnersType(AssociationOwnersType& assocOwners)
{
    using namespace std;
    cout << "##### AssociationOwnersType #####" << endl;
    for (auto i : assocOwners)
    {
        cout << "------------------------------------" << endl;
        cout << setw(15) << left << "OBJ PATH:" << i.first << endl;

        for (auto j : i.second)
        {
            cout << setw(16) << left << "DBUS SERVICE:" << j.first << endl;

            for (auto k : j.second)
            {
                cout << setw(17) << left << "ASSOC PATH:" << k.first << endl;

                for (auto l : k.second)
                {
                    cout << setw(18) << left << "ENDPOINT:" << l << endl;
                }
            }
        }
        cout << "------------------------------------" << endl;
    }
}

void dump_AssociationInterfaces(AssociationInterfaces& assocInterfaces)
{
    using namespace std;
    cout << "##### AssociationInterfaces #####" << endl;
    for (auto i : assocInterfaces)
    {
        cout << "------------------------------------" << endl;
        cout << setw(15) << left << "OBJ PATH:" << i.first << endl;
        auto intfEndpoints = std::get<endpointsPos>(i.second);

        for (auto k : intfEndpoints)
        {
            cout << setw(16) << left << "ENDPOINTS:" << k << endl;
        }
        cout << "------------------------------------" << endl;
    }
}

void dump_InterfaceMapType(interface_map_type& intfMap)
{
    using namespace std;
    cout << "##### interface_map_type #####" << endl;
    for (auto i : intfMap)
    {
        cout << "------------------------------------" << endl;
        cout << setw(15) << left << "OBJ PATH:" << i.first << endl;

        for (auto j : i.second)
        {
            cout << setw(16) << left << "DBUS SERVICE:" << j.first << endl;

            for (auto k : j.second)
            {
                cout << setw(18) << left << "INTERFACE:" << k << endl;
            }
        }
    }
    cout << "------------------------------------" << endl;
}
OpenPOWER on IntegriCloud