File: print_stat.h

package info (click to toggle)
libcds 2.3.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 15,564 kB
  • sloc: cpp: 135,002; ansic: 7,218; perl: 243; sh: 237; makefile: 6
file content (100 lines) | stat: -rw-r--r-- 3,787 bytes parent folder | download | duplicates (3)
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// Copyright (c) 2006-2018 Maxim Khizhinsky
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)

#ifndef CDSSTRESS_QUEUE_PRINT_STAT_H
#define CDSSTRESS_QUEUE_PRINT_STAT_H

namespace cds_test {

    template <typename Counter>
    static inline property_stream& operator <<( property_stream& o, cds::intrusive::basket_queue::stat<Counter> const& s )
    {
        return o
            << CDSSTRESS_STAT_OUT( s, m_EnqueueCount )
            << CDSSTRESS_STAT_OUT( s, m_EnqueueRace )
            << CDSSTRESS_STAT_OUT( s, m_DequeueCount )
            << CDSSTRESS_STAT_OUT( s, m_EmptyDequeue )
            << CDSSTRESS_STAT_OUT( s, m_DequeueRace )
            << CDSSTRESS_STAT_OUT( s, m_AdvanceTailError )
            << CDSSTRESS_STAT_OUT( s, m_BadTail )
            << CDSSTRESS_STAT_OUT( s, m_TryAddBasket )
            << CDSSTRESS_STAT_OUT( s, m_AddBasketCount );
    }

    static inline property_stream& operator <<( property_stream& o, cds::intrusive::basket_queue::empty_stat const& /*s*/ )
    {
        return o;
    }

    template <typename Counter>
    static inline property_stream& operator <<( property_stream& o, cds::intrusive::msqueue::stat<Counter> const& s )
    {
        return o
            << CDSSTRESS_STAT_OUT( s, m_EnqueueCount )
            << CDSSTRESS_STAT_OUT( s, m_EnqueueRace )
            << CDSSTRESS_STAT_OUT( s, m_DequeueCount )
            << CDSSTRESS_STAT_OUT( s, m_EmptyDequeue )
            << CDSSTRESS_STAT_OUT( s, m_DequeueRace )
            << CDSSTRESS_STAT_OUT( s, m_AdvanceTailError )
            << CDSSTRESS_STAT_OUT( s, m_BadTail );
    }

    static inline property_stream& operator <<( property_stream& o, cds::intrusive::msqueue::empty_stat const& /*s*/ )
    {
        return o;
    }

    static inline property_stream& operator <<( property_stream& o, cds::opt::none )
    {
        return o;
    }

    template <typename Counter>
    static inline property_stream& operator <<( property_stream& o, cds::intrusive::optimistic_queue::stat<Counter> const& s )
    {
        return o
            << CDSSTRESS_STAT_OUT( s, m_EnqueueCount )
            << CDSSTRESS_STAT_OUT( s, m_EnqueueRace )
            << CDSSTRESS_STAT_OUT( s, m_DequeueCount )
            << CDSSTRESS_STAT_OUT( s, m_EmptyDequeue )
            << CDSSTRESS_STAT_OUT( s, m_DequeueRace )
            << CDSSTRESS_STAT_OUT( s, m_AdvanceTailError )
            << CDSSTRESS_STAT_OUT( s, m_BadTail )
            << CDSSTRESS_STAT_OUT( s, m_FixListCount );
    }

    static inline property_stream& operator <<( property_stream& o, cds::intrusive::optimistic_queue::empty_stat const& /*s*/ )
    {
        return o;
    }

    static inline property_stream& operator <<( property_stream& o, std::nullptr_t /*s*/ )
    {
        return o;
    }

    static inline property_stream& operator <<( property_stream& o, cds::intrusive::segmented_queue::stat<> const& s )
    {
        return o
            << CDSSTRESS_STAT_OUT( s, m_nPush )
            << CDSSTRESS_STAT_OUT( s, m_nPushPopulated )
            << CDSSTRESS_STAT_OUT( s, m_nPushContended )
            << CDSSTRESS_STAT_OUT( s, m_nPop )
            << CDSSTRESS_STAT_OUT( s, m_nPopEmpty )
            << CDSSTRESS_STAT_OUT( s, m_nPopContended )
            << CDSSTRESS_STAT_OUT( s, m_nCreateSegmentReq )
            << CDSSTRESS_STAT_OUT( s, m_nDeleteSegmentReq )
            << CDSSTRESS_STAT_OUT( s, m_nSegmentCreated )
            << CDSSTRESS_STAT_OUT( s, m_nSegmentDeleted );
    }

    static inline property_stream& operator <<( property_stream& o, cds::intrusive::segmented_queue::empty_stat const& /*s*/ )
    {
        return o;
    }

} // namespace cds_test

#endif // CDSSTRESS_QUEUE_PRINT_STAT_H