CARMA C++
carma::monitor::MonitorPointAccumulatorT< T, U > Class Template Reference

MonitorPointAccumulatorT< T, U > More...

#include <carma/monitor/MonitorPointAccumulatorT.h>

Inherits carma::monitor::MonitorPointAccumulatorBase.

Public Member Functions

void accumulate ()
 Method to accumulate sample values in associated average objects - walks through samples and accumulates sample value. More...
 
void accumulateAverage ()
 Method to accumulate sample averages in associated average objects - uses pre-computed average values from monitor points. More...
 
void dumpInstAveragesToFile (long frameCount, FILE *file) const
 dump instantaneous (frame) averages to a file for the dbloader to read More...
 
void dumpInstAveragesToFile (long frameCount, carma::dbms::dbFFIO &file) const
 dump instantaneous (frame) averages to a file for the dbloader to read. More...
 
void dumpLongAveragesToFile (const char *const frameCountText, FILE *const file) const
 dump long (minute,subarray) averages to a file for the dbloader to read More...
 
const T::AccumReportType getAverage (int index=0) const
 Method to compute average value from accumulated sample values in the associated average objects. More...
 
 MonitorPointAccumulatorT (T &typedPoint)
 Constructor Creates an array of average objects for a monitor point with spectral data, or creates one average object for a monitor point with time series data. More...
 
bool operator< (const MonitorPointAccumulatorT &rhs) const
 Method to test ordering of two MonitorPointAccumulator objects. More...
 
bool operator== (const MonitorPointAccumulatorT &rhs) const
 Method to test for equality of two MonitorPointAccumulator objects. More...
 
void resetAccumulator ()
 Method to reset associated average objects so they're initialized for a fresh average calculation. More...
 
void swap (MonitorPointAccumulatorT &rhs)
 swap two instances More...
 
 ~MonitorPointAccumulatorT ()
 Destructor Destroys the created set of average objects. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from carma::monitor::MonitorPointAccumulatorBase
static void cstringToFileThrice (const char *b, FILE *file)
 
static void valueToFile (const bool &avgAcc, FILE *file)
 
static void valueToFile (const ::std::complex< float > &avgAcc, FILE *file)
 
static void valueToFile (const double &avgAcc, FILE *file)
 
static void valueToFile (const float &avgAcc, FILE *file)
 
static void valueToFile (const int &avgAcc, FILE *file)
 
static void valueToFile (const long &avgAcc, FILE *file)
 
static void valueToFile (const short &avgAcc, FILE *file)
 
static void valueToFile (const ::std::string &avgAcc, FILE *file)
 
static void valueToFileThrice (const bool &avgAcc, FILE *file)
 
static void valueToFileThrice (const ::std::complex< float > &avgAcc, FILE *file)
 
static void valueToFileThrice (const double &avgAcc, FILE *file)
 
static void valueToFileThrice (const float &avgAcc, FILE *file)
 
static void valueToFileThrice (const int &avgAcc, FILE *file)
 
static void valueToFileThrice (const long &avgAcc, FILE *file)
 
static void valueToFileThrice (const short &avgAcc, FILE *file)
 
static void valueToFileThrice (const ::std::string &avgAcc, FILE *file)
 

Detailed Description

template<typename T, typename U>
class carma::monitor::MonitorPointAccumulatorT< T, U >

MonitorPointAccumulatorT< T, U >

Associates an average accumulator obejct with a specific monitor point (of type T).

Associates a monitor point of type T with an average accumulator accumulating sample values as type U. For example, MonitorPointAccumulatorT<MonitorPointInt, double, long> associates a monitor point of type MonitorPointInt with an average object of type MonitorPointAverageT<double>, which accumulates sample values in a double, and calculates averages as long.

Definition at line 101 of file MonitorPointAccumulatorT.h.

Constructor & Destructor Documentation

template<typename T , typename U >
carma::monitor::MonitorPointAccumulatorT< T, U >::MonitorPointAccumulatorT ( T &  typedPoint)
explicit

Constructor Creates an array of average objects for a monitor point with spectral data, or creates one average object for a monitor point with time series data.

Parameters
typedPointtype T& monitor point associated with the average object(s).

Definition at line 411 of file MonitorPointAccumulatorT.h.

template<typename T , typename U >
carma::monitor::MonitorPointAccumulatorT< T, U >::~MonitorPointAccumulatorT ( )

Destructor Destroys the created set of average objects.

Definition at line 430 of file MonitorPointAccumulatorT.h.

Member Function Documentation

template<typename T , typename U >
void carma::monitor::MonitorPointAccumulatorT< T, U >::accumulate ( )

Method to accumulate sample values in associated average objects - walks through samples and accumulates sample value.

Definition at line 459 of file MonitorPointAccumulatorT.h.

template<typename T , typename U >
void carma::monitor::MonitorPointAccumulatorT< T, U >::accumulateAverage ( )

Method to accumulate sample averages in associated average objects - uses pre-computed average values from monitor points.

Definition at line 476 of file MonitorPointAccumulatorT.h.

template<typename T , typename U >
void carma::monitor::MonitorPointAccumulatorT< T, U >::dumpInstAveragesToFile ( long  frameCount,
FILE *  file 
) const

dump instantaneous (frame) averages to a file for the dbloader to read

Parameters
frameCountthe frame count associated with the averages
filethe file to write to

Definition at line 520 of file MonitorPointAccumulatorT.h.

template<typename T , typename U >
void carma::monitor::MonitorPointAccumulatorT< T, U >::dumpInstAveragesToFile ( long  frameCount,
carma::dbms::dbFFIO &  file 
) const

dump instantaneous (frame) averages to a file for the dbloader to read.

This differs from the old version in that the dbFFIO object handles any formatting and I/O.

Parameters
frameCountthe frame count associated with the averages
filethe file to write to.

Definition at line 550 of file MonitorPointAccumulatorT.h.

template<typename T , typename U >
void carma::monitor::MonitorPointAccumulatorT< T, U >::dumpLongAveragesToFile ( const char *const  frameCountText,
FILE *const  file 
) const

dump long (minute,subarray) averages to a file for the dbloader to read

Parameters
frameCountthe frame count associated with the averages
filethe file to write to

Definition at line 576 of file MonitorPointAccumulatorT.h.

template<typename T , typename U >
const T::AccumReportType carma::monitor::MonitorPointAccumulatorT< T, U >::getAverage ( int  index = 0) const

Method to compute average value from accumulated sample values in the associated average objects.

Parameters
indexconst int index of sample for spectral data.
Returns
calculated average value.

Definition at line 493 of file MonitorPointAccumulatorT.h.

template<typename T , typename U >
bool carma::monitor::MonitorPointAccumulatorT< T, U >::operator< ( const MonitorPointAccumulatorT< T, U > &  rhs) const

Method to test ordering of two MonitorPointAccumulator objects.

Required for insertion into a map.

Parameters
otherconst MonitorPointAccumulatorT<T&, U> accumulator to be compared to this.
Returns
bool true if associated monitor point of this precedes associated monitor point of other, else false.

Definition at line 511 of file MonitorPointAccumulatorT.h.

template<typename T , typename U >
bool carma::monitor::MonitorPointAccumulatorT< T, U >::operator== ( const MonitorPointAccumulatorT< T, U > &  rhs) const

Method to test for equality of two MonitorPointAccumulator objects.

Required for insertion into a map.

Parameters
otherconst MonitorPointAccumulatorT<T&, U> accumulator to be compared to this.
Returns
bool true if associated monitor points are the same, else false.

Definition at line 502 of file MonitorPointAccumulatorT.h.

template<typename T , typename U >
void carma::monitor::MonitorPointAccumulatorT< T, U >::resetAccumulator ( )

Method to reset associated average objects so they're initialized for a fresh average calculation.

Definition at line 447 of file MonitorPointAccumulatorT.h.

template<typename T , typename U >
void carma::monitor::MonitorPointAccumulatorT< T, U >::swap ( MonitorPointAccumulatorT< T, U > &  rhs)

swap two instances

Definition at line 437 of file MonitorPointAccumulatorT.h.


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