issue#11: cds: changed __CDS_ guard prefix to CDSLIB_ for all .h files
[libcds.git] / tests / unit / print_cuckoo_stat.h
1 //$$CDS-header$$
2
3 #ifndef CDSUNIT_PRINT_CUCKOO_STAT_H
4 #define CDSUNIT_PRINT_CUCKOO_STAT_H
5
6 #include <cds/intrusive/cuckoo_set.h>
7 #include <ostream>
8
9 namespace std {
10
11     static inline ostream& operator <<( ostream& o, cds::intrusive::cuckoo::striping_stat const& s )
12     {
13         return o << "\tStriping statistis [cds::intrusive::cuckoo::striping_stat]:\n"
14             << "\t\t    m_nCellLockCount: " << s.m_nCellLockCount.get()     << "\n"
15             << "\t\t m_nCellTryLockCount: " << s.m_nCellTryLockCount.get()  << "\n"
16             << "\t\t    m_nFullLockCount: " << s.m_nFullLockCount.get()     << "\n"
17             << "\t\t  m_nResizeLockCount: " << s.m_nResizeLockCount.get()   << "\n"
18             << "\t\t      m_nResizeCount: " << s.m_nResizeCount.get()       << "\n"
19 ;
20     }
21     static inline ostream& operator <<( ostream& o, cds::intrusive::cuckoo::empty_striping_stat const& /*s*/ )
22     {
23         return o;
24     }
25
26     static inline ostream& operator <<( ostream& o, cds::intrusive::cuckoo::refinable_stat const& s )
27     {
28         return o << "\tRefinable statistics [cds::intrusive::cuckoo::refinable_stat]:\n"
29             << "\t\t          m_nCellLockCount: " << s.m_nCellLockCount.get()           << "\n"
30             << "\t\t   m_nCellLockWaitResizing: " << s.m_nCellLockWaitResizing.get()    << "\n"
31             << "\t\t   m_nCellLockArrayChanged: " << s.m_nCellLockArrayChanged.get()    << "\n"
32             << "\t\t         m_nCellLockFailed: " << s.m_nCellLockFailed.get()          << "\n"
33             << "\t\t    m_nSecondCellLockCount: " << s.m_nSecondCellLockCount.get()     << "\n"
34             << "\t\t   m_nSecondCellLockFailed: " << s.m_nSecondCellLockFailed.get()    << "\n"
35             << "\t\t          m_nFullLockCount: " << s.m_nFullLockCount.get()           << "\n"
36             << "\t\t           m_nFullLockIter: " << s.m_nFullLockIter.get()            << "\n"
37             << "\t\t        m_nResizeLockCount: " << s.m_nResizeLockCount.get()         << "\n"
38             << "\t\t         m_nResizeLockIter: " << s.m_nResizeLockIter.get()          << "\n"
39             << "\t\t m_nResizeLockArrayChanged: " << s.m_nResizeLockArrayChanged.get()  << "\n"
40             << "\t\t            m_nResizeCount: " << s.m_nResizeCount.get()             << "\n"
41 ;
42     }
43     static inline ostream& operator <<( ostream& o, cds::intrusive::cuckoo::empty_refinable_stat const& /*s*/ )
44     {
45         return o;
46     }
47
48     static inline ostream& operator <<( ostream& o, cds::intrusive::cuckoo::stat const& s )
49     {
50         return o << "\tCuckoo stat [cds::intrusive::cuckoo::stat]:\n"
51             << "\t\t           m_nRelocateCallCount: " << s.m_nRelocateCallCount.get()              << "\n"
52             << "\t\t          m_nRelocateRoundCount: " << s.m_nRelocateRoundCount.get()             << "\n"
53             << "\t\t          m_nFalseRelocateCount: " << s.m_nFalseRelocateCount.get()             << "\n"
54             << "\t\t        m_nSuccessRelocateCount: " << s.m_nSuccessRelocateCount.get()           << "\n"
55             << "\t\t m_nRelocateAboveThresholdCount: " << s.m_nRelocateAboveThresholdCount.get()    << "\n"
56             << "\t\t         m_nFailedRelocateCount: " << s.m_nFailedRelocateCount.get()            << "\n"
57             << "\t\t             m_nResizeCallCount: " << s.m_nResizeCallCount.get()                << "\n"
58             << "\t\t            m_nFalseResizeCount: " << s.m_nFalseResizeCount.get()               << "\n"
59             << "\t\t       m_nResizeSuccessNodeMove: " << s.m_nResizeSuccessNodeMove.get()          << "\n"
60             << "\t\t          m_nResizeRelocateCall: " << s.m_nResizeRelocateCall.get()             << "\n"
61             << "\t\t               m_nInsertSuccess: " << s.m_nInsertSuccess.get()                  << "\n"
62             << "\t\t                m_nInsertFailed: " << s.m_nInsertFailed.get()                   << "\n"
63             << "\t\t           m_nInsertResizeCount: " << s.m_nInsertResizeCount.get()              << "\n"
64             << "\t\t         m_nInsertRelocateCount: " << s.m_nInsertRelocateCount.get()            << "\n"
65             << "\t\t         m_nInsertRelocateFault: " << s.m_nInsertRelocateFault.get()            << "\n"
66             << "\t\t            m_nEnsureExistCount: " << s.m_nEnsureExistCount.get()               << "\n"
67             << "\t\t          m_nEnsureSuccessCount: " << s.m_nEnsureSuccessCount.get()             << "\n"
68             << "\t\t           m_nEnsureResizeCount: " << s.m_nEnsureResizeCount.get()              << "\n"
69             << "\t\t         m_nEnsureRelocateCount: " << s.m_nEnsureRelocateCount.get()            << "\n"
70             << "\t\t         m_nEnsureRelocateFault: " << s.m_nEnsureRelocateFault.get()            << "\n"
71             << "\t\t               m_nUnlinkSuccess: " << s.m_nUnlinkSuccess.get()                  << "\n"
72             << "\t\t                m_nUnlinkFailed: " << s.m_nUnlinkFailed.get()                   << "\n"
73             << "\t\t                m_nEraseSuccess: " << s.m_nEraseSuccess.get()                   << "\n"
74             << "\t\t                 m_nEraseFailed: " << s.m_nEraseFailed.get()                    << "\n"
75             << "\t\t                 m_nFindSuccess: " << s.m_nFindSuccess.get()                    << "\n"
76             << "\t\t                  m_nFindFailed: " << s.m_nFindFailed.get()                     << "\n"
77             << "\t\t             m_nFindWithSuccess: " << s.m_nFindWithSuccess.get()                << "\n"
78             << "\t\t              m_nFindWithFailed: " << s.m_nFindWithFailed.get()                 << "\n"
79 ;
80     }
81
82     static inline ostream& operator <<( ostream& o, cds::intrusive::cuckoo::empty_stat const& /*s*/ )
83     {
84         return o;
85     }
86
87 } // namespace std
88
89 #endif // #ifndef CDSUNIT_PRINT_CUCKOO_STAT_H