CARMA C++
carma::monitor::MonitorPointSet Class Reference

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...
 
SubsystemFrameBuffergetBuffer () 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...
 
SubsystemFramegetSubsystemFrame () 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 MonitorPointSetgetMonitorPointSet (long subsystemID, long maxMonitorPoints, long maxSamples)
 method to return a MonitorPointSet. More...
 

Friends

class SystemFrameBuffer
 

Detailed Description

A class that manages the sets of monitor points for a monitor subsystem.

Definition at line 37 of file MonitorPointSet.h.

Constructor & Destructor Documentation

virtual carma::monitor::MonitorPointSet::~MonitorPointSet ( )
virtual

Destructor.

Member Function Documentation

bool carma::monitor::MonitorPointSet::autoWriterIsAlive ( )

method to test whether the auto-writer thread is alive.

Returns
bool - true if auto-writer thread is alive, false otherwise.
void carma::monitor::MonitorPointSet::consolidateStorage ( )
double carma::monitor::MonitorPointSet::getEndWriteTime ( ) const

method to return the time at which the last write ended.

Returns
double - returns the time as measured by Time class. Time when last MonitorPointSet::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 MonitorPointSet& carma::monitor::MonitorPointSet::getMonitorPointSet ( long  subsystemID,
long  maxMonitorPoints,
long  maxSamples 
)
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.

Returns
reference to MonitorPointSet.
Exceptions
throwsan 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.

Returns
double - returns the time as measured by Time class. Time when MonitorPointUpdateServant::monitorPointSeqUpdate was last invoked.

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.

Returns
double - returns the time as measured by Time class. Time when MonitorPointSet::write was last invoked.

Definition at line 189 of file MonitorPointSet.h.

SubsystemFrame& carma::monitor::MonitorPointSet::getSubsystemFrame ( ) const

Returns reference to SubsystemFrame managed by this MonitorPointSet.

Returns
SubsystemFrame& reference to managed SubsystemFrame.
virtual ushort carma::monitor::MonitorPointSet::getSubsystemID ( ) const
virtual

Returns subsystemID of subsystem managed by this MonitorPointSet.

Returns
ushort 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.

Parameters
indexint 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.

Parameters
tagIDIdentifier of modified monitor point in SubsystemFrame managed by this MonitorPointSet.
virtual unsigned int carma::monitor::MonitorPointSet::read ( )
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 bool carma::monitor::MonitorPointSet::readNewest ( )
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 bool carma::monitor::MonitorPointSet::readNewestConditionalCopy ( )
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
void carma::monitor::MonitorPointSet::removePrewriteMethod ( const Runnable prewriteMethod)

Remove a previously installed prewrite method.

virtual void carma::monitor::MonitorPointSet::setNumSamplesPerCycle ( int  index,
const ushort  samples 
)
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.

Parameters
indexint index of modified monitor point in monitorHeader array in SubsystemFrame managed by this MonitorPointSet.
samplesconst 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).

Returns
none
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.

Returns
none
Exceptions
throwsan ErrorException if delay > MAX_AUTO_WRITE_DELAY
See Also
MonitorPointSet::startAutoWriter
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.

Returns
none
virtual void carma::monitor::MonitorPointSet::write ( bool  autoWrite,
double  autoWriteDelay = 0.0 
)
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.

Parameters
autoWritebool if true, then auto writer is calling this method.
autoWriteDelayThe autowrite delay if autoWrite true, else ignore.

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