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

Definition at line 80 of file StringMetric.hpp.

Member Enumeration Documentation

anonymous enum

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 

Definition at line 93 of file StringMetric.hpp.

Member Function Documentation

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

Definition at line 126 of file StringMetric.hpp.

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

Definition at line 106 of file StringMetric.hpp.

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

Definition at line 10 of file StringMetricImpl.hpp.

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

Definition at line 151 of file StringMetric.hpp.

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

Definition at line 144 of file StringMetric.hpp.

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

Definition at line 153 of file StringMetric.hpp.

virtual void Grappa::StringMetric::reset ( )

Definition at line 111 of file StringMetric.hpp.

virtual void Grappa::StringMetric::sample ( )

Definition at line 119 of file StringMetric.hpp.

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

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)" 

Definition at line 68 of file StringMetric.hpp.

Member Data Documentation

InitFn Grappa::StringMetric::initf_

Definition at line 83 of file StringMetric.hpp.

std::string Grappa::StringMetric::initial_value

Definition at line 81 of file StringMetric.hpp.

char Grappa::StringMetric::value_[max_string_size]

Definition at line 82 of file StringMetric.hpp.

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