List of all members | Public Member Functions
utl::Accumulator::Safe< AccumulatorT > Class Template Reference

#include <Accumulator.h>

Inheritance diagram for utl::Accumulator::Safe< AccumulatorT >:
Inheritance graph
[legend]

Public Member Functions

void Clear ()
 
bool IsValid () const
 
 operator bool () const
 
void operator() (const typename AccumulatorT::Type x)
 
void Validate (const bool state=true)
 

Detailed Description

template<typename AccumulatorT>
class utl::Accumulator::Safe< AccumulatorT >

This class enables the usage of the uninitialized versions (default empty constructors) of the accumulators that require the first value to be passed in the constructor.

Example:

Accumulator::Safe<Accumulator::Min<int> > min;
if (min)
cout << "min is initialized" << endl;
else
cout << "min is uninitialized" << endl;
min(13);
if (min)
cout << "min is initialized" << endl;
else
cout << "min is uninitialized" << endl;
cout << min.GetMin() << endl;

This example prints

min is uninitialized
min is initialized
13

Definition at line 153 of file Utilities/Statistics/Accumulator.h.

Member Function Documentation

template<typename AccumulatorT >
void utl::Accumulator::Safe< AccumulatorT >::Clear ( )
inline
bool utl::Accumulator::Validator::IsValid ( ) const
inlineinherited
template<typename AccumulatorT >
utl::Accumulator::Safe< AccumulatorT >::operator bool ( ) const
inlineexplicit
template<typename AccumulatorT >
void utl::Accumulator::Safe< AccumulatorT >::operator() ( const typename AccumulatorT::Type  x)
inline
void utl::Accumulator::Validator::Validate ( const bool  state = true)
inlineinherited

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

, generated on Tue Sep 26 2023.