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

Member Typedef Documentation

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

Definition at line 69 of file StringMetric.hpp.

Member Enumeration Documentation

anonymous enum
Enumerator
max_string_size 

Definition at line 54 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 82 of file StringMetric.hpp.

Member Function Documentation

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

Definition at line 115 of file StringMetric.hpp.

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

Definition at line 95 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 140 of file StringMetric.hpp.

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

Definition at line 133 of file StringMetric.hpp.

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

Definition at line 142 of file StringMetric.hpp.

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

Definition at line 100 of file StringMetric.hpp.

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

Definition at line 108 of file StringMetric.hpp.

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

Get the current value.

Definition at line 130 of file StringMetric.hpp.

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

Definition at line 57 of file StringMetric.hpp.

Member Data Documentation

InitFn Grappa::StringMetric::initf_
protected

Definition at line 72 of file StringMetric.hpp.

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

Definition at line 70 of file StringMetric.hpp.

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

Definition at line 71 of file StringMetric.hpp.


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