|
perfc 0.11.0
|
Atomic counters types.
For an introduction with examples see Counters.
Three template specializations are provided. All satisfy the basic concept AtomicCounter :
T constraints | Clock constraints | Counter::ValueType | Notes | Link |
|---|---|---|---|---|
| Integral | - | T |
| Counter<T> |
| Non-Integral | - | T |
| Counter<T> |
| None | Clock satisfy TrivialClock | Timestamped<T, TimePoint> |
| Counter<T, Clock> |
Commonly used types have pre-defined aliases for double, signed and unsigned 64bit integer, with and without timestamp, see list below.
Files | |
| file | counter.hpp |
| Performance counter implementation. | |
Classes | |
| struct | perfc::Timestamped< T, TimePoint > |
| Trivial type describing a counter value and associated timestamp. More... | |
| class | perfc::Counter< T, void, typename std::enable_if< std::is_integral< T >::value >::type > |
| Integrals w/o timestamp Partial specialization for integral types T and without clock. More... | |
| class | perfc::Counter< T, void, typename std::enable_if<!std::is_integral< T >::value >::type > |
| Non-integrals w/o timestamp Partial specialization matching void clocks and non-integral T's. More... | |
| class | perfc::Counter< T, Clock, typename std::enable_if<!std::is_void< Clock >::value >::type > |
| With timestamp Partial specialization for non-void Clock type. More... | |
Enumerations | |
| enum class | perfc::MemoryOrder : std::underlying_type_t< std::memory_order > |
| Memory ordering constraints. More... | |
Aliases of timestamped counters | |
These aliases are using the clock | |
| using | perfc::CounterDoubleTs = Counter<double, std::chrono::steady_clock> |
| using | perfc::CounterU64Ts = Counter<std::uint64_t, std::chrono::steady_clock> |
| using | perfc::CounterI64Ts = Counter<std::int64_t, std::chrono::steady_clock> |
Aliases of non-timestamped counters | |
These counters aliases have no internal timestamp and are very light weight and on most 64bit architectures they are fully lock-free. | |
| using | perfc::CounterDouble = Counter<double, void> |
| using | perfc::CounterU64 = Counter<std::uint64_t, void> |
| using | perfc::CounterI64 = Counter<std::int64_t, void> |
Synchronization functions | |
Provides capability to synchronize relaxed atomic counter reads and writes. | |
| void | perfc::CounterAcquire () noexcept |
| Synchronizes-with CounterRelease() or Counter store operations using MemoryOrder::Release. | |
| void | perfc::CounterRelease () noexcept |
| Synchronizes-with CounterAcquire() or counter load operations using MemoryOrder::Acquire. | |
| using perfc::CounterDouble = Counter<double, void> |
Definition at line 498 of file counter.hpp.
| using perfc::CounterDoubleTs = Counter<double, std::chrono::steady_clock> |
Definition at line 484 of file counter.hpp.
| using perfc::CounterI64 = Counter<std::int64_t, void> |
Definition at line 500 of file counter.hpp.
| using perfc::CounterI64Ts = Counter<std::int64_t, std::chrono::steady_clock> |
Definition at line 486 of file counter.hpp.
| using perfc::CounterU64 = Counter<std::uint64_t, void> |
Definition at line 499 of file counter.hpp.
| using perfc::CounterU64Ts = Counter<std::uint64_t, std::chrono::steady_clock> |
Definition at line 485 of file counter.hpp.
|
Memory ordering constraints.
Definition at line 81 of file counter.hpp.
|
inlinenoexcept |
Synchronizes-with CounterRelease() or Counter store operations using MemoryOrder::Release.
CounterRelease() is only necessary ensure that preceding relaxed operations to Counter are synchronized with reads.
Definition at line 458 of file counter.hpp.
|
inlinenoexcept |
Synchronizes-with CounterAcquire() or counter load operations using MemoryOrder::Acquire.
CounterRelease() is only necessary ensure that preceding relaxed operations to Counter are synchronized with reads.
Definition at line 471 of file counter.hpp.