proxygen
AtomicCounter< T, Atom > Class Template Reference

Public Member Functions

 AtomicCounter (T val)
 
void inc ()
 
void incBug ()
 
T load ()
 

Private Attributes

Atom< Tcounter_ = {0}
 

Friends

struct AnnotatedAtomicCounter< T >
 

Detailed Description

template<typename T, template< typename > class Atom = std::atomic>
class AtomicCounter< T, Atom >

Original template to be tested

Definition at line 174 of file DeterministicScheduleTest.cpp.

Constructor & Destructor Documentation

template<typename T , template< typename > class Atom = std::atomic>
AtomicCounter< T, Atom >::AtomicCounter ( T  val)
inlineexplicit

Definition at line 179 of file DeterministicScheduleTest.cpp.

179 : counter_(val) {}
double val
Definition: String.cpp:273

Member Function Documentation

template<typename T , template< typename > class Atom = std::atomic>
void AtomicCounter< T, Atom >::inc ( )
inline

Definition at line 181 of file DeterministicScheduleTest.cpp.

References counter_.

181  {
182  this->counter_.fetch_add(1);
183  }
template<typename T , template< typename > class Atom = std::atomic>
void AtomicCounter< T, Atom >::incBug ( )
inline

Definition at line 185 of file DeterministicScheduleTest.cpp.

References counter_.

185  {
186  this->counter_.store(this->counter_.load() + 1);
187  }
template<typename T , template< typename > class Atom = std::atomic>
T AtomicCounter< T, Atom >::load ( )
inline

Definition at line 189 of file DeterministicScheduleTest.cpp.

References counter_.

189  {
190  return this->counter_.load();
191  }

Friends And Related Function Documentation

template<typename T , template< typename > class Atom = std::atomic>
friend struct AnnotatedAtomicCounter< T >
friend

Friend declaration to allow full access

Definition at line 176 of file DeterministicScheduleTest.cpp.

Member Data Documentation

template<typename T , template< typename > class Atom = std::atomic>
Atom<T> AtomicCounter< T, Atom >::counter_ = {0}
private

Definition at line 194 of file DeterministicScheduleTest.cpp.


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