FastJet 3.4.1
Public Member Functions | List of all members
fastjet::thread_safety_helpers::AtomicCounter< T > Class Template Reference

(would) provides a thread-safe counter (with CXX11 features) More...

#include <fastjet/internal/thread_safety_helpers.hh>

Public Member Functions

 AtomicCounter ()
 default ctor More...
 
 AtomicCounter (const T &count)
 ctor with initialisation More...
 
 AtomicCounter (const AtomicCounter &other)
 copy ctor More...
 
 operator T () const
 for a more friendly usage, overload the type cast More...
 
get () const
 get the count More...
 
void set (const T new_value)
 set the counter to a given value More...
 
step ()
 step the counter and return the value just before it was stepped More...
 
operator++ ()
 override the ++ operator prefix version More...
 
operator++ (int)
 override the ++ operator postfix version More...
 

Detailed Description

template<typename T>
class fastjet::thread_safety_helpers::AtomicCounter< T >

(would) provides a thread-safe counter (with CXX11 features)

Definition at line 179 of file thread_safety_helpers.hh.

Constructor & Destructor Documentation

◆ AtomicCounter() [1/3]

template<typename T >
fastjet::thread_safety_helpers::AtomicCounter< T >::AtomicCounter ( )
inline

default ctor

Definition at line 182 of file thread_safety_helpers.hh.

◆ AtomicCounter() [2/3]

template<typename T >
fastjet::thread_safety_helpers::AtomicCounter< T >::AtomicCounter ( const T &  count)
inline

ctor with initialisation

Definition at line 185 of file thread_safety_helpers.hh.

◆ AtomicCounter() [3/3]

template<typename T >
fastjet::thread_safety_helpers::AtomicCounter< T >::AtomicCounter ( const AtomicCounter< T > &  other)
inline

copy ctor

Definition at line 188 of file thread_safety_helpers.hh.

Member Function Documentation

◆ operator T()

template<typename T >
fastjet::thread_safety_helpers::AtomicCounter< T >::operator T ( ) const
inline

for a more friendly usage, overload the type cast

This will (likely) allow a transparent usage w or wo C++11 features enabled

Definition at line 194 of file thread_safety_helpers.hh.

◆ get()

template<typename T >
T fastjet::thread_safety_helpers::AtomicCounter< T >::get ( ) const
inline

get the count

Definition at line 197 of file thread_safety_helpers.hh.

◆ set()

template<typename T >
void fastjet::thread_safety_helpers::AtomicCounter< T >::set ( const T  new_value)
inline

set the counter to a given value

Definition at line 200 of file thread_safety_helpers.hh.

◆ step()

template<typename T >
T fastjet::thread_safety_helpers::AtomicCounter< T >::step ( )
inline

step the counter and return the value just before it was stepped

Definition at line 205 of file thread_safety_helpers.hh.

◆ operator++() [1/2]

template<typename T >
T fastjet::thread_safety_helpers::AtomicCounter< T >::operator++ ( )
inline

override the ++ operator prefix version

Definition at line 213 of file thread_safety_helpers.hh.

◆ operator++() [2/2]

template<typename T >
T fastjet::thread_safety_helpers::AtomicCounter< T >::operator++ ( int  )
inline

override the ++ operator postfix version

Definition at line 219 of file thread_safety_helpers.hh.


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