CARMA C++
|
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... | |
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.
carma::dbms::MonitorDescription::MonitorDescription | ( | const std::string & | canonicalName, |
const MonitorPointType & | mpType, | ||
const MonitorPointDataType & | dataType, | ||
const bool & | persistent, | ||
const unsigned & | updateInterval, | ||
const bool & | spectrum | ||
) |
constructor
canonicalName | the canonical name of the point |
mpType | the monitor point type |
dataType | the monitor point data type |
persistent | is the point persistent? |
updateInterval | number of half second frames between updates |
spectrum | does the point represent a spectrum (as opposed to a time series)? |
void carma::dbms::MonitorDescription::addEnumerator | ( | const std::string & | enumerator, |
const std::string & | description = "" |
||
) |
add an enumerator and its description
enumerator | the enumerator |
description | the enumerator's description |
CARMA_ERROR | if 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?
other | the monitor description to compare |
msg | (output) a message summarizing the comparison |
std::string carma::dbms::MonitorDescription::getDescription | ( | ) | const |
get 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
CARMA_ERROR | if this description is not for a point of type DATATYPE_ENUMERATOR |
std::vector<std::string> carma::dbms::MonitorDescription::getEnumerators | ( | ) | const |
get enumerators names
CARMA_ERROR | if 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 |
MonitorPointType carma::dbms::MonitorDescription::getMonitorPointType | ( | ) | const |
get the monitor point type
ErrorException | if 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
Definition at line 131 of file MonitorDescription.h.
std::string carma::dbms::MonitorDescription::getShortName | ( | ) | const |
std::string carma::dbms::MonitorDescription::getSubsystemName | ( | ) | const |
get the subystem name to which this point belongs
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
Definition at line 201 of file MonitorDescription.h.
std::string carma::dbms::MonitorDescription::getUnits | ( | ) | const |
int carma::dbms::MonitorDescription::getUpdateInterval | ( | ) | const |
get 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?
md | the description to compare to |
bool carma::dbms::MonitorDescription::isPersistent | ( | ) | const |
is the point persistent?
Definition at line 180 of file MonitorDescription.h.
bool carma::dbms::MonitorDescription::isSpectrum | ( | ) | const |
does the point represent 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
enumerator | the enumerator |
description | the enumerator's description |
CARMA_ERROR | if 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
shortName | the 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
frameCount | the 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