ewmscp  ..
Public Member Functions | Public Attributes | List of all members
statCollection< T, TC > Class Template Reference
Inheritance diagram for statCollection< T, TC >:
[legend]
Collaboration diagram for statCollection< T, TC >:
[legend]

Public Member Functions

void addValue (T value)
 
void add (TC *what)
 
template<typename TT = T, typename TCC = TC, typename std::enable_if< std::is_arithmetic< TT >::value &&! std::is_void< TCC >::value >::type... , class ... Types>
 statCollection (decltype(sourceMember) aSourceMember, Types ... args)
 
template<typename TT = T, typename std::enable_if< std::is_arithmetic< TT >::value >::type... , class ... Types>
 statCollection (Types ... args)
 
template<typename TT = T, typename std::enable_if< !std::is_arithmetic< TT >::value >::type... , class ... Types>
 statCollection (decltype(sourceMember) aSourceMember, Types ... args)
 
template<typename TT = T>
std::enable_if< !std::is_arithmetic< TT >::value >::type _print (unsigned long n)
 
template<typename TT = T>
std::enable_if< std::is_arithmetic< TT >::value >::type _print (unsigned long n)
 
void print (unsigned long n) override
 
- Public Member Functions inherited from statCollectionBase< testFile >
 statCollectionBase (const std::string &aName, const std::string &aUnit="s")
 
virtual void add (testFile *)
 
const std::string & getName () const
 
const std::string & getUnit () const
 

Public Attributes

std::conditional< std::is_void< TC >::value, dummyMember, T TC::* >::type sourceMember
 
sum
 
min
 
max
 

Detailed Description

template<typename T, typename TC = testFile>
class statCollection< T, TC >

Definition at line 355 of file fileopstest.cpp.

Constructor & Destructor Documentation

◆ statCollection() [1/3]

template<typename T , typename TC = testFile>
template<typename TT = T, typename TCC = TC, typename std::enable_if< std::is_arithmetic< TT >::value &&! std::is_void< TCC >::value >::type... , class ... Types>
statCollection< T, TC >::statCollection ( decltype(sourceMember aSourceMember,
Types ...  args 
)
inline

Definition at line 376 of file fileopstest.cpp.

376  :
377  statCollectionBase<TC>(args...),
378  sourceMember(aSourceMember),
379  sum(0),
380  min(std::numeric_limits<T>::max()),
381  max(std::numeric_limits<T>::lowest()) {
382  };

Referenced by statCollectionFactory().

Here is the caller graph for this function:

◆ statCollection() [2/3]

template<typename T , typename TC = testFile>
template<typename TT = T, typename std::enable_if< std::is_arithmetic< TT >::value >::type... , class ... Types>
statCollection< T, TC >::statCollection ( Types ...  args)
inline

Definition at line 384 of file fileopstest.cpp.

384  :
385  statCollectionBase<TC>(args...),
386  sum(0),
387  min(std::numeric_limits<T>::max()),
388  max(std::numeric_limits<T>::lowest()) {
389  };

◆ statCollection() [3/3]

template<typename T , typename TC = testFile>
template<typename TT = T, typename std::enable_if< !std::is_arithmetic< TT >::value >::type... , class ... Types>
statCollection< T, TC >::statCollection ( decltype(sourceMember aSourceMember,
Types ...  args 
)
inline

Definition at line 391 of file fileopstest.cpp.

391  :
392  statCollectionBase<TC>(args...),
393  sourceMember(aSourceMember),
394  sum(T::zero()),
395  min(T::max()),
396  max(T::min()) {
397  };

Member Function Documentation

◆ _print() [1/2]

template<typename T , typename TC = testFile>
template<typename TT = T>
std::enable_if< !std::is_arithmetic<TT>::value >::type statCollection< T, TC >::_print ( unsigned long  n)
inline

Definition at line 400 of file fileopstest.cpp.

400  {
401  std::cout << this->getName() << " avg: " << std::scientific
402  << std::chrono::duration_cast<std::chrono::duration<double>>(sum / n).count()
403  << this->getUnit() << ", min: "
404  << std::chrono::duration_cast<std::chrono::duration<double>>(min).count()
405  << this->getUnit() << ", max: "
406  << std::chrono::duration_cast<std::chrono::duration<double>>(max).count()
407  << this->getUnit() << "\n";
408  }

References statCollectionBase< testFile >::getName(), statCollectionBase< testFile >::getUnit(), statCollection< T, TC >::max, statCollection< T, TC >::min, and statCollection< T, TC >::sum.

Referenced by statCollection< T, TC >::print().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _print() [2/2]

template<typename T , typename TC = testFile>
template<typename TT = T>
std::enable_if<std::is_arithmetic<TT>::value>::type statCollection< T, TC >::_print ( unsigned long  n)
inline

Definition at line 411 of file fileopstest.cpp.

411  {
412  std::cout << this->getName() << " avg: "
413  << sum / n
414  << this->getUnit() << ", min: "
415  << min
416  << this->getUnit() << ", max: "
417  << max
418  << this->getUnit() << "\n";
419  }

References statCollectionBase< testFile >::getName(), and statCollectionBase< testFile >::getUnit().

Here is the call graph for this function:

◆ add()

template<typename T , typename TC = testFile>
void statCollection< T, TC >::add ( TC *  what)
inline

Definition at line 372 of file fileopstest.cpp.

372  {
373  addValue(what->*sourceMember);
374  }

References statCollection< T, TC >::addValue(), and statCollection< T, TC >::sourceMember.

Here is the call graph for this function:

◆ addValue()

template<typename T , typename TC = testFile>
void statCollection< T, TC >::addValue ( value)
inline

Definition at line 361 of file fileopstest.cpp.

361  {
362  sum += value;
363 
364  if (value < min) {
365  min = value;
366  }
367 
368  if (value > max) {
369  max = value;
370  }
371  };

References statCollection< T, TC >::max, statCollection< T, TC >::min, and statCollection< T, TC >::sum.

Referenced by statCollection< T, TC >::add(), and collectStats().

Here is the caller graph for this function:

◆ print()

template<typename T , typename TC = testFile>
void statCollection< T, TC >::print ( unsigned long  n)
inlineoverridevirtual

Implements statCollectionBase< testFile >.

Definition at line 420 of file fileopstest.cpp.

420  {
421  _print(n);
422  }

References statCollection< T, TC >::_print().

Here is the call graph for this function:

Member Data Documentation

◆ max

template<typename T , typename TC = testFile>
T statCollection< T, TC >::max

◆ min

template<typename T , typename TC = testFile>
T statCollection< T, TC >::min

◆ sourceMember

template<typename T , typename TC = testFile>
std::conditional<std::is_void<TC>::value, dummyMember, T TC::*>::type statCollection< T, TC >::sourceMember

Definition at line 357 of file fileopstest.cpp.

Referenced by statCollection< T, TC >::add().

◆ sum

template<typename T , typename TC = testFile>
T statCollection< T, TC >::sum

The documentation for this class was generated from the following file:
statCollectionBase< testFile >::getUnit
const std::string & getUnit() const
Definition: fileopstest.cpp:350
statCollection::sum
T sum
Definition: fileopstest.cpp:358
statCollection::addValue
void addValue(T value)
Definition: fileopstest.cpp:361
statCollectionBase
Definition: fileopstest.cpp:338
statCollection::_print
std::enable_if< !std::is_arithmetic< TT >::value >::type _print(unsigned long n)
Definition: fileopstest.cpp:400
statCollection::sourceMember
std::conditional< std::is_void< TC >::value, dummyMember, T TC::* >::type sourceMember
Definition: fileopstest.cpp:357
statCollection::min
T min
Definition: fileopstest.cpp:359
statCollection::max
T max
Definition: fileopstest.cpp:360
statCollectionBase< testFile >::getName
const std::string & getName() const
Definition: fileopstest.cpp:347