Grappa  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 49 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 69 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 90 of file CallbackMetric.hpp.

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

Definition at line 94 of file CallbackMetric.hpp.

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

Definition at line 34 of file CallbackMetricImpl.hpp.

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

Definition at line 106 of file CallbackMetric.hpp.

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

Definition at line 110 of file CallbackMetric.hpp.

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

Definition at line 84 of file CallbackMetric.hpp.

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

Get the current value.

Definition at line 80 of file CallbackMetric.hpp.


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