issue#11: cds: changed __CDS_ guard prefix to CDSLIB_ for all .h files
[libcds.git] / tests / unit / print_skip_list_stat.h
1 //$$CDS-header$$
2
3 #ifndef CDSUNIT_PRINT_SKIP_LIST_STAT_H
4 #define CDSUNIT_PRINT_SKIP_LIST_STAT_H
5
6 #include <cds/intrusive/details/skip_list_base.h>
7 #include <ostream>
8
9 namespace std {
10
11     static inline ostream& operator <<( ostream& o, cds::intrusive::skip_list::stat<> const& s )
12     {
13         o << "Skip-list stat [cds::intrusive::skip_list::stat]\n"
14             << "\t\t node height (add/delete):\n";
15
16         for ( unsigned int i = 0; i < 9; ++i )
17             o << "\t\t\t[ " << (i + 1) << "]: " << s.m_nNodeHeightAdd[i].get() << '/' << s.m_nNodeHeightDel[i].get() << "\n";
18         for ( unsigned int i = 9; i < sizeof(s.m_nNodeHeightAdd) / sizeof(s.m_nNodeHeightAdd[0] ); ++i )
19             o << "\t\t\t[" << (i + 1) << "]: " << s.m_nNodeHeightAdd[i].get() << '/' << s.m_nNodeHeightDel[i].get() << "\n";
20
21         return o
22             << "\t\t          m_nInsertSuccess: " << s.m_nInsertSuccess.get()           << "\n"
23             << "\t\t           m_nInsertFailed: " << s.m_nInsertFailed.get()            << "\n"
24             << "\t\t          m_nInsertRetries: " << s.m_nInsertRetries.get()           << "\n"
25             << "\t\t            m_nEnsureExist: " << s.m_nEnsureExist.get()             << "\n"
26             << "\t\t              m_nEnsureNew: " << s.m_nEnsureNew.get()               << "\n"
27             << "\t\t          m_nUnlinkSuccess: " << s.m_nUnlinkSuccess.get()           << "\n"
28             << "\t\t           m_nUnlinkFailed: " << s.m_nUnlinkFailed.get()            << "\n"
29             << "\t\t         m_nExtractSuccess: " << s.m_nExtractSuccess.get()          << "\n"
30             << "\t\t          m_nExtractFailed: " << s.m_nExtractFailed.get()           << "\n"
31             << "\t\t         m_nExtractRetries: " << s.m_nExtractRetries.get()          << "\n"
32             << "\t\t      m_nExtractMinSuccess: " << s.m_nExtractMinSuccess.get()       << "\n"
33             << "\t\t       m_nExtractMinFailed: " << s.m_nExtractMinFailed.get()        << "\n"
34             << "\t\t      m_nExtractMinRetries: " << s.m_nExtractMinRetries.get()       << "\n"
35             << "\t\t      m_nExtractMaxSuccess: " << s.m_nExtractMaxSuccess.get()       << "\n"
36             << "\t\t       m_nExtractMaxFailed: " << s.m_nExtractMaxFailed.get()        << "\n"
37             << "\t\t      m_nExtractMaxRetries: " << s.m_nExtractMaxRetries.get()       << "\n"
38             << "\t\t           m_nEraseSuccess: " << s.m_nEraseSuccess.get()            << "\n"
39             << "\t\t            m_nEraseFailed: " << s.m_nEraseFailed.get()             << "\n"
40             << "\t\t        m_nFindFastSuccess: " << s.m_nFindFastSuccess.get()         << "\n"
41             << "\t\t         m_nFindFastFailed: " << s.m_nFindFastFailed.get()          << "\n"
42             << "\t\t        m_nFindSlowSuccess: " << s.m_nFindSlowSuccess.get()         << "\n"
43             << "\t\t         m_nFindSlowFailed: " << s.m_nFindSlowFailed.get()          << "\n"
44             << "\t\t    m_nRenewInsertPosition: " << s.m_nRenewInsertPosition.get()     << "\n"
45             << "\t\t m_nLogicDeleteWhileInsert: " << s.m_nLogicDeleteWhileInsert.get()  << "\n"
46             << "\t\t    m_nNotFoundWhileInsert: " << s.m_nNotFoundWhileInsert.get()     << "\n"
47             << "\t\t              m_nFastErase: " << s.m_nFastErase.get()               << "\n"
48             << "\t\t              m_nSlowErase: " << s.m_nSlowErase.get()               << "\n"
49             << "\t\t            m_nFastExtract: " << s.m_nFastExtract.get()             << "\n"
50             << "\t\t            m_nSlowExtract: " << s.m_nSlowExtract.get()             << "\n"
51             << "\t\t         m_nEraseWhileFind: " << s.m_nEraseWhileFind.get()          << "\n"
52             << "\t\t       m_nExtractWhileFind: " << s.m_nExtractWhileFind.get()        << "\n";
53     }
54
55     static inline ostream& operator <<( ostream& o, cds::intrusive::skip_list::empty_stat const& /*s*/ )
56     {
57         return o;
58     }
59
60 } // namespace std
61
62 #endif // #ifndef CDSUNIT_PRINT_SKIP_LIST_STAT_H