CatapultServer  v0.5.0.1 (Elephant)
catapult::utils::AtomicIncrementDecrementGuard< T > Class Template Reference

RAII class that increments an atomic on construction and decrements it on destruction. More...

Public Member Functions

 AtomicIncrementDecrementGuard (std::atomic< T > &value)
 
 ~AtomicIncrementDecrementGuard ()
 
 AtomicIncrementDecrementGuard (const AtomicIncrementDecrementGuard< T > &rhs)=default
 
AtomicIncrementDecrementGuard< T > & operator= (const AtomicIncrementDecrementGuard< T > &rhs)=default
 

Private Attributes

std::atomic< T > & m_value
 

Detailed Description

template<typename T>
class catapult::utils::AtomicIncrementDecrementGuard< T >

RAII class that increments an atomic on construction and decrements it on destruction.

Constructor & Destructor Documentation

◆ AtomicIncrementDecrementGuard() [1/2]

template<typename T>
catapult::utils::AtomicIncrementDecrementGuard< T >::AtomicIncrementDecrementGuard ( std::atomic< T > &  value)
inlineexplicit

◆ ~AtomicIncrementDecrementGuard()

◆ AtomicIncrementDecrementGuard() [2/2]

Member Function Documentation

◆ operator=()

template<typename T>
AtomicIncrementDecrementGuard<T>& catapult::utils::AtomicIncrementDecrementGuard< T >::operator= ( const AtomicIncrementDecrementGuard< T > &  rhs)
default

Member Data Documentation

◆ m_value

template<typename T>
std::atomic<T>& catapult::utils::AtomicIncrementDecrementGuard< T >::m_value
private

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