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

Class representing a data sample for a MonitorPoint. More...

#include <carma/monitor/MonitorPointSample.h>

Public Member Functions

void allocate (ushort headerOffset, ushort iSample)
 Associates this sample with a monitor point represented by a MonitorPointHeader at offset headerOffset within the subsystem frame containing this sample. More...
 
void clear (bool deallocate=false)
 Clears all flags and (optionally) deallocates the sample so the sample is no longer associated with a monitor point. More...
 
void clearBlankingFlags ()
 Method to clear blanking flag value of the monitor sample. More...
 
void clearFlags ()
 Method to clear validity and blanking/flagging flag values of the monitor sample. More...
 
void clearValidityFlags ()
 Method to clear validity flag value of the monitor sample. More...
 
void fillInTransportSample (CORBA::ULong metaIdx, MonitorSampleValues &outSamples, MonitorValueType mvt, tagIDType tagId, int sampleIndex) const
 This method and MonitorPointSample:;getTransportedSample are transport related methods. More...
 
uchar getBlankingFlags () const
 Method to return blanking flag value of the monitor sample. More...
 
MonitorValuegetMonitorValue () const
 Method to get monitor sample value as a union. More...
 
MonitorSampleValuegetSample () const
 Returns a reference to the internal MonitorSampleValue structure. More...
 
ushort getSampleNumber () const
 Method to return sample number asscoiated with this MonitorPointSample. More...
 
void getTransportedSample (CORBA::ULong metaIdx, const MonitorSampleValues &inValues, int headerOffset)
 This method and MonitorPointSample::fillInTransportSample are transport related methods. More...
 
uchar getValidityFlags () const
 Method to return validity flag value of the monitor sample. More...
 
 MonitorPointSample (MonitorSampleValue &sample, int index=-1, MonitorPointSet *set=0)
 Constructor - takes the base level structure, index to the corresponding monitor point's header information and a pointer to the enclosing MonitorPointSet which is non-NULL when in a subsystem. More...
 
MonitorPointSampleoperator= (const MonitorPointSample &rhs)
 Assignment operator. More...
 
void setBlankingFlags (uchar flags)
 Method to set blanking flag value of the monitor sample. More...
 
void setKnownSaneValidityFlags (uchar saneFlags, bool markMpAsModified=true)
 
void setMonitorValueAndKnownSaneValidityFlags (char value, uchar saneFlags)
 Method to set monitor sample value as a char. More...
 
void setMonitorValueAndKnownSaneValidityFlags (short value, uchar saneFlags)
 Method to set monitor sample value as a short. More...
 
void setMonitorValueAndKnownSaneValidityFlags (long value, uchar saneFlags)
 Method to set monitor sample value as a long. More...
 
void setMonitorValueAndKnownSaneValidityFlags (bool value, uchar saneFlags)
 Method to set monitor sample value as a bool. More...
 
void setMonitorValueAndKnownSaneValidityFlags (float value, uchar saneFlags)
 Method to set monitor sample value as a float. More...
 
void setMonitorValueAndKnownSaneValidityFlags (double value, uchar saneFlags)
 Method to set monitor sample value as a double. More...
 
void setMonitorValueAndKnownSaneValidityFlags (const float value[2], uchar saneFlags)
 Method to set monitor sample value as a complex. More...
 
void setSampleNumber (ushort iSample)
 Method to set sample number associated with this MonitorPointSample. More...
 
void setTransportValue (MonitorValueType valueType, TransportMonitorValue &value) const
 Sets monitor point sample value to be transported using value from this sample. More...
 
void setValidityFlags (uchar flags)
 Method to set validity flag value of the monitor sample. More...
 
void setValueSerialNoAndKnownSaneValidityFlags (long value, uchar saneFlags)
 Method to set monitor sample value as a serial number. More...
 
void setValueStringChunkAndKnownSaneValidityFlags (const MonitorValueStringChunk &value, uchar saneFlags)
 Method to set monitor sample value as a string chunk and already "sane" validity flags at the same. More...
 
 ~MonitorPointSample ()
 Destructor. More...
 

Protected Member Functions

MonitorValuegetValue () const
 Returns internal union structure containingv the value of the monitor point sample. More...
 

Detailed Description

Class representing a data sample for a MonitorPoint.

Manages access to low level storage structures and handles the bookkeeping.

Definition at line 79 of file MonitorPointSample.h.

Constructor & Destructor Documentation

carma::monitor::MonitorPointSample::MonitorPointSample ( MonitorSampleValue sample,
int  index = -1,
MonitorPointSet set = 0 
)
explicit

Constructor - takes the base level structure, index to the corresponding monitor point's header information and a pointer to the enclosing MonitorPointSet which is non-NULL when in a subsystem.

Parameters
sampleMonitorSampleValue& reference to MonitorSampleValue structure
indexint offset of monitor point header that represents the monitor point to which this sample is assigned.
setMonitorPointSet* const pointer to MonitorPointSet that contains and manages storage for monitor point and this assigned sample.

Definition at line 496 of file MonitorPointSample.h.

carma::monitor::MonitorPointSample::~MonitorPointSample ( )

Destructor.

Definition at line 508 of file MonitorPointSample.h.

Member Function Documentation

void carma::monitor::MonitorPointSample::allocate ( ushort  headerOffset,
ushort  iSample 
)

Associates this sample with a monitor point represented by a MonitorPointHeader at offset headerOffset within the subsystem frame containing this sample.

A MonitorPointSample is allocated if o dummy != 0 && o MonitorPoint::numSamples() == 1 && iSample != 0

Parameters
headerOffsetushort offset of MonitorPointHeader within the subsystem frame that manages the storage for this sample.
iSampleushort sample number of the sample asssigned to the monitor point represented by headerOffset. Sample numbers start with 1.
Returns
none
See Also
carma::monitor::MonitorPointHeader
carma::monitor::SubsystemFrame

Definition at line 618 of file MonitorPointSample.h.

void carma::monitor::MonitorPointSample::clear ( bool  deallocate = false)

Clears all flags and (optionally) deallocates the sample so the sample is no longer associated with a monitor point.

which has values assigned from MonitorPointSample rhs.

Parameters
deallocatebool true if sample must be de-allocated.

Definition at line 605 of file MonitorPointSample.h.

void carma::monitor::MonitorPointSample::clearBlankingFlags ( )

Method to clear blanking flag value of the monitor sample.

The blanking/flagging value is set to MonitorPoint::UNDETERMINED.

Returns
none
See Also
carma::monitor::MonitorPoint::BLANKING_FLAGGING

Definition at line 583 of file MonitorPointSample.h.

void carma::monitor::MonitorPointSample::clearFlags ( )

Method to clear validity and blanking/flagging flag values of the monitor sample.

The blanking/flagging value is cleared using MonitorPointSample::clearBlankingFlags and the validity is cleared using MonitorPointSample::clearValidityFlags.

Returns
none
See Also
::carma::monitor::MonitorPoint::clearBlankingFlags
::carma::monitor::MonitorPoint::clearValidityFlags

Definition at line 597 of file MonitorPointSample.h.

void carma::monitor::MonitorPointSample::clearValidityFlags ( )

Method to clear validity flag value of the monitor sample.

The blanking/flagging value is set to MonitorPoint::INVALID_NO_DATA.

Returns
none
See Also
::carma::monitor::MonitorPoint::INVALID_NO_DATA

Definition at line 590 of file MonitorPointSample.h.

void carma::monitor::MonitorPointSample::fillInTransportSample ( CORBA::ULong  metaIdx,
MonitorSampleValues &  outSamples,
MonitorValueType  mvt,
tagIDType  tagId,
int  sampleIndex 
) const

This method and MonitorPointSample:;getTransportedSample are transport related methods.

These are methods provided to make transport of monitor data convenient. Loads monitor point sample data from this sample into a TransportMonitorSample so its ready to be transported out.

Parameters
outSampleTransportMonitorSample& sample to be transported out
mvtMonitorValueType type of the monitor sample
Returns
TransportMonitorSample& reference to TransportMonitorSample with sample data loaded into it.
See Also
carma::monitor::MonitorValueType
::carma::monitor::TransportMonitorSample
carma::monitor::uchar carma::monitor::MonitorPointSample::getBlankingFlags ( ) const

Method to return blanking flag value of the monitor sample.

The value is numerically equal to the value of one of the enum constants of the enum type MonitorPoint::BLANKING_FLAGGING.

Returns
uchar blanking/flagging value assigned to monitor point sample.
See Also
carma::monitor::MonitorPoint::BLANKING_FLAGGING

Definition at line 541 of file MonitorPointSample.h.

carma::monitor::MonitorValue & carma::monitor::MonitorPointSample::getMonitorValue ( ) const

Method to get monitor sample value as a union.

Returns
MonitorValue& union structure with value expressed as nine possible types.

Definition at line 527 of file MonitorPointSample.h.

carma::monitor::MonitorSampleValue & carma::monitor::MonitorPointSample::getSample ( ) const

Returns a reference to the internal MonitorSampleValue structure.

Returns
MonitorSampleValue& reference to internal structure
See Also
carma::monitor::MonitorSampleValue

Definition at line 562 of file MonitorPointSample.h.

unsigned short carma::monitor::MonitorPointSample::getSampleNumber ( ) const

Method to return sample number asscoiated with this MonitorPointSample.

Value is returned as an unsigned short, which restricts the number of samples to a maximum of 65536 per monitor point

Returns
ushort unsigned short representing the monitor point sample number.

Definition at line 548 of file MonitorPointSample.h.

void carma::monitor::MonitorPointSample::getTransportedSample ( CORBA::ULong  metaIdx,
const MonitorSampleValues &  inValues,
int  headerOffset 
)

This method and MonitorPointSample::fillInTransportSample are transport related methods.

These are methods provided to make transport of monitor data convenient. Retrieves sample data from a TransportMonitorSample structure and loads it into this MonitorPointSample.

Parameters
valueTypeconst MonitorValueType type of the monitor sample
inSampleconst TransportMonitorSample& transported sample data to be loaded into this sample.
headerOffsetconst int offset of MonitorPointHeader for the monitor point associated with this sample. Offset is measured as an index within the SubsystemFrame containing this sample.
iSampleconst ushort sample number of transported sample == monitor point sample number.
Returns
none
See Also
carma::monitor::SubsystemFrame
carma::monitor::MonitorPointHeader
carma::monitor::MonitorValueType
::carma::monitor::TransportMonitorSample
carma::monitor::uchar carma::monitor::MonitorPointSample::getValidityFlags ( ) const

Method to return validity flag value of the monitor sample.

The value is numerically equal to the value of one of the enum constants of the enum type MonitorPoint::VALIDITY.

Returns
uchar validity value assigned to monitor point sample.
See Also
carma::monitor::MonitorPoint::VALIDITY

Definition at line 534 of file MonitorPointSample.h.

carma::monitor::MonitorValue & carma::monitor::MonitorPointSample::getValue ( ) const
protected

Returns internal union structure containingv the value of the monitor point sample.

Discriminating the union requires the monitor points value type, which has to be obtained from the corresponing monitor point header.

Returns
MonitorValue& reference to internal union structure containing this sample's value.

Definition at line 569 of file MonitorPointSample.h.

carma::monitor::MonitorPointSample & carma::monitor::MonitorPointSample::operator= ( const MonitorPointSample rhs)

Assignment operator.

Returns a reference to this MonitorPointSample, which has values assigned from MonitorPointSample rhs.

Parameters
rhsMonitorPointSample& reference to MonitorPointSample to assign from.
Returns
MonitorPointSample& reference to this MonitorPointSample with its private variables assigned to the same values as the corresponding private variables in rhs.

Definition at line 514 of file MonitorPointSample.h.

void carma::monitor::MonitorPointSample::setBlankingFlags ( uchar  flags)

Method to set blanking flag value of the monitor sample.

The value should be numerically equal to the value of one of the enum constants of the enum type MonitorPoint::BLANKING_FLAGGING.

Parameters
flagsuchar blanking/flagging value assigned to monitor point sample.
See Also
carma::monitor::MonitorPoint::BLANKING_FLAGGING

Definition at line 576 of file MonitorPointSample.h.

void carma::monitor::MonitorPointSample::setMonitorValueAndKnownSaneValidityFlags ( char  value,
uchar  saneFlags 
)

Method to set monitor sample value as a char.

Parameters
valuevalue expressed as a char.
saneFlagsvalidity flags which are already known to be "sane".
void carma::monitor::MonitorPointSample::setMonitorValueAndKnownSaneValidityFlags ( short  value,
uchar  saneFlags 
)

Method to set monitor sample value as a short.

Parameters
valuevalue expressed as a short.
saneFlagsvalidity flags which are already known to be "sane".
void carma::monitor::MonitorPointSample::setMonitorValueAndKnownSaneValidityFlags ( long  value,
uchar  saneFlags 
)

Method to set monitor sample value as a long.

Parameters
valuevalue expressed as a long.
saneFlagsvalidity flags which are already known to be "sane".
void carma::monitor::MonitorPointSample::setMonitorValueAndKnownSaneValidityFlags ( bool  value,
uchar  saneFlags 
)

Method to set monitor sample value as a bool.

Parameters
valuevalue expressed as a bool.
saneFlagsvalidity flags which are already known to be "sane".
void carma::monitor::MonitorPointSample::setMonitorValueAndKnownSaneValidityFlags ( float  value,
uchar  saneFlags 
)

Method to set monitor sample value as a float.

Parameters
valuevalue expressed as a float.
saneFlagsvalidity flags which are already known to be "sane".
void carma::monitor::MonitorPointSample::setMonitorValueAndKnownSaneValidityFlags ( double  value,
uchar  saneFlags 
)

Method to set monitor sample value as a double.

Parameters
valuevalue expressed as a double.
saneFlagsvalidity flags which are already known to be "sane".
void carma::monitor::MonitorPointSample::setMonitorValueAndKnownSaneValidityFlags ( const float  value[2],
uchar  saneFlags 
)

Method to set monitor sample value as a complex.

Parameters
valuevalue expressed as a complex.
saneFlagsvalidity flags which are already known to be "sane".
void carma::monitor::MonitorPointSample::setSampleNumber ( ushort  iSample)

Method to set sample number associated with this MonitorPointSample.

Value is set as an unsigned short, which restricts the number of samples to a maximum of 65536 per monitor point

Parameters
iSampleunsigned short representing the monitor point sample number.

Definition at line 555 of file MonitorPointSample.h.

void carma::monitor::MonitorPointSample::setTransportValue ( MonitorValueType  valueType,
TransportMonitorValue &  value 
) const

Sets monitor point sample value to be transported using value from this sample.

Convenience method.

Parameters
valueTypeMonitorValueType type of monitor point sample value
valueTransportMonitorValue& transport structure into which this sample's value will be written.
Returns
none
See Also
carma::monitor::MonitorValueType
::carma::monitor::TransportMonitorValue
void carma::monitor::MonitorPointSample::setValidityFlags ( uchar  flags)

Method to set validity flag value of the monitor sample.

The value should be numerically equal to the value of one of the enum constants of the enum type MonitorPoint::VALIDITY. If within a subsystem, then it marks the corresponding monitor point as modified and ready for transport.

Parameters
flagsuchar validity value assigned to monitor point sample.
See Also
carma::monitor::MonitorPoint::VALIDITY
void carma::monitor::MonitorPointSample::setValueSerialNoAndKnownSaneValidityFlags ( long  value,
uchar  saneFlags 
)

Method to set monitor sample value as a serial number.

Parameters
valuevalue expressed as a serial number.
saneFlagsvalidity flags which are already known to be "sane".
void carma::monitor::MonitorPointSample::setValueStringChunkAndKnownSaneValidityFlags ( const MonitorValueStringChunk &  value,
uchar  saneFlags 
)

Method to set monitor sample value as a string chunk and already "sane" validity flags at the same.

Parameters
valuevalue expressed as a string chunk.
saneFlagsvalidity flags which are already known to be "sane".

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