CARMA C++
|
A composite interface used to build the monitor system hierarchy. More...
#include <carma/monitor/MonitorComponent.h>
Public Types | |
enum | ARCHIVE_PRIORITY { VITAL, USEFUL, NORMAL, DEBUG, VERBOSE, DEFAULT, DONTARCHIVE } |
Archiving priority. More... | |
Public Member Functions | |
const std::string & | getCanonicalName () const |
Get the canonical component name. More... | |
virtual const std::string & | getDescription () const |
Get the verbose description of the monitor component. More... | |
virtual const std::string & | getLongName () const |
Get the long name of the monitor component. More... | |
virtual const std::string & | getName () const |
Get the component name (leaf part of canonical name). More... | |
virtual std::string | getPhysicalDeviceName () const |
Get the physical device name, if one exists. More... | |
std::string | getPhysicalDeviceString () const |
Get the physical device name, if one exists, enclosed in parentheses. More... | |
std::string | getPhysicalName () const |
Get the physical name, which is location.device.component or if there is no associated physical device it is just component name. More... | |
virtual const std::string & | getShortName () const |
Get the short name of the monitor component. More... | |
virtual bool | hasAllData () const =0 |
See if all MPs in this component and below have data samples. More... | |
virtual ::std::string | hierarchyToString (bool canonical=false, bool verbose=false, bool value=true, int sampleIndex=0, int indent=0, int levels=-1) const =0 |
Dump this and all contained monitor components to a string. More... | |
virtual ::std::string | hierarchyToStringAverage (bool canonical=false, bool verbose=false, bool value=true, int indent=0, int levels=-1) const =0 |
Dump this and all contained monitor components to a string. More... | |
virtual void | hierarchyToVector (::std::vector< ::std::string > &hierarchyList, bool canonical=false, bool verbose=false, int sampleIndex=0) const =0 |
Dump this and all contained monitor component strings into a map hierarchy. More... | |
virtual bool | isMonitorPoint () const |
Identifies this component as a MonitorPoint or any derivative Should be over-ridden by the MonitorPoint class; others that don't derive from MP can use this default implementation. More... | |
virtual bool | isSubsystem () const |
Check if the component is a MonitorSubsystem. More... | |
virtual std::string | leafToString (bool verbose=false, bool value=true, int sampleIndex=0) const =0 |
Dump all leaf nodes below this component to a string. More... | |
MonitorComponent (const std::string &name) | |
Constructor. More... | |
virtual ::std::string | monitorPointTags (bool untagged=false) const =0 |
Write list of monitor points and their tagIDs to a string, one monitor point per line. More... | |
bool | operator!= (const MonitorComponent &component) const |
Checks if components are not equal. More... | |
virtual bool | operator== (const MonitorComponent &component) const =0 |
Interface (pure virtual) for comparison of components The derived class must implement this method. More... | |
virtual void | setCanonicalName (const std::string &parents) |
Recursively set the canonical component name for this and all below. More... | |
void | setDescription (const std::string &text) |
Set the verbose description of the monitor component. More... | |
void | setLongName (const std::string &name) |
Set the long name of the monitor component. More... | |
void | setName (const std::string &name) |
Set the leaf part of the canonical name of the monitor component. More... | |
virtual void | setNoData () const =0 |
Recursively mark all data samples as INVALID_NO_DATA. More... | |
virtual void | setPersistent (bool persistent)=0 |
Set the persistent attribute for the value of a MonitorPoint, or in the case of a container for its descendants (recursively). More... | |
void | setShortName (const std::string &name) |
Set the short name of the monitor component. More... | |
void | setShortName (const std::string &name, int index) |
Set the short name of the monitor component, with an index appended. More... | |
virtual std::string | toString (bool canonicalName=false, bool verbose=false, bool value=true, int sampleIndex=0, int indent=0) const =0 |
Write this monitor component to a string. More... | |
virtual std::string | toStringAverage (bool canonicalName=false, bool verbose=false, bool value=true, int indent=0) const =0 |
Write this monitor component to a string, using frame average values. More... | |
virtual std::string | transportStatisticsToString (bool canonical=false) const |
Dump end-toe-end transport statistics (if available). More... | |
virtual | ~MonitorComponent () |
Destructor. More... | |
Static Public Member Functions | |
static std::string | archivePriorityToString (MonitorComponent::ARCHIVE_PRIORITY priority) |
Get a string representation for an archive priority. More... | |
static std::string | convertAllLower (std::string name) |
Convert a name to all lower case. More... | |
Protected Attributes | |
bool | debug_ |
Related Functions | |
(Note that these are not member functions.) | |
std::ostream & | operator<< (std::ostream &os, const MonitorComponent &component) |
A composite interface used to build the monitor system hierarchy.
Both containers and leaf nodes are derived from this class. Operations can walk down the hierarchy toward the leaf nodes, but not up. This component has constructs for clearing out the samples for all monitor points and setting them to NO_DATA, and for determining when all the monitor points in the container have data.
Definition at line 32 of file MonitorComponent.h.
Archiving priority.
Definition at line 38 of file MonitorComponent.h.
|
explicit |
Constructor.
name | MonitorComponent name (non-hierarchical) Embedded white space is not allowed. An example is "Ovro3" or "mixerCurrent". |
|
virtual |
Destructor.
|
static |
Get a string representation for an archive priority.
priority |
|
static |
Convert a name to all lower case.
name |
const ::std::string & carma::monitor::MonitorComponent::getCanonicalName | ( | ) | const |
Get the canonical component name.
The canonical name begins at the subsystem and represents the physical hierarchy.
Definition at line 439 of file MonitorComponent.h.
|
virtual |
Get the verbose description of the monitor component.
Embedded white space is encouraged, new lines are allowed. An example is "SIS mixer current".
|
virtual |
Get the long name of the monitor component.
This is the name used for a tooltip style help. Embedded white space is allowed and encouraged. An example is "SIS junction current".
|
virtual |
Get the component name (leaf part of canonical name).
|
virtual |
Get the physical device name, if one exists.
Reimplemented in carma::monitor::MonitorDevice.
std::string carma::monitor::MonitorComponent::getPhysicalDeviceString | ( | ) | const |
Get the physical device name, if one exists, enclosed in parentheses.
std::string carma::monitor::MonitorComponent::getPhysicalName | ( | ) | const |
Get the physical name, which is location.device.component or if there is no associated physical device it is just component name.
|
virtual |
Get the short name of the monitor component.
This is the name used for a row or column heading. Embedded white space is not allowed. An example is "Ij".
|
pure virtual |
See if all MPs in this component and below have data samples.
Can be time consuming to check a large branch.
Implemented in carma::monitor::MonitorPoint, and carma::monitor::MonitorContainer.
|
pure virtual |
Dump this and all contained monitor components to a string.
The string will potentially have many lines, and will end with a new line in all cases.
canonical | determines if canonical or component name is output |
verbose | determines if a terse or verbose dump is done |
value | determines if current value is output |
sampleIndex | (0 is first sample) |
indent | for this level in characters |
levels | number of levels below this to descend; -1 means all |
Implemented in carma::monitor::MonitorPoint, and carma::monitor::MonitorContainer.
|
pure virtual |
Dump this and all contained monitor components to a string.
The frame average value is output. The string will potentially have many lines, and will end with a new line in all cases.
canonical | determines if canonical or component name is output |
verbose | determines if a terse or verbose dump is done |
value | determines if current value is output |
indent | for this level in characters |
levels | number of levels below this to descend; -1 means all |
Implemented in carma::monitor::MonitorPoint, and carma::monitor::MonitorContainer.
|
pure virtual |
Dump this and all contained monitor component strings into a map hierarchy.
canonical | determines if canonical or component name is output |
verbose | determines if a terse or verbose dump is done |
Implemented in carma::monitor::MonitorPoint, and carma::monitor::MonitorContainer.
|
virtual |
Identifies this component as a MonitorPoint or any derivative Should be over-ridden by the MonitorPoint class; others that don't derive from MP can use this default implementation.
Used to speed up iteration through a monitor hierarchy.
Reimplemented in carma::monitor::MonitorPoint.
|
virtual |
Check if the component is a MonitorSubsystem.
Reimplemented in carma::monitor::MonitorSubsystem.
|
pure virtual |
Dump all leaf nodes below this component to a string.
Leaf nodes should be MonitorPoints (or a subclass thereof). The string will potentially have many lines, and will end with a new line in all cases. The canonical name is used in the output.
verbose | determines if a terse or verbose dump is done |
value | determines if current value is output |
sampleIndex | (0 is first sample) |
Implemented in carma::monitor::MonitorPoint, and carma::monitor::MonitorContainer.
|
pure virtual |
Write list of monitor points and their tagIDs to a string, one monitor point per line.
untagged | Only list those MPs without tagIDs |
Implemented in carma::monitor::MonitorPoint, and carma::monitor::MonitorContainer.
bool carma::monitor::MonitorComponent::operator!= | ( | const MonitorComponent & | component | ) | const |
Checks if components are not equal.
component | to compare to this component |
|
pure virtual |
Interface (pure virtual) for comparison of components The derived class must implement this method.
component | to compare to this component |
Implemented in carma::monitor::MonitorPointString, carma::monitor::MonitorPointComplex, carma::monitor::MonitorPoint, carma::monitor::MonitorContainer, and carma::monitor::MonitorPointNumeric.
|
virtual |
Recursively set the canonical component name for this and all below.
parents | used for levels above this,for example "parents.thisComponent.allbelow..." |
Reimplemented in carma::monitor::MonitorContainer.
void carma::monitor::MonitorComponent::setDescription | ( | const std::string & | text | ) |
Set the verbose description of the monitor component.
text | verbose description of the monitor component. White space allowed. |
void carma::monitor::MonitorComponent::setLongName | ( | const std::string & | name | ) |
Set the long name of the monitor component.
name | long name of the monitor component. Embedded white space is allowed and encouraged. |
void carma::monitor::MonitorComponent::setName | ( | const std::string & | name | ) |
Set the leaf part of the canonical name of the monitor component.
Also sets the canonical name.
name | of the monitor point. No embedded white space allowed. |
|
pure virtual |
Recursively mark all data samples as INVALID_NO_DATA.
Implemented in carma::monitor::MonitorPoint, and carma::monitor::MonitorContainer.
|
pure virtual |
Set the persistent attribute for the value of a MonitorPoint, or in the case of a container for its descendants (recursively).
Note that this method has no effect on a running FSP, which gets its persistence info from the MPML file. I.e. you can't change the persistence of a monitor point programmatically (dynamically).
persistent | true if the component's value is to be persistent across frames; false if it is to be invalidated after every frame is set. |
Implemented in carma::monitor::MonitorPoint, and carma::monitor::MonitorContainer.
void carma::monitor::MonitorComponent::setShortName | ( | const std::string & | name | ) |
Set the short name of the monitor component.
name | short name of the monitor component. No embedded white space allowed. |
void carma::monitor::MonitorComponent::setShortName | ( | const std::string & | name, |
int | index | ||
) |
Set the short name of the monitor component, with an index appended.
name | short name of the monitor component. |
index | - starting at one, appended to name No embedded white space allowed. |
|
pure virtual |
Write this monitor component to a string.
If verbose, the string may have multiple lines but is guaranteed to be terminated with a newline. If not verbose, the string is guaranteed to be a single line without a newline.
canonicalName | output canonicalName or leaf name |
verbose | determines if a terse or verbose dump is done |
value | determines if current value is output |
sampleIndex | (0 is first sample) |
indent | for this level (number of characters) |
Implemented in carma::monitor::MonitorPoint, and carma::monitor::MonitorContainer.
|
pure virtual |
Write this monitor component to a string, using frame average values.
If verbose, the string may have multiple lines but is guaranteed to be terminated with a newline. If not verbose, the string is guaranteed to be a single line without a newline.
canonicalName | output canonicalName or leaf name |
verbose | determines if a terse or verbose dump is done |
value | determines if current value is output |
indent | for this level (number of characters) |
Implemented in carma::monitor::MonitorPoint, and carma::monitor::MonitorContainer.
|
virtual |
Dump end-toe-end transport statistics (if available).
The string will potentially have many lines, and will end with a new line in all cases.
canonical | determines if canonical or component name is output |
indent | for this level in characters |
Reimplemented in carma::monitor::MonitorSystem, and carma::monitor::MonitorSubsystem.
|
related |
Output string representation of component to a stream. This uses the Component::toString() method with default arguments.
might produce output that looks like this:
os | output ostream |
component | to be stringified |
os
output stream parameter so that stream insertions can be chained in the usual C++ way (as shown in the example). Example: