SourceForge.net Logo timeSeries: timeSeries Class Library

measures Class Reference
[Data management]

a container for keyword/value pairs More...

#include <measures.h>

Inherits std::vector< measure_t >.

List of all members.

Public Member Functions

void entry (std::string s, int i)
void entry (std::string s, double d)
void entry (std::string s, std::string s2)

Friends

std::ostream & operator<< (std::ostream &os, const measures &m)
void print_labels (std::ostream &os, const measures &m)

Detailed Description

a container for keyword/value pairs

The measures class is a generic container for string/value pairs. It can be used for any purpose but was constructed to make it easy to collect computed measures into a single structure for output.

Measures accepts a string as the keyword. The value part can an int, a double or a string. Any values that can be automatically converted to one of these types is also accepted.

The measures class is a vector type and can contain an unlimited number of string/value pairs. The pairs are initialized by calling the entry member function to add a new pair to the measures object.

Example:

    measures    myExperimentalMeasures;

    int lanex=4;
    myExperimentalMeasures.entry("lane deviations",lanex);

    float laneStdDev=7.2;
    myExperimentalMeasures.entry("lane std. dev.", laneStdDev);

    myExperimentalMeasures.entry("lane departure direction", "Left");

Two output functions are provided: operator<<(std::ostream&,const measures&) and print_labels()

Examples:

campAnalysis.cpp, campVIRTTEXAnalysis.cpp, and hmi04.cpp.


Member Function Documentation

void measures::entry ( std::string  s,
std::string  s2 
) [inline]

add a key/value pair

Parameters:
s a string containing the label associated with the measure
s2 a string value
void measures::entry ( std::string  s,
double  d 
) [inline]

add a key/value pair

Parameters:
s a string containing the label associated with the measure
d a floating point value
void measures::entry ( std::string  s,
int  i 
) [inline]

add a key/value pair

Parameters:
s a string containing the label associated with the measure
i an integer value
Examples:
campAnalysis.cpp, campVIRTTEXAnalysis.cpp, and hmi04.cpp.
Generated on Tue Mar 16 15:10:52 2010 for timeSeries by  doxygen 1.6.3