CMS 3D CMS Logo

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 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 39 of file StorageAccount.h.

Constructor & Destructor Documentation

◆ Counter() [1/2]

StorageAccount::Counter::Counter ( )
inline

Definition at line 40 of file StorageAccount.h.

41  : attempts{0},
42  successes{0},
43  amount{0},
44  amount_square{0.},
45  vector_count{0},
46  vector_square{0},
47  timeTotal{0.},
48  timeMin{0.},
49  timeMax{0.} {}

◆ Counter() [2/2]

StorageAccount::Counter::Counter ( Counter const &  iOther)
inline

Definition at line 55 of file StorageAccount.h.

56  : attempts{iOther.attempts.load()},
57  successes{iOther.successes.load()},
58  amount{iOther.amount.load()},
59  amount_square{iOther.amount_square.load()},
60  vector_count{iOther.vector_count.load()},
61  vector_square{iOther.vector_square.load()},
62  timeTotal{iOther.timeTotal.load()},
63  timeMin{iOther.timeMin.load()},
64  timeMax{iOther.timeMax.load()} {}

References attempts.

Member Function Documentation

◆ addTo()

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

Definition at line 84 of file StorageAccount.h.

84  {
85  double oldValue = iAtomic.load();
86  double newValue = oldValue + iToAdd;
87  while (not iAtomic.compare_exchange_weak(oldValue, newValue)) {
88  newValue = oldValue + iToAdd;
89  }
90  }

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

Member Data Documentation

◆ amount

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

Definition at line 74 of file StorageAccount.h.

◆ amount_square

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

Definition at line 77 of file StorageAccount.h.

◆ attempts

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

Definition at line 72 of file StorageAccount.h.

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

◆ successes

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

Definition at line 73 of file StorageAccount.h.

◆ timeMax

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

Definition at line 82 of file StorageAccount.h.

◆ timeMin

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

Definition at line 81 of file StorageAccount.h.

◆ timeTotal

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

Definition at line 80 of file StorageAccount.h.

◆ vector_count

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

Definition at line 78 of file StorageAccount.h.

◆ vector_square

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

Definition at line 79 of file StorageAccount.h.

StorageAccount::Counter::timeTotal
std::atomic< double > timeTotal
Definition: StorageAccount.h:80
StorageAccount::Counter::amount
std::atomic< uint64_t > amount
Definition: StorageAccount.h:74
StorageAccount::Counter::timeMax
std::atomic< double > timeMax
Definition: StorageAccount.h:82
StorageAccount::Counter::vector_square
std::atomic< int64_t > vector_square
Definition: StorageAccount.h:79
StorageAccount::Counter::successes
std::atomic< uint64_t > successes
Definition: StorageAccount.h:73
StorageAccount::Counter::vector_count
std::atomic< int64_t > vector_count
Definition: StorageAccount.h:78
StorageAccount::Counter::attempts
std::atomic< uint64_t > attempts
Definition: StorageAccount.h:72
StorageAccount::Counter::amount_square
std::atomic< double > amount_square
Definition: StorageAccount.h:77
StorageAccount::Counter::timeMin
std::atomic< double > timeMin
Definition: StorageAccount.h:81