CARMA C++
carma::monitor::MonitorSystemContainer Class Referenceabstract

Monitor system container interface definition. More...

#include <carma/monitor/MonitorSystemContainer.h>

Inheritance diagram for carma::monitor::MonitorSystemContainer:
carma::monitor::MonitorContainer carma::monitor::MonitorComponent carma::monitor::MonitorSubsystem carma::monitor::MonitorSystem carma::monitor::CarmaMonitorSystem carma::monitor::FinalCarmaMonitorSystem carma::monitor::RawCarmaMonitorSystem

Public Member Functions

virtual int getFrameCount () const =0
 Get the frame count for the last read frame. More...
 
bool isActive ()
 Checks to see if this system is actively receiving data. More...
 
virtual bool isCurrent () const =0
 Returns true if the IPQ contains data that is current. More...
 
 MonitorSystemContainer (const std::string &systemName)
 Constructor base subsystem configuration. More...
 
virtual unsigned int read ()=0
 Reads oldest unread data from the IPQ into the local set of monitor points. More...
 
virtual bool readNewest ()=0
 Reads in the newest data from the IPQ into the local set of monitor points. More...
 
virtual bool readNewestConditionalCopy ()=0
 If new data is available it is copied from the queue into the monitor system. More...
 
virtual bool readNewestIfStale ()
 Reads in data from the IPQ into the local set of monitor points if data is stale, that is, !isCurrent(). More...
 
virtual void write ()=0
 Write out the monitor point data values. More...
 
virtual ~MonitorSystemContainer ()
 Destructor. More...
 
- Public Member Functions inherited from carma::monitor::MonitorContainer
void add (MonitorComponent &component)
 Add a subcomponent to this container A reference is kept to this subcomponent, so the caller is responsible for managing the lifecycle of the subcomponent; this container simply expects that it be available for access. More...
 
const Child & getChild (int index) const
 Get reference to child monitor component by index. More...
 
::std::vector< Child > getChildVec () const
 Get a vector of monitor components contained by this component. More...
 
MonitorComponentgetComponentPtr (const ::std::string &name, bool caseSensitive) const
 Get a contained monitor component by hierarchical name The hierarchical name starts below this container and consist of dot (".") separated components. More...
 
MonitorPointgetFirstMonitorPoint ()
 Recursively find the first monitor point in this container. More...
 
MonitorPointgetMonitorPoint (const std::string &name, bool caseSensitive) const
 Get a monitor point by name (hierarchical name OK). More...
 
MonitorPointgetMonitorPoint (tagIDType tagID) const
 Get a monitor point by tagID. More...
 
MonitorPointgetMonitorPointPtr (const std::string &name, bool caseSensitive) const
 
MonitorPointgetMonitorPointPtr (tagIDType tagID) const
 
int getNumChildren () const
 Get the number of monitor components contained by this component. More...
 
virtual int getNumContainerChildren () const
 Get the number of child monitor containers contained by this component. More...
 
virtual int getNumContainerDescendants () const
 Get the number of child monitor containers contained by this component and it's children. More...
 
virtual int getNumDescendants () const
 Get the total number of monitor components contained by this component and it's children. More...
 
int getNumMonitorPoints (bool recurse=false) const
 Get the number of monitor points. More...
 
int getNumMonitorPoints ()
 Get the total number of monitor points in this container. More...
 
int getNumSamples ()
 Get the total number of samples in this container. More...
 
bool hasAllData () const
 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
 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
 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
 Dump this and all contained monitor component strings into a map hierarchy. More...
 
virtual std::string leafToString (bool verbose=false, bool value=true, int sampleIndex=0) const
 Dump all leaf nodes below this component to a string. More...
 
 MonitorContainer (const ::std::string &name)
 Constructor. More...
 
virtual ::std::string monitorPointTags (bool untagged=false) const
 Write list of monitor points and their tagIDs to a string, one monitor point per line. More...
 
virtual bool operator== (const MonitorComponent &component) const
 Compares this monitor container for equality to the one passed. More...
 
void setArchivePriority (const MonitorComponent::ARCHIVE_PRIORITY priority, bool onlyDEFAULT=true)
 Recursively set the archive priority of all monitor points below. More...
 
virtual void setCanonicalName (const std::string &parents)
 Recursively set the canonical component name for this and all below. More...
 
virtual void setMonitorPointAttributes ()
 Set attributes of all monitor points held anywhere in the hierarchy within (and below) this container. More...
 
void setNoData () const
 Recursively mark all data samples as INVALID_NO_DATA. More...
 
void setPersistent (bool persistent)
 Set the persistent attribute for the value of a MonitorPoint, or in the case of a container for its descendants (recursively). More...
 
void setValidity (MonitorPoint::VALIDITY validity)
 Recursively set validity for all samples of all monitor points below this container. More...
 
std::string toString (bool canonicalName=false, bool verbose=false, bool value=true, int sampleIndex=0, int indent=0) const
 Write this monitor component to a string. More...
 
std::string toStringAverage (bool canonicalName=false, bool verbose=false, bool value=true, int indent=0) const
 Write this monitor component to a string, using frame average values. More...
 
 ~MonitorContainer ()
 Destructor. More...
 
- Public Member Functions inherited from carma::monitor::MonitorComponent
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 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...
 
 MonitorComponent (const std::string &name)
 Constructor. More...
 
bool operator!= (const MonitorComponent &component) const
 Checks if components are not equal. 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...
 
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 transportStatisticsToString (bool canonical=false) const
 Dump end-toe-end transport statistics (if available). More...
 
virtual ~MonitorComponent ()
 Destructor. More...
 

Additional Inherited Members

- Public Types inherited from carma::monitor::MonitorComponent
enum  ARCHIVE_PRIORITY {
  VITAL, USEFUL, NORMAL, DEBUG,
  VERBOSE, DEFAULT, DONTARCHIVE
}
 Archiving priority. More...
 
- Static Public Member Functions inherited from carma::monitor::MonitorComponent
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 Member Functions inherited from carma::monitor::MonitorContainer
virtual void setLocalMonitorPointAttributes ()
 Set attributes of all monitor points held directly by this container. More...
 
- Static Protected Member Functions inherited from carma::monitor::MonitorContainer
static Child findDescendant (const MonitorContainer &rootContainer, const ::std::string &name, bool caseSensitive)
 
- Protected Attributes inherited from carma::monitor::MonitorComponent
bool debug_
 

Detailed Description

Monitor system container interface definition.

Definition at line 31 of file MonitorSystemContainer.h.

Constructor & Destructor Documentation

carma::monitor::MonitorSystemContainer::MonitorSystemContainer ( const std::string &  systemName)

Constructor base subsystem configuration.

Parameters
systemNamemonitor system name
virtual carma::monitor::MonitorSystemContainer::~MonitorSystemContainer ( )
virtual

Destructor.

Member Function Documentation

virtual int carma::monitor::MonitorSystemContainer::getFrameCount ( ) const
pure virtual

Get the frame count for the last read frame.

Implemented in carma::monitor::MonitorSystem, and carma::monitor::MonitorSubsystem.

bool carma::monitor::MonitorSystemContainer::isActive ( )

Checks to see if this system is actively receiving data.

It reads the newest frame and checks to see if the frameCount is within two seconds of the current time. Note: this moves the read pointer to the top of the queue.

Returns
true if system has received data in the last 2 seconds.
virtual bool carma::monitor::MonitorSystemContainer::isCurrent ( ) const
pure virtual

Returns true if the IPQ contains data that is current.

A read could make the data current, and hence make isCurrent return true. If a read does not make isCurrent true, then the IPQ is probably not being written into.

Returns
bool true if IPQ is current, false otherwise.

Implemented in carma::monitor::MonitorSystem, and carma::monitor::MonitorSubsystem.

virtual unsigned int carma::monitor::MonitorSystemContainer::read ( )
pure virtual

Reads oldest unread data from the IPQ into the local set of monitor points.

This is a blocking read.

Returns
number of elements lost in reading the queue (non-zero if the reads are so far apart in time that the queue has wrapped around.

Implemented in carma::monitor::MonitorSystem, and carma::monitor::MonitorSubsystem.

virtual bool carma::monitor::MonitorSystemContainer::readNewest ( )
pure virtual

Reads in the newest data from the IPQ into the local set of monitor points.

There is no blocking!!

Returns
false if no data was available in the queue

Implemented in carma::monitor::MonitorSystem, and carma::monitor::MonitorSubsystem.

virtual bool carma::monitor::MonitorSystemContainer::readNewestConditionalCopy ( )
pure virtual

If new data is available it is copied from the queue into the monitor system.

If no unread data is available then the method returns. In either case there is no blocking.

Returns
false if no data was copied

Implemented in carma::monitor::MonitorSystem, and carma::monitor::MonitorSubsystem.

virtual bool carma::monitor::MonitorSystemContainer::readNewestIfStale ( )
virtual

Reads in data from the IPQ into the local set of monitor points if data is stale, that is, !isCurrent().

There is no blocking!!

Returns
false if no data was available in the queue
Deprecated:
Replaced by readNewestConditionalCopy

Reimplemented in carma::monitor::MonitorSystem.

virtual void carma::monitor::MonitorSystemContainer::write ( )
pure virtual

Write out the monitor point data values.

Implemented in carma::monitor::MonitorSystem, and carma::monitor::MonitorSubsystem.


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