test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes
StorageAccount::Counter Struct Reference

#include <StorageAccount.h>

Public Member Functions

 Counter ()
 
 Counter (Counter &&)=default
 
 Counter (Counter const &iOther)
 

Static Public Member Functions

static void addTo (std::atomic< double > &iAtomic, double iToAdd)
 

Public Attributes

std::atomic< uint64_t > amount
 
std::atomic< double > amount_square
 
std::atomic< uint64_t > attempts
 
std::atomic< uint64_t > successes
 
std::atomic< double > timeMax
 
std::atomic< double > timeMin
 
std::atomic< double > timeTotal
 
std::atomic< int64_t > vector_count
 
std::atomic< int64_t > vector_square
 

Detailed Description

Definition at line 40 of file StorageAccount.h.

Constructor & Destructor Documentation

StorageAccount::Counter::Counter ( )
inline

Definition at line 41 of file StorageAccount.h.

41  :
42  attempts{0},
43  successes{0},
44  amount{0},
45  amount_square{0.},
46  vector_count{0},
47  vector_square{0},
48  timeTotal{0.},
49  timeMin{0.},
50  timeMax{0.} {}
std::atomic< double > timeMax
std::atomic< uint64_t > attempts
std::atomic< int64_t > vector_square
std::atomic< int64_t > vector_count
std::atomic< double > timeMin
std::atomic< uint64_t > successes
std::atomic< double > amount_square
std::atomic< uint64_t > amount
std::atomic< double > timeTotal
StorageAccount::Counter::Counter ( Counter &&  )
default
StorageAccount::Counter::Counter ( Counter const &  iOther)
inline

Definition at line 58 of file StorageAccount.h.

References attempts.

58  :
59  attempts{iOther.attempts.load()},
60  successes{iOther.successes.load()},
61  amount{iOther.amount.load()},
62  amount_square{iOther.amount_square.load()},
63  vector_count{iOther.vector_count.load()},
64  vector_square{iOther.vector_square.load()},
65  timeTotal{iOther.timeTotal.load()},
66  timeMin{iOther.timeMin.load()},
67  timeMax{iOther.timeMax.load()} {}
std::atomic< double > timeMax
std::atomic< uint64_t > attempts
std::atomic< int64_t > vector_square
std::atomic< int64_t > vector_count
std::atomic< double > timeMin
std::atomic< uint64_t > successes
std::atomic< double > amount_square
std::atomic< uint64_t > amount
std::atomic< double > timeTotal

Member Function Documentation

static void StorageAccount::Counter::addTo ( std::atomic< double > &  iAtomic,
double  iToAdd 
)
inlinestatic

Definition at line 87 of file StorageAccount.h.

Referenced by StorageAccount::Stamp::tick().

87  {
88  double oldValue = iAtomic.load();
89  double newValue = oldValue + iToAdd;
90  while( not iAtomic.compare_exchange_weak(oldValue, newValue)) {
91  newValue = oldValue+iToAdd;
92  }
93  }

Member Data Documentation

std::atomic<uint64_t> StorageAccount::Counter::amount

Definition at line 77 of file StorageAccount.h.

std::atomic<double> StorageAccount::Counter::amount_square

Definition at line 80 of file StorageAccount.h.

std::atomic<uint64_t> StorageAccount::Counter::attempts

Definition at line 75 of file StorageAccount.h.

Referenced by Counter(), and StorageAccount::Stamp::Stamp().

std::atomic<uint64_t> StorageAccount::Counter::successes

Definition at line 76 of file StorageAccount.h.

std::atomic<double> StorageAccount::Counter::timeMax

Definition at line 85 of file StorageAccount.h.

std::atomic<double> StorageAccount::Counter::timeMin

Definition at line 84 of file StorageAccount.h.

std::atomic<double> StorageAccount::Counter::timeTotal

Definition at line 83 of file StorageAccount.h.

std::atomic<int64_t> StorageAccount::Counter::vector_count

Definition at line 81 of file StorageAccount.h.

std::atomic<int64_t> StorageAccount::Counter::vector_square

Definition at line 82 of file StorageAccount.h.