|
perfc 0.11.0
|
With timestamp Partial specialization for non-void Clock type. More...
#include <perfc/counter.hpp>
With timestamp Partial specialization for non-void Clock type.
Satisfies AtomicCounter requirements.
| T | counter value type. Type requirements:
|
| Clock | a clock satisfying TrivialClock requirements. |
Definition at line 364 of file counter.hpp.
Public Types | |
| using | ClockType = Clock |
| using | TimePointType = typename ClockType::time_point |
| using | ValueType = Timestamped<T, TimePointType> |
| using | CounterType = std::atomic<ValueType> |
Public Member Functions | |
| Counter () noexcept | |
Construct with value-initialized T (T()) | |
| Counter (T value) noexcept | |
| Initialze with a value using current time. | |
| Counter (ValueType value) noexcept | |
| Initialze with value and time. | |
| Counter (Counter const &)=delete | |
| bool | IsLockFree () const noexcept |
| Query if operations are lock free. | |
| void | Store (T value, MemoryOrder order=MemoryOrder::Release) noexcept |
| Stores provided value and with current time by querying clock. | |
| void | Store (ValueType value, MemoryOrder order=MemoryOrder::Release) noexcept |
| Store value with provided timestamp in counter. | |
| ValueType | Load (MemoryOrder order=MemoryOrder::Acquire) const noexcept |
| Load value and timestamp from counter. | |
Static Public Attributes | |
| static constexpr bool | IS_ALWAYS_LOCK_FREE = CounterType::is_always_lock_free |
| Is true if counter is always lock free. | |
Related Symbols | |
(Note that these are not member symbols.) | |
| enum | MemoryOrder |
| Memory ordering constraints. More... | |
| using perfc::Counter< T, Clock, typename std::enable_if<!std::is_void< Clock >::value >::type >::ClockType = Clock |
Definition at line 366 of file counter.hpp.
| using perfc::Counter< T, Clock, typename std::enable_if<!std::is_void< Clock >::value >::type >::CounterType = std::atomic<ValueType> |
Definition at line 369 of file counter.hpp.
| using perfc::Counter< T, Clock, typename std::enable_if<!std::is_void< Clock >::value >::type >::TimePointType = typename ClockType::time_point |
Definition at line 367 of file counter.hpp.
| using perfc::Counter< T, Clock, typename std::enable_if<!std::is_void< Clock >::value >::type >::ValueType = Timestamped<T, TimePointType> |
Definition at line 368 of file counter.hpp.
|
inlineexplicitnoexcept |
Construct with value-initialized T (T())
Definition at line 379 of file counter.hpp.
|
inlineexplicitnoexcept |
Initialze with a value using current time.
| value | Initial value. |
Definition at line 387 of file counter.hpp.
|
inlineexplicitnoexcept |
Initialze with value and time.
| value | Initial value and timestamp. |
Definition at line 395 of file counter.hpp.
|
delete |
|
inlinenoexcept |
Query if operations are lock free.
Definition at line 405 of file counter.hpp.
|
inlinenodiscardnoexcept |
Load value and timestamp from counter.
| order | Memory order constraints. |
Definition at line 435 of file counter.hpp.
|
inlinenoexcept |
Stores provided value and with current time by querying clock.
| value | Counter value to store. |
| order | Memory order constraints. |
Definition at line 415 of file counter.hpp.
|
inlinenoexcept |
Store value with provided timestamp in counter.
| value | Counter value and timestamp to store. |
| order | Memory order constraints. |
Definition at line 425 of file counter.hpp.
|
Memory ordering constraints.
Definition at line 81 of file counter.hpp.
|
staticconstexpr |
Is true if counter is always lock free.
Definition at line 374 of file counter.hpp.