CARMA C++
carma::dbms::MonitorDescription Class Reference

A MonitorDescription object holds all information on a monitor point which is stored in the database and/or an mpml description. More...

#include <carma/dbms/MonitorDescription.h>

Public Member Functions

void addEnumerator (const std::string &enumerator, const std::string &description="")
 add an enumerator and its description More...
 
bool areStaticFieldsEqual (const MonitorDescription &other, std::string &msg) const
 are the static fields of this monitor description the same as the specified description? More...
 
MonitorPointDataType getDataType () const
 
std::string getDescription () const
 get the monitor point description More...
 
std::string getDevice () const
 
std::map< std::string,
std::string > 
getEnumeratorDescriptions () const
 get enumerator descriptions More...
 
std::vector< std::string > getEnumerators () const
 get enumerators names More...
 
std::string getIntegrateFunction () const
 get the name of the function used to integrate (average) the half-second data More...
 
std::string getLocation () const
 
std::string getLongName () const
 get the long name More...
 
MonitorPointType getMonitorPointType () const
 get the monitor point type More...
 
std::string getName () const
 get the canonical name of the monitor point More...
 
std::string getShortName () const
 get the short name More...
 
std::string getSubsystemName () const
 get the subystem name to which this point belongs More...
 
double getThresholdDefaultValue (const carma::monitor::ThresholdValueEnum &thresholdType) const
 get the default value for the specified threshold. More...
 
double getThresholdValue (const carma::monitor::ThresholdValueEnum &thresholdType) const
 
carma::util::frameType getTime () const
 get the frame count for which this description became valid More...
 
std::string getUnits () const
 get the units More...
 
int getUpdateInterval () const
 get the update interval More...
 
bool isDefaultThresholdValue (const carma::monitor::ThresholdValueEnum &thresholdType) const
 is the specified threshold value the default value, ie, is the specified threshold value stored as NULL in the database for this monitor description More...
 
bool isEqualExceptForTime (const MonitorDescription &md) const
 are all fields in the specified description, except perhaps for the time_ field, equal to the fields in this description? More...
 
bool isPersistent () const
 is the point persistent? More...
 
bool isSpectrum () const
 does the point represent a spectrum? More...
 
void makeStaticChangedString (std::ostringstream &ss, const std::string &fieldName, const std::string &oldValue, const std::string &newValue) const
 Create the string describing what static field for which a changed had been attempted. More...
 
void makeStaticChangedString (std::ostringstream &ss, const char *fieldName, const std::string &oldValue, const std::string &newValue) const
 
 MonitorDescription (const std::string &canonicalName, const MonitorPointType &mpType, const MonitorPointDataType &dataType, const bool &persistent, const unsigned &updateInterval, const bool &spectrum)
 constructor More...
 
void setDescription (const std::string &description)
 
void setDevice (const std::string &device)
 
void setEnumeratorDescription (const std::string &enumerator, const std::string &description="")
 add set an enumerators description, unlike addEnumerator, this method should only be called on an existing enumerator More...
 
void setLocation (const std::string &location)
 
void setLongName (const std::string &longName)
 
void setShortName (const std::string &shortName)
 set short name More...
 
void setThresholdValue (const carma::monitor::ThresholdValueEnum &thresholdType, const double &value)
 set the value of the low warning threshold. More...
 
void setTime (const carma::util::frameType &frameCount)
 set the frame count for which this description became valid More...
 
void setUnits (const std::string &units)
 
std::string toString () const
 produce a string representation of the monitor point description More...
 

Detailed Description

A MonitorDescription object holds all information on a monitor point which is stored in the database and/or an mpml description.

Definition at line 29 of file MonitorDescription.h.

Constructor & Destructor Documentation

carma::dbms::MonitorDescription::MonitorDescription ( const std::string &  canonicalName,
const MonitorPointType mpType,
const MonitorPointDataType dataType,
const bool &  persistent,
const unsigned &  updateInterval,
const bool &  spectrum 
)

constructor

Parameters
canonicalNamethe canonical name of the point
mpTypethe monitor point type
dataTypethe monitor point data type
persistentis the point persistent?
updateIntervalnumber of half second frames between updates
spectrumdoes the point represent a spectrum (as opposed to a time series)?

Member Function Documentation

void carma::dbms::MonitorDescription::addEnumerator ( const std::string &  enumerator,
const std::string &  description = "" 
)

add an enumerator and its description

Parameters
enumeratorthe enumerator
descriptionthe enumerator's description
Exceptions
CARMA_ERRORif this description is not for a point of type DATATYPE_ENUMERATOR
bool carma::dbms::MonitorDescription::areStaticFieldsEqual ( const MonitorDescription other,
std::string &  msg 
) const

are the static fields of this monitor description the same as the specified description?

Parameters
otherthe monitor description to compare
msg(output) a message summarizing the comparison
Returns
true if the static fields are equal
std::string carma::dbms::MonitorDescription::getDescription ( ) const

get the monitor point description

Returns
the monitor point description

Definition at line 161 of file MonitorDescription.h.

std::map<std::string,std::string> carma::dbms::MonitorDescription::getEnumeratorDescriptions ( ) const

get enumerator descriptions

Returns
the enumerator->description map
Exceptions
CARMA_ERRORif this description is not for a point of type DATATYPE_ENUMERATOR
std::vector<std::string> carma::dbms::MonitorDescription::getEnumerators ( ) const

get enumerators names

Returns
the enumerator->description map
Exceptions
CARMA_ERRORif this description is not for a point of type DATATYPE_ENUMERATOR
std::string carma::dbms::MonitorDescription::getIntegrateFunction ( ) const

get the name of the function used to integrate (average) the half-second data

Definition at line 193 of file MonitorDescription.h.

std::string carma::dbms::MonitorDescription::getLongName ( ) const

get the long name

Returns
the long name

Definition at line 143 of file MonitorDescription.h.

MonitorPointType carma::dbms::MonitorDescription::getMonitorPointType ( ) const

get the monitor point type

Returns
the monitor point type
Exceptions
ErrorExceptionif the type is not a valid monitor point type

Definition at line 170 of file MonitorDescription.h.

std::string carma::dbms::MonitorDescription::getName ( ) const

get the canonical name of the monitor point

Returns
the canonical name of the monitor point

Definition at line 131 of file MonitorDescription.h.

std::string carma::dbms::MonitorDescription::getShortName ( ) const

get the short name

Returns
the short name

Definition at line 137 of file MonitorDescription.h.

std::string carma::dbms::MonitorDescription::getSubsystemName ( ) const

get the subystem name to which this point belongs

Returns
the subystem name

Definition at line 123 of file MonitorDescription.h.

double carma::dbms::MonitorDescription::getThresholdDefaultValue ( const carma::monitor::ThresholdValueEnum &  thresholdType) const

get the default value for the specified threshold.

Threshold default values are a function of monitor point datatype

carma::util::frameType carma::dbms::MonitorDescription::getTime ( ) const

get the frame count for which this description became valid

Returns
the frame count at which this description became valid

Definition at line 201 of file MonitorDescription.h.

std::string carma::dbms::MonitorDescription::getUnits ( ) const

get the units

Returns
the units

Definition at line 149 of file MonitorDescription.h.

int carma::dbms::MonitorDescription::getUpdateInterval ( ) const

get the update interval

Returns
the update interval

Definition at line 155 of file MonitorDescription.h.

bool carma::dbms::MonitorDescription::isDefaultThresholdValue ( const carma::monitor::ThresholdValueEnum &  thresholdType) const

is the specified threshold value the default value, ie, is the specified threshold value stored as NULL in the database for this monitor description

bool carma::dbms::MonitorDescription::isEqualExceptForTime ( const MonitorDescription md) const

are all fields in the specified description, except perhaps for the time_ field, equal to the fields in this description?

Parameters
mdthe description to compare to
Returns
true if all fields, ignoring time_, are equal
bool carma::dbms::MonitorDescription::isPersistent ( ) const

is the point persistent?

Returns
true if the point is persistent

Definition at line 180 of file MonitorDescription.h.

bool carma::dbms::MonitorDescription::isSpectrum ( ) const

does the point represent a spectrum?

Returns
true if the point represents a spectrum

Definition at line 186 of file MonitorDescription.h.

void carma::dbms::MonitorDescription::makeStaticChangedString ( std::ostringstream &  ss,
const std::string &  fieldName,
const std::string &  oldValue,
const std::string &  newValue 
) const

Create the string describing what static field for which a changed had been attempted.

The format of the string is fairly rigid since it has to be parsed by MonitorConfigurationDatabase::mutateStaticParms(). name="<mpname>" changedField="<fieldname>" Old="<oldvalue>" New="<newvalue>"

   @param ss - Where string is built.
   @param fieldName - Name of static field with a changed value.
   @param oldValue - The old (current) value
   @param newValue - What it was tried to be changed to.
void carma::dbms::MonitorDescription::setEnumeratorDescription ( const std::string &  enumerator,
const std::string &  description = "" 
)

add set an enumerators description, unlike addEnumerator, this method should only be called on an existing enumerator

Parameters
enumeratorthe enumerator
descriptionthe enumerator's description
Exceptions
CARMA_ERRORif this description is not for a point of type DATATYPE_ENUMERATOR or if the specified enumerator doesn't exist
void carma::dbms::MonitorDescription::setShortName ( const std::string &  shortName)

set short name

Parameters
shortNamethe short name

Definition at line 53 of file MonitorDescription.h.

void carma::dbms::MonitorDescription::setThresholdValue ( const carma::monitor::ThresholdValueEnum &  thresholdType,
const double &  value 
)

set the value of the low warning threshold.

void carma::dbms::MonitorDescription::setTime ( const carma::util::frameType frameCount)

set the frame count for which this description became valid

Parameters
frameCountthe frame count at which this description became valid

Definition at line 78 of file MonitorDescription.h.

std::string carma::dbms::MonitorDescription::toString ( ) const

produce a string representation of the monitor point description


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