CARMA C++
|
A class that manages the sets of monitor points for a monitor subsystem. More...
#include <carma/monitor/MonitorPointSet.h>
Public Member Functions | |
bool | autoWriterIsAlive () |
method to test whether the auto-writer thread is alive. More... | |
void | consolidateStorage () |
Calls SubsystemFrame::consolidateSamples() on the SubsystemFrame managed by this MonitorPointSet. More... | |
SubsystemFrameBuffer & | getBuffer () const |
double | getEndWriteTime () const |
method to return the time at which the last write ended. More... | |
unsigned int | getHighWaterMark (MonitorValueType mvt) |
Get highwater marks for a particular MonitorValueType. More... | |
double | getStartScriberWriteTime () const |
method to return the time at which the last write invoked the remote procedure on the ScriberPublisher. More... | |
double | getStartWriteTime () const |
method to return the time at which the last write started. More... | |
SubsystemFrame & | getSubsystemFrame () const |
Returns reference to SubsystemFrame managed by this MonitorPointSet. More... | |
virtual ushort | getSubsystemID () const |
Returns subsystemID of subsystem managed by this MonitorPointSet. More... | |
void | installPrewriteMethod (const Runnable &prewriteMethod) |
void | markMpAtIndexModified (int index) |
Marks the monitor point specified by index in monitorHeader array as modified. More... | |
void | markMpWithTagIdModified (const tagIDType tagID) |
Marks the monitor point specified by tagID as modified. More... | |
virtual unsigned int | read () |
Causes a read from the IPQ associated with the internally stored subsystem frame. More... | |
virtual bool | readNewest () |
Causes a read of the latest frame from the IPQ associated wit the internally stored subsystem frame. More... | |
virtual bool | readNewestConditionalCopy () |
If new data is available it is copied from the queue into the monitor system. More... | |
void | removePrewriteMethod (const Runnable &prewriteMethod) |
virtual void | setNumSamplesPerCycle (int index, const ushort samples) |
Method to modify number of samples associated with the monitor point whose header is at position 'index' in the monitorHeader array in the SubsystemFrame managed by this MonitorPointSet. More... | |
void | startAutoWriter () |
method to start the auto-write thread. More... | |
void | startAutoWriter (double delay) |
method to configure and start the auto-write thread. More... | |
void | stopAutoWriter () |
method to stop the auto-write thread. More... | |
virtual void | write (bool autoWrite, double autoWriteDelay=0.0) |
Sends local monitor point values to FrameScriberPublisher Only sample values of modified monitor points are sent to the frame scriber. More... | |
virtual | ~MonitorPointSet () |
Destructor. More... | |
Static Public Member Functions | |
static MonitorPointSet & | getMonitorPointSet (long subsystemID, long maxMonitorPoints, long maxSamples) |
method to return a MonitorPointSet. More... | |
Friends | |
class | SystemFrameBuffer |
A class that manages the sets of monitor points for a monitor subsystem.
Definition at line 37 of file MonitorPointSet.h.
|
virtual |
Destructor.
bool carma::monitor::MonitorPointSet::autoWriterIsAlive | ( | ) |
method to test whether the auto-writer thread is alive.
void carma::monitor::MonitorPointSet::consolidateStorage | ( | ) |
Calls SubsystemFrame::consolidateSamples() on the SubsystemFrame managed by this MonitorPointSet.
double carma::monitor::MonitorPointSet::getEndWriteTime | ( | ) | const |
method to return the time at which the last write ended.
Definition at line 208 of file MonitorPointSet.h.
unsigned int carma::monitor::MonitorPointSet::getHighWaterMark | ( | MonitorValueType | mvt | ) |
Get highwater marks for a particular MonitorValueType.
Highwater marks represent the maximum number of monitor samples seen in a frame for a particular type for all frames thus far processed. This is useful for preallocating transport sequence sizes to avoid excessive reallocation which can be a killer on some large subsystems.
|
static |
method to return a MonitorPointSet.
This factory method returns a reference to a MonitorPointSet object. When subsystemID > 0, it returns the MonitorPointSet object for the specified subsystem. It is expected that the case when subsystemID > 0 will occur only where a SystemFrame object is available, or when a MonitorPointSet object is being initialized within a subsystem.
throws | an ErrorException if subsystemID = 0 |
double carma::monitor::MonitorPointSet::getStartScriberWriteTime | ( | ) | const |
method to return the time at which the last write invoked the remote procedure on the ScriberPublisher.
Definition at line 199 of file MonitorPointSet.h.
double carma::monitor::MonitorPointSet::getStartWriteTime | ( | ) | const |
method to return the time at which the last write started.
Bear in mind that this time may not be consistent with the startScriberWriteTime and the EndWriteTime on those occasions when a write intervenes between calls to get these values.
Definition at line 189 of file MonitorPointSet.h.
SubsystemFrame& carma::monitor::MonitorPointSet::getSubsystemFrame | ( | ) | const |
Returns reference to SubsystemFrame managed by this MonitorPointSet.
|
virtual |
Returns subsystemID of subsystem managed by this MonitorPointSet.
void carma::monitor::MonitorPointSet::installPrewriteMethod | ( | const Runnable & | prewriteMethod | ) |
Install a method to be executed before the write.
Create a class that inherits from Runnable and define the execute() method. This method will be called before the write is done. Useful for marking sense points as INVALID_NO_HARDWARE if the data has not shown up by the time it is ready to write.
Take caution to only install the prewrite method on MPset instances that have any necessary monitor points populated within that MPset. For example, using the same prewrite method for MPsets instances running in different processes is usually not what you want.
void carma::monitor::MonitorPointSet::markMpAtIndexModified | ( | int | index | ) |
Marks the monitor point specified by index in monitorHeader array as modified.
index | int index of modified monitor point in monitorHeader array in SubsystemFrame managed by this MonitorPointSet. |
void carma::monitor::MonitorPointSet::markMpWithTagIdModified | ( | const tagIDType | tagID | ) |
Marks the monitor point specified by tagID as modified.
tagID | Identifier of modified monitor point in SubsystemFrame managed by this MonitorPointSet. |
|
virtual |
Causes a read from the IPQ associated with the internally stored subsystem frame.
Takes effect only in within a subsystem - in the ACC, the only IPQ available is the IPQ for the entire MonitorSystem.
|
virtual |
Causes a read of the latest frame from the IPQ associated wit the internally stored subsystem frame.
Takes effect only in within a subsystem - in the ACC, the only IPQ available is the IPQ for the entire MonitorSystem.
|
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.
void carma::monitor::MonitorPointSet::removePrewriteMethod | ( | const Runnable & | prewriteMethod | ) |
Remove a previously installed prewrite method.
|
virtual |
Method to modify number of samples associated with the monitor point whose header is at position 'index' in the monitorHeader array in the SubsystemFrame managed by this MonitorPointSet.
index | int index of modified monitor point in monitorHeader array in SubsystemFrame managed by this MonitorPointSet. |
samples | const ushort number of samples to be associated with the monitor point specified by 'index'. |
void carma::monitor::MonitorPointSet::startAutoWriter | ( | ) |
method to start the auto-write thread.
This method starts the thread for automatic writing. The thread does an initial write immediately, and then writes all modified monitor points to the monitor stream with a period of a half-second. The modified points are written at (half-second+delay) seconds. The halfsecond corresponds to the half-second tick in UTC (corrected).
void carma::monitor::MonitorPointSet::startAutoWriter | ( | double | delay | ) |
method to configure and start the auto-write thread.
This method configures and starts the thread for automatic writing. The parameter delay must be greater than zero.
double delay in seconds. delay must be less than or equal to MAX_AUTO_WRITE_DELAY and greater than zero as the auto-writer operates on a period of a half-second. So delay must always be less than MAX_AUTO_WRITE_DELAY.
throws | an ErrorException if delay > MAX_AUTO_WRITE_DELAY |
void carma::monitor::MonitorPointSet::stopAutoWriter | ( | ) |
method to stop the auto-write thread.
This method stops the thread for automatic writing. The thread makes a clean exit, completing any pending write.
|
virtual |
Sends local monitor point values to FrameScriberPublisher Only sample values of modified monitor points are sent to the frame scriber.
If 'autoWrite' is true, then the sending method is called by the auto writer thread.
autoWrite | bool if true, then auto writer is calling this method. |
autoWriteDelay | The autowrite delay if autoWrite true, else ignore. |