perfc 0.11.0
Loading...
Searching...
No Matches
perfc::Counter< T, void, typename std::enable_if<!std::is_integral< T >::value >::type > Class Template Reference

Non-integrals w/o timestamp Partial specialization matching void clocks and non-integral T's. More...

#include <perfc/counter.hpp>

Detailed Description

template<class T>
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.

Satisfies AtomicCounter requirements.

Definition at line 286 of file counter.hpp.

Public Types

using ClockType = void
 
using TimePointType = void
 
using ValueType = T
 
using CounterType = std::atomic<ValueType>
 

Public Member Functions

 Counter () noexcept
 Construct with value-initialized T (T())
 
 Counter (T value) noexcept
 Initialze with provided value.
 
 Counter (Counter const &)=delete
 
bool IsLockFree () const noexcept
 Query if operations are lock free.
 
void Store (T value, MemoryOrder order=MemoryOrder::Release) noexcept
 Store value in counter.
 
ValueType Load (MemoryOrder order=MemoryOrder::Acquire) const noexcept
 Load value 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...
 

Member Typedef Documentation

◆ ClockType

template<class T>
using perfc::Counter< T, void, typename std::enable_if<!std::is_integral< T >::value >::type >::ClockType = void

Definition at line 288 of file counter.hpp.

◆ CounterType

template<class T>
using perfc::Counter< T, void, typename std::enable_if<!std::is_integral< T >::value >::type >::CounterType = std::atomic<ValueType>

Definition at line 291 of file counter.hpp.

◆ TimePointType

template<class T>
using perfc::Counter< T, void, typename std::enable_if<!std::is_integral< T >::value >::type >::TimePointType = void

Definition at line 289 of file counter.hpp.

◆ ValueType

template<class T>
using perfc::Counter< T, void, typename std::enable_if<!std::is_integral< T >::value >::type >::ValueType = T

Definition at line 290 of file counter.hpp.

Constructor & Destructor Documentation

◆ Counter() [1/3]

template<class T>
perfc::Counter< T, void, typename std::enable_if<!std::is_integral< T >::value >::type >::Counter ( )
inlineexplicitnoexcept

Construct with value-initialized T (T())

Definition at line 300 of file counter.hpp.

◆ Counter() [2/3]

template<class T>
perfc::Counter< T, void, typename std::enable_if<!std::is_integral< T >::value >::type >::Counter ( T value)
inlineexplicitnoexcept

Initialze with provided value.

Parameters
valueInitial value.

Definition at line 308 of file counter.hpp.

◆ Counter() [3/3]

template<class T>
perfc::Counter< T, void, typename std::enable_if<!std::is_integral< T >::value >::type >::Counter ( Counter< T, void, typename std::enable_if<!std::is_integral< T >::value >::type > const & )
delete

Member Function Documentation

◆ IsLockFree()

template<class T>
bool perfc::Counter< T, void, typename std::enable_if<!std::is_integral< T >::value >::type >::IsLockFree ( ) const
inlinenoexcept

Query if operations are lock free.

Returns
true if operations are lock free.
false otherwise.

Definition at line 318 of file counter.hpp.

◆ Load()

template<class T>
ValueType perfc::Counter< T, void, typename std::enable_if<!std::is_integral< T >::value >::type >::Load ( MemoryOrder order = MemoryOrder::Acquire) const
inlinenodiscardnoexcept

Load value from counter.

Parameters
orderMemory order constraints.
Returns
Counter value.

Definition at line 338 of file counter.hpp.

◆ Store()

template<class T>
void perfc::Counter< T, void, typename std::enable_if<!std::is_integral< T >::value >::type >::Store ( T value,
MemoryOrder order = MemoryOrder::Release )
inlinenoexcept

Store value in counter.

Parameters
valueNew counter value to store.
orderMemory order constraints.

Definition at line 328 of file counter.hpp.

Friends And Related Symbol Documentation

◆ MemoryOrder

enum MemoryOrder : std::underlying_type_t< std::memory_order >
related

Memory ordering constraints.

Definition at line 81 of file counter.hpp.

Member Data Documentation

◆ IS_ALWAYS_LOCK_FREE

template<class T>
bool perfc::Counter< T, void, typename std::enable_if<!std::is_integral< T >::value >::type >::IS_ALWAYS_LOCK_FREE = CounterType::is_always_lock_free
staticconstexpr

Is true if counter is always lock free.

Definition at line 295 of file counter.hpp.


The documentation for this class was generated from the following file: