Grappa  r3821, hash 22cd626d567a91ead5b23302066d1e9469f45c66
Grappa::StringMetric Class Reference

Metric that simply keeps track of a single string value over time. More...

#include <StringMetric.hpp>

Inheritance diagram for Grappa::StringMetric:

Public Types

enum  { max_string_size = 2048 }
 

Public Member Functions

 StringMetric (const char *name, std::string initial_value, bool reg_new=true)
 
virtual std::ostream & json (std::ostream &o) const
 
virtual void reset ()
 
virtual void sample ()
 
virtual StringMetricclone () const
 
virtual void merge_all (impl::MetricBase *static_stat_ptr)
 
std::string value () const
 Get the current value. More...
 
const StringMetricoperator+= (std::string appended)
 
 operator std::string () const
 
StringMetricoperator= (std::string value)
 

Static Public Member Functions

static void write_chars (char *dst, std::string newstr, std::string name="(anonymous)")
 

Protected Types

typedef std::function< std::string(void)> InitFn
 

Protected Attributes

std::string initial_value
 
char value_ [max_string_size]
 
InitFn initf_
 

Detailed Description

Metric that simply keeps track of a single string value over time.

Typically used as a counter, but can also be used for sampling an instantaneous value.

Definition at line 63 of file StringMetric.hpp.

Member Typedef Documentation

typedef std::function<std::string(void)> Grappa::StringMetric::InitFn
protected

Definition at line 80 of file StringMetric.hpp.

Member Enumeration Documentation

anonymous enum
Enumerator
max_string_size 

Definition at line 65 of file StringMetric.hpp.

Constructor & Destructor Documentation

Grappa::StringMetric::StringMetric ( const char *  name,
std::string  initial_value,
bool  reg_new = true 
)
inline

Definition at line 93 of file StringMetric.hpp.

Member Function Documentation

virtual StringMetric* Grappa::StringMetric::clone ( ) const
inlinevirtual

Definition at line 126 of file StringMetric.hpp.

virtual std::ostream& Grappa::StringMetric::json ( std::ostream &  o) const
inlinevirtual

Definition at line 106 of file StringMetric.hpp.

void Grappa::StringMetric::merge_all ( impl::MetricBase *  static_stat_ptr)
virtual

Definition at line 10 of file StringMetricImpl.hpp.

Grappa::StringMetric::operator std::string ( ) const
inline

Definition at line 151 of file StringMetric.hpp.

const StringMetric& Grappa::StringMetric::operator+= ( std::string  appended)
inline

Definition at line 144 of file StringMetric.hpp.

StringMetric& Grappa::StringMetric::operator= ( std::string  value)
inline

Definition at line 153 of file StringMetric.hpp.

virtual void Grappa::StringMetric::reset ( )
inlinevirtual

Definition at line 111 of file StringMetric.hpp.

virtual void Grappa::StringMetric::sample ( )
inlinevirtual

Definition at line 119 of file StringMetric.hpp.

std::string Grappa::StringMetric::value ( ) const
inline

Get the current value.

Definition at line 141 of file StringMetric.hpp.

static void Grappa::StringMetric::write_chars ( char *  dst,
std::string  newstr,
std::string  name = "(anonymous)" 
)
inlinestatic

Definition at line 68 of file StringMetric.hpp.

Member Data Documentation

InitFn Grappa::StringMetric::initf_
protected

Definition at line 83 of file StringMetric.hpp.

std::string Grappa::StringMetric::initial_value
protected

Definition at line 81 of file StringMetric.hpp.

char Grappa::StringMetric::value_[max_string_size]
protected

Definition at line 82 of file StringMetric.hpp.


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