Grappa  r3821, hash 22cd626d567a91ead5b23302066d1e9469f45c66
Grappa::CallbackMetric< T > Class Template Reference

Metric that uses a callback to determine the value at sample time. More...

#include <CallbackMetric.hpp>

Inheritance diagram for Grappa::CallbackMetric< T >:

Public Member Functions

 CallbackMetric (const char *name, CallbackFn f, bool reg_new=true)
 
value () const
 Get the current value. More...
 
void start_merging ()
 
virtual CallbackMetric< T > * clone () const
 Note this will only clone its behavior. More...
 
virtual std::ostream & json (std::ostream &o) const
 
virtual void reset ()
 
virtual void sample ()
 
virtual void merge_all (impl::MetricBase *static_stat_ptr)
 

Detailed Description

template<typename T>
class Grappa::CallbackMetric< T >

Metric that uses a callback to determine the value at sample time.

Used for sampling state when the state is not declared within modifiable code. An example would be keeping track of the length of a std::vector. One would create a CallbackMetric with the callback vector.size();

Definition at line 60 of file CallbackMetric.hpp.

Constructor & Destructor Documentation

template<typename T>
Grappa::CallbackMetric< T >::CallbackMetric ( const char *  name,
CallbackFn  f,
bool  reg_new = true 
)
inline

Definition at line 80 of file CallbackMetric.hpp.

Member Function Documentation

template<typename T>
virtual CallbackMetric<T>* Grappa::CallbackMetric< T >::clone ( ) const
inlinevirtual

Note this will only clone its behavior.

Definition at line 101 of file CallbackMetric.hpp.

template<typename T>
virtual std::ostream& Grappa::CallbackMetric< T >::json ( std::ostream &  o) const
inlinevirtual

Definition at line 105 of file CallbackMetric.hpp.

template<typename T >
void Grappa::CallbackMetric< T >::merge_all ( impl::MetricBase *  static_stat_ptr)
virtual

Definition at line 45 of file CallbackMetricImpl.hpp.

template<typename T>
virtual void Grappa::CallbackMetric< T >::reset ( )
inlinevirtual

Definition at line 117 of file CallbackMetric.hpp.

template<typename T>
virtual void Grappa::CallbackMetric< T >::sample ( )
inlinevirtual

Definition at line 121 of file CallbackMetric.hpp.

template<typename T>
void Grappa::CallbackMetric< T >::start_merging ( )
inline

Definition at line 95 of file CallbackMetric.hpp.

template<typename T>
T Grappa::CallbackMetric< T >::value ( ) const
inline

Get the current value.

Definition at line 91 of file CallbackMetric.hpp.


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