LRAUV  revA
DataElement Class Referenceabstract

Abstact base class for one "element" of the Slate. More...

#include <DataElement.h>

Inheritance diagram for DataElement:
Collaboration diagram for DataElement:

Classes

class  UninitializedException
 

Public Member Functions

virtual ~DataElement ()
 Destructor. More...
 
DataReaderfindReader (const ElementURI &uri)
 Returns the DataReader associated with this DataElement and the specified ElementURI. More...
 
DataWriterfindWriter (const ElementURI &uri)
 Returns the DataWriter associated with this DataElement and the specified ElementURI. More...
 
const ElementURIgetUri (void) const
 Get the full ElementURI for the DataElement. More...
 
virtual const TimestampgetTimestamp () const
 Returns the timestamp of last write. More...
 
virtual bool isUnavailable (void) const
 Is the element "unavailable". More...
 
virtual bool isInvalid (void) const
 Is the element "invalid". More...
 
virtual bool isOwnersFailed (void) const
 
bool setUnavailable (bool unavailable, DataWriter *notifier)
 Set the element's unavailable flag. More...
 
bool setUnavailable (bool unavailable, Component *notifier)
 
bool setInvalid (bool invalid, DataWriter *notifier)
 Set the element's invalid flag. More...
 
bool setInvalid (bool invalid, Component *notifier)
 
virtual void setTimestamp (const Timestamp &timestamp=Timestamp::NOT_SET_TIME)
 Sets the timestamp of last write Used if a more acurate timestamp is available. More...
 
virtual bool isOrphaned (void) const
 Returns the value of the element's "orphand" flag. More...
 
virtual bool isOwnersActive (void) const
 
virtual bool isActivatable (void) const
 Indicates if the element is capable of being "active". More...
 
virtual bool isActive (void) const
 Indicates if the element is "active". More...
 
bool isBest (DataAccessor::RequestStrategy strategy=DataAccessor::MIN_ERROR) const
 Indicates if the element is the "best" of a set of measurements that feed into a universal. More...
 
const UnitgetUnit (void) const
 Returns the Unit associated with this data element or NULL if no Unit is associated. More...
 
virtual bool isUniversal () const
 
void registerUniversal (UniversalDataElement *abstract)
 Indicates this DataElement should participate in the selection process for the given Universal. More...
 
UniversalDataElementgetUniversal (void) const
 Returns the universal data element registered to this data element. More...
 
void registerReader (DataReader *reader)
 Add the given DataReader to the list of readers for this DataElement. More...
 
void unregisterReader (DataReader *reader)
 Remove the given DataReader from the list of reader for this DataElement. More...
 
unsigned int readerCount () const
 The number of readers currently registered to this DataElement. More...
 
bool hasReaders (void) const
 Does this DataElement have any readers? More...
 
bool isDataRequested ()
 Returns true if one of the registered readers is requesting data. More...
 
bool isImplemented ()
 Returns true if there is a non-failed "implementor" reader of this element. More...
 
void registerWriter (DataWriter *writer)
 Add the given writer to the list of registered writers for this DataElement. More...
 
void unregisterWriter (DataWriter *writer)
 Remove the given writer from the list of registered writers for this DataElement. More...
 
unsigned int writerCount () const
 Number of writers registered to this DataElement. More...
 
bool hasWriters (void) const
 Does this DataElement have any writers? More...
 
virtual void registerRead (DataReader &reader)
 
virtual void registerWrite (DataWriter &writer, bool changed)
 
void registerChangePending (DataWriter *writer)
 
void registerChangeDone (Component *notifier)
 
void registerChangeDone (void)
 
virtual float getAccuracy (const Unit &unit) const =0 throw ( UninitializedException )
 Access to get the current accuracy. More...
 
virtual float getWrittenAccuracy (const Unit &unit) const
 Returns the accuracy at the time of the last write;. More...
 
virtual bool setAccuracy (DataWriter &writer, const Unit &unit, const float accuracy)
 Set just the accuracy. More...
 
virtual float getBaseAccuracy () const =0
 Returns the accuracy in base, unscaled SI units. More...
 
virtual const UnitgetBaseUnit ()
 The base unit that all writers and readers must use when accessing this value. More...
 
virtual size_t getTypeSize ()
 The base size that all writers must specify. More...
 
virtual bool wasTouchedSinceLastRun (const Component *component)
 Returns true if the value was touched since the last run of the indicated component. More...
 
float getPower ()
 Power used by the component that owns this element. More...
 
float getError ()
 Error in measurements. More...
 
float getLatency ()
 Latency involved in requesting a measurement. More...
 
float getFrequency ()
 Frequency of measurements possible. More...
 
void setPower (float power)
 Power used by the component that owns this element. More...
 
void setLatency (float latency)
 Latency involved in requesting a measurement. More...
 
void setFrequency (float frequency)
 Frequency of measurements possible. More...
 
Get the DataValue

Basic get functions.

virtual bool get (DataReader &reader, const Unit &unit, bool &readTo) throw ( UninitializedException )
 
virtual bool get (DataReader &reader, const Unit &unit, unsigned char &readTo) throw ( UninitializedException )
 
virtual bool get (DataReader &reader, const Unit &unit, double &readTo) throw ( UninitializedException )
 
virtual bool get (DataReader &reader, const Unit &unit, float &readTo) throw ( UninitializedException )
 
virtual bool get (DataReader &reader, const Unit &unit, int &readTo) throw ( UninitializedException )
 
virtual bool get (DataReader &reader, DataValue &readTo) throw ( UninitializedException )
 
"In-line" gets.
virtual const double asDouble (DataReader &reader, const Unit &unit) throw ( UninitializedException )
 
virtual const int asInt (DataReader &reader, const Unit &unit) throw ( UninitializedException )
 
virtual const Str asString (DataReader &reader, const Unit &unit) throw ( UninitializedException )
 
Set a single value.

Basic set functions.

Parameters
writerWriter which is setting the DataElement
valueDataValue to copy.
Returns
true if set is successful.
virtual bool set (DataWriter &writer, const Unit &unit, const bool value, const Timestamp &timestamp=Timestamp::NOT_SET_TIME)
 Set functions set int value. More...
 
virtual bool set (DataWriter &writer, const Unit &unit, const unsigned char value, const Timestamp &timestamp=Timestamp::NOT_SET_TIME)
 Set functions set int value. More...
 
virtual bool set (DataWriter &writer, const Unit &unit, const double value, const Timestamp &timestamp=Timestamp::NOT_SET_TIME)
 Set functions set int value. More...
 
virtual bool set (DataWriter &writer, const Unit &unit, const float value, const Timestamp &timestamp=Timestamp::NOT_SET_TIME)
 Set functions set int value. More...
 
virtual bool set (DataWriter &writer, const Unit &unit, const int value, const Timestamp &timestamp=Timestamp::NOT_SET_TIME)
 Set functions set int value. More...
 
virtual bool set (DataWriter &writer, const DataValue &value, const Timestamp &timestamp=Timestamp::NOT_SET_TIME)
 Set functions set int value. More...
 
Set a value and accuracy.

Sets a value or array of values and the accuracy as a single action.

Parameters
writerWriter which is setting the value.
valueNew value(s) being set.
accuracyNew accuracy value to use.
Returns
true if set was successful
virtual bool setWithAccuracy (DataWriter &writer, const Unit &unit, const bool value, const float accuracy, const Timestamp &timestamp=Timestamp::NOT_SET_TIME)
 Set w/ Accuracy functions. More...
 
virtual bool setWithAccuracy (DataWriter &writer, const Unit &unit, const unsigned char value, const float accuracy, const Timestamp &timestamp=Timestamp::NOT_SET_TIME)
 Set w/ Accuracy functions. More...
 
virtual bool setWithAccuracy (DataWriter &writer, const Unit &unit, const double value, const float accuracy, const Timestamp &timestamp=Timestamp::NOT_SET_TIME)
 Set w/ Accuracy functions. More...
 
virtual bool setWithAccuracy (DataWriter &writer, const Unit &unit, const int value, const float accuracy, const Timestamp &timestamp=Timestamp::NOT_SET_TIME)
 Set w/ Accuracy functions. More...
 
virtual bool setWithAccuracy (DataWriter &writer, const DataValue &value, const float accuracy, const Timestamp &timestamp=Timestamp::NOT_SET_TIME)
 Set w/ Accuracy functions. More...
 

Static Public Attributes

static const float NO_ACCURACY = 3.25e30
 Defines an accuracy quantity which means "no accuracy specified" typically means "don't use" i.e. More...
 

Protected Member Functions

 DataElement (const ElementURI &name, const Unit *baseUnit, size_t typeSize)
 Protected constructor for base class. More...
 
bool setWrittenAccuracy ()
 Called before set commands to update the written accuracy Returns true if the written accuracy has changed. More...
 
virtual DataValuegetDataValue (void) const =0
 Provides access to the an Element's DataValue. More...
 
virtual void setDataValue (DataValue *dataValue)=0
 
virtual float setAccuracy (const Unit &unit, float accuracy)=0
 Protected access to set the Element's accuracy. More...
 
virtual void setBaseUnit (const Unit *baseUnit)
 
virtual void setTypeSize (const size_t typeSize)
 

Protected Attributes

ElementURI name_
 The DataElement ElementURI. More...
 
UniversalDataElementuniversal_
 Queue of UniversalElements which this DataElement "participates in". More...
 
DataWriternotifier_
 The data writer responsable for notifying this element's Universal data element that a change is pending. More...
 
FlexArray< DataWriter * > writers_
 List of all registered DataWriters. More...
 
FlexArray< DataReader * > readers_
 List of all registered DataReaders. More...
 
bool unavailable_
 The "unavailable" flag is actually a simple boolean which is set by the user or by the DataElement itself. More...
 
bool invalid_
 The "invalid" flag is actually a simple boolean which is set by the user or by the DataElement itself. More...
 
bool wasOrphaned_
 Indicates that the element was previously orphaned. More...
 
Mutex mutex_
 Mutex for thread-safing an instance of DataElement. More...
 
float writtenAccuracy_
 Accuracy of last written value. More...
 
Timestamp timestamp_
 Timestamp of last write. More...
 
bool hasBeenSet_
 Flag – false until the first call to set done. More...
 
const UnitbaseUnit_
 The base unit that all writers and readers must use when accessing this value. More...
 
size_t typeSize_
 The base size that all writers must specify. More...
 
float power_
 Power used by the component that owns this element. More...
 
float latency_
 Latency involved in requesting a measurement. More...
 
float frequency_
 Frequency of measurements possible. More...
 

Private Member Functions

 DataElement (const DataElement &old)
 

Friends

class CommandLine
 
class DataAccess
 
class DataEntry
 
class MissionStateLogger
 
class Slate
 
class UniversalDataElement
 

Detailed Description

Abstact base class for one "element" of the Slate.

A DataElement is a base class for atomic units of data that can be written to and read from the slate.

Constructor & Destructor Documentation

DataElement::~DataElement ( )
virtual

Destructor.

DataElement::DataElement ( const ElementURI name,
const Unit baseUnit,
size_t  typeSize 
)
protected

Protected constructor for base class.

Protected Constructor.

References Slate::CodifyElementURI(), and name_.

DataElement::DataElement ( const DataElement old)
private

Member Function Documentation

const double DataElement::asDouble ( DataReader reader,
const Unit unit 
)
throw (UninitializedException
)
virtual

Referenced by DataReader::asDouble().

const int DataElement::asInt ( DataReader reader,
const Unit unit 
)
throw (UninitializedException
)
virtual

Referenced by DataReader::asInt().

const Str DataElement::asString ( DataReader reader,
const Unit unit 
)
throw (UninitializedException
)
virtual

References DataValue::toString().

Referenced by DataReader::asString().

DataReader * DataElement::findReader ( const ElementURI uri)

Returns the DataReader associated with this DataElement and the specified ElementURI.

References FlexArrayBase::getMaxIndex(), FlexArrayBase::getMinIndex(), getUri(), mutex_, and readers_.

DataWriter * DataElement::findWriter ( const ElementURI uri)

Returns the DataWriter associated with this DataElement and the specified ElementURI.

References FlexArrayBase::getMaxIndex(), FlexArrayBase::getMinIndex(), getUri(), mutex_, and writers_.

Referenced by Slate::NewDataElement(), and Slate::WriteOnce().

bool DataElement::get ( DataReader reader,
const Unit unit,
bool &  readTo 
)
throw (UninitializedException
)
virtual

Referenced by DataReader::read().

bool DataElement::get ( DataReader reader,
const Unit unit,
unsigned char &  readTo 
)
throw (UninitializedException
)
virtual
bool DataElement::get ( DataReader reader,
const Unit unit,
double &  readTo 
)
throw (UninitializedException
)
virtual
bool DataElement::get ( DataReader reader,
const Unit unit,
float &  readTo 
)
throw (UninitializedException
)
virtual
bool DataElement::get ( DataReader reader,
const Unit unit,
int &  readTo 
)
throw (UninitializedException
)
virtual
bool DataElement::get ( DataReader reader,
DataValue readTo 
)
throw (UninitializedException
)
virtual
virtual float DataElement::getAccuracy ( const Unit unit) const
throw (UninitializedException
)
pure virtual

Access to get the current accuracy.

Exact implementation will depend on the type of data element.

Returns
current accuracy

Implemented in UniversalDataElement, and SimpleDataElement.

Referenced by UniversalDataReader::getAccuracy(), UniversalDataWriter::getAccuracy(), and setAccuracy().

virtual float DataElement::getBaseAccuracy ( ) const
pure virtual

Returns the accuracy in base, unscaled SI units.

Implemented in UniversalDataElement, and SimpleDataElement.

Referenced by getError(), UniversalDataElement::recalculate(), setAccuracy(), and setWrittenAccuracy().

virtual const Unit* DataElement::getBaseUnit ( )
inlinevirtual

The base unit that all writers and readers must use when accessing this value.

References baseUnit_.

Referenced by PeakDetectHorizontal::initialize(), PeakDetectVsDepth::initialize(), Slate::NewUniversalElement(), Config::ParseLine(), and ValueDetect::runIfUnsatisfied().

virtual DataValue* DataElement::getDataValue ( void  ) const
protectedpure virtual
float DataElement::getError ( )
inline

Error in measurements.

References getBaseAccuracy().

Referenced by UniversalDataElement::recalculate().

float DataElement::getFrequency ( )
inline

Frequency of measurements possible.

References frequency_.

Referenced by UniversalDataElement::recalculate().

float DataElement::getLatency ( )
inline

Latency involved in requesting a measurement.

References latency_.

Referenced by UniversalDataElement::recalculate().

float DataElement::getPower ( )
inline

Power used by the component that owns this element.

References power_.

Referenced by UniversalDataElement::recalculate().

virtual const Timestamp& DataElement::getTimestamp ( ) const
inlinevirtual
virtual size_t DataElement::getTypeSize ( )
inlinevirtual

The base size that all writers must specify.

References typeSize_.

Referenced by Slate::NewUniversalElement().

const Unit * DataElement::getUnit ( void  ) const

Returns the Unit associated with this data element or NULL if no Unit is associated.

References getDataValue(), and DataValue::getUnit().

Referenced by CommandLine::commandShowVariable(), and Config::ParseLine().

UniversalDataElement* DataElement::getUniversal ( void  ) const
inline

Returns the universal data element registered to this data element.

References universal_.

Referenced by UniversalDataWriter::isAnyDataRequested(), and Component::setRunState().

const ElementURI & DataElement::getUri ( void  ) const
virtual float DataElement::getWrittenAccuracy ( const Unit unit) const
inlinevirtual

Returns the accuracy at the time of the last write;.

Returns
accuracy at the time of the last write.

Reimplemented in UniversalDataElement.

References Unit::getScaled(), and writtenAccuracy_.

Referenced by UniversalDataReader::getWrittenAccuracy(), and UniversalDataElement::getWrittenAccuracy().

bool DataElement::hasReaders ( void  ) const
inline

Does this DataElement have any readers?

Returns
true if this DataElement has any registered readers.

References readerCount().

bool DataElement::hasWriters ( void  ) const
inline

Does this DataElement have any writers?

Returns
true if this DataElement has any registered writers.

References writerCount().

bool DataElement::isActivatable ( void  ) const
virtual

Indicates if the element is capable of being "active".

At present, this is defined as the absence of any of the fault flags: orphaned, unavailable

Returns
true if the element is neither orphaned nor unavailable.

References isOrphaned(), and isUnavailable().

Referenced by isActive(), and UniversalDataElement::recalculate().

bool DataElement::isActive ( void  ) const
virtual

Indicates if the element is "active".

At present, this means the element is activatable and its owner is active

Returns
true if the element is neither orphaned nor unavailable.

Reimplemented in ConfigDataElement.

References hasBeenSet_, isActivatable(), and isOwnersActive().

Referenced by DataReader::asDouble(), DataReader::asInt(), DataReader::asString(), UniversalDataReader::getAccuracy(), DataReader::isActive(), DataReader::read(), and UniversalDataElement::recalculate().

bool DataElement::isBest ( DataAccessor::RequestStrategy  strategy = DataAccessor::MIN_ERROR) const

Indicates if the element is the "best" of a set of measurements that feed into a universal.

If this does not feed a universal returns false.

Returns
true if the element is the "best" of a set of measurements that feed into a universal.

References UniversalDataElement::getBestElement(), and universal_.

Referenced by Logger::logData(), and SendDataComponent::run().

bool DataElement::isDataRequested ( )

Returns true if one of the registered readers is requesting data.

References UniversalDataElement::isDataRequested(), DataReader::isRequestingData(), readers_, FlexArrayBase::size(), and universal_.

Referenced by DataWriter::isDataRequested().

bool DataElement::isImplemented ( )

Returns true if there is a non-failed "implementor" reader of this element.

References DataAccessor::getOwner(), Component::isFailed(), isImplemented(), DataReader::isImplementor(), isUnavailable(), readers_, FlexArrayBase::size(), and universal_.

Referenced by DataWriter::isImplemented(), and isImplemented().

bool DataElement::isInvalid ( void  ) const
virtual
bool DataElement::isOrphaned ( void  ) const
virtual

Returns the value of the element's "orphand" flag.

Returns
true if the element is considered orphaned

Reimplemented in UniversalDataElement, and ConfigDataElement.

References writerCount().

Referenced by CommandLine::commandShowVariable(), isActivatable(), DataReader::isOrphaned(), Slate::ReadOnce(), and unregisterWriter().

bool DataElement::isOwnersActive ( void  ) const
virtual
bool DataElement::isOwnersFailed ( void  ) const
virtual
bool DataElement::isUnavailable ( void  ) const
virtual

Is the element "unavailable".

Returns
true if the element is marked as unavailable.

References isOwnersFailed(), and unavailable_.

Referenced by CommandLine::commandFailVariable(), isActivatable(), isImplemented(), isInvalid(), DataWriter::isUnavailable(), and DataReader::isUnavailable().

virtual bool DataElement::isUniversal ( ) const
inlinevirtual
unsigned int DataElement::readerCount ( void  ) const

The number of readers currently registered to this DataElement.

Returns
The number of readers currently registered to this DataElement

References readers_, and FlexArrayBase::size().

Referenced by hasReaders().

void DataElement::registerChangeDone ( Component notifier)
void DataElement::registerChangeDone ( void  )
void DataElement::registerChangePending ( DataWriter writer)
void DataElement::registerRead ( DataReader reader)
virtual
void DataElement::registerReader ( DataReader reader)

Add the given DataReader to the list of readers for this DataElement.

Parameters
readerDataReader to be added.

References mutex_, FlexArray< T >::push(), and readers_.

Referenced by DataReader::DataReader().

void DataElement::registerUniversal ( UniversalDataElement abstract)

Indicates this DataElement should participate in the selection process for the given Universal.

It's up to the user to ensure this makes sense.

Parameters
abstractThe UniversalDataElement which this DataElement should forward any changes.

References mutex_, and universal_.

Referenced by Slate::NewUniversalWriter(), and Component::newUniversalWriter().

void DataElement::registerWrite ( DataWriter writer,
bool  changed 
)
virtual
void DataElement::registerWriter ( DataWriter writer)

Add the given writer to the list of registered writers for this DataElement.

Parameters
writerWriter to register to this DataElement

References EventEntry::DATA_STATE_CHANGE_UNORPHANED, Component::getLogger(), DataAccessor::getOwner(), Logger::log(), mutex_, FlexArray< T >::push(), registerChangeDone(), registerChangePending(), wasOrphaned_, and writers_.

Referenced by DataWriter::DataWriter().

bool DataElement::set ( DataWriter writer,
const Unit unit,
const bool  value,
const Timestamp timestamp = Timestamp::NOT_SET_TIME 
)
virtual
bool DataElement::set ( DataWriter writer,
const Unit unit,
const unsigned char  value,
const Timestamp timestamp = Timestamp::NOT_SET_TIME 
)
virtual
bool DataElement::set ( DataWriter writer,
const Unit unit,
const double  value,
const Timestamp timestamp = Timestamp::NOT_SET_TIME 
)
virtual
bool DataElement::set ( DataWriter writer,
const Unit unit,
const float  value,
const Timestamp timestamp = Timestamp::NOT_SET_TIME 
)
virtual
bool DataElement::set ( DataWriter writer,
const Unit unit,
const int  value,
const Timestamp timestamp = Timestamp::NOT_SET_TIME 
)
virtual
bool DataElement::set ( DataWriter writer,
const DataValue value,
const Timestamp timestamp = Timestamp::NOT_SET_TIME 
)
virtual
bool DataElement::setAccuracy ( DataWriter writer,
const Unit unit,
const float  accuracy 
)
virtual

Set just the accuracy.

Set Accuracy functions set double value.

Parameters
writerThe DataWriter which is setting the accuracy
unitThe Unit in which the new accuracy value is expressed
accuracyThe new accuracy to use

References getAccuracy(), getBaseAccuracy(), Component::getLogger(), DataAccessor::getOwner(), Unit::getSI(), Logger::logSetAccuracy(), mutex_, registerChangeDone(), and registerChangePending().

Referenced by UniversalDataWriter::setAccuracy(), and setWithAccuracy().

virtual float DataElement::setAccuracy ( const Unit unit,
float  accuracy 
)
protectedpure virtual

Protected access to set the Element's accuracy.

Implementation dependent on the type of data element.

Parameters
unitThe unit of the accuracy value
accuracyNew accuracy to use
Returns
The new accuracy

Implemented in UniversalDataElement, and SimpleDataElement.

virtual void DataElement::setBaseUnit ( const Unit baseUnit)
inlineprotectedvirtual
virtual void DataElement::setDataValue ( DataValue dataValue)
protectedpure virtual

Implemented in UniversalDataElement, and SimpleDataElement.

Referenced by Slate::NewInputReader(), and set().

void DataElement::setFrequency ( float  frequency)
inline

Frequency of measurements possible.

References frequency_.

Referenced by Slate::ConfigureNewDataElement().

bool DataElement::setInvalid ( bool  invalid,
DataWriter notifier 
)

Set the element's invalid flag.

Parameters
invalidnew value of invalid flag
notifier– the writer that has alerted us to the condition
Returns
New value of invalid flag

References EventEntry::DATA_STATE_CHANGE_INVALID, EventEntry::DATA_STATE_CHANGE_VALID, Component::getLogger(), DataAccessor::getOwner(), invalid_, Logger::log(), registerChangeDone(), and registerChangePending().

Referenced by CommandLine::commandFailVariable(), and DataWriter::setInvalid().

void DataElement::setLatency ( float  latency)
inline

Latency involved in requesting a measurement.

References latency_.

Referenced by Slate::ConfigureNewDataElement().

void DataElement::setPower ( float  power)
inline

Power used by the component that owns this element.

References power_.

Referenced by Slate::ConfigureNewDataElement().

void DataElement::setTimestamp ( const Timestamp timestamp = Timestamp::NOT_SET_TIME)
virtual

Sets the timestamp of last write Used if a more acurate timestamp is available.

Reimplemented in ConfigDataElement.

References Timestamp::NOT_SET_TIME, Timestamp::Now(), setTimestamp(), timestamp_, and universal_.

Referenced by Assign::run(), set(), ConfigDataElement::setTimestamp(), and setTimestamp().

virtual void DataElement::setTypeSize ( const size_t  typeSize)
inlineprotectedvirtual
bool DataElement::setUnavailable ( bool  unavailable,
DataWriter notifier 
)

Set the element's unavailable flag.

Parameters
unavailablenew value of unavailable flag
notifier– the writer that has alerted us to the condition
Returns
New value of unavailable flag

References EventEntry::DATA_STATE_CHANGE_AVAILABLE, EventEntry::DATA_STATE_CHANGE_UNAVAILABLE, Component::getLogger(), DataAccessor::getOwner(), Logger::log(), registerChangeDone(), registerChangePending(), and unavailable_.

Referenced by CommandLine::commandFailVariable(), and DataWriter::setUnavailable().

bool DataElement::setWithAccuracy ( DataWriter writer,
const Unit unit,
const bool  value,
const float  accuracy,
const Timestamp timestamp = Timestamp::NOT_SET_TIME 
)
virtual

Set w/ Accuracy functions.

References set(), and setAccuracy().

Referenced by UniversalDataWriter::writeWithAccuracy().

bool DataElement::setWithAccuracy ( DataWriter writer,
const Unit unit,
const unsigned char  value,
const float  accuracy,
const Timestamp timestamp = Timestamp::NOT_SET_TIME 
)
virtual

Set w/ Accuracy functions.

References set(), and setAccuracy().

bool DataElement::setWithAccuracy ( DataWriter writer,
const Unit unit,
const double  value,
const float  accuracy,
const Timestamp timestamp = Timestamp::NOT_SET_TIME 
)
virtual

Set w/ Accuracy functions.

References set(), and setAccuracy().

bool DataElement::setWithAccuracy ( DataWriter writer,
const Unit unit,
const int  value,
const float  accuracy,
const Timestamp timestamp = Timestamp::NOT_SET_TIME 
)
virtual

Set w/ Accuracy functions.

References set(), and setAccuracy().

bool DataElement::setWithAccuracy ( DataWriter writer,
const DataValue value,
const float  accuracy,
const Timestamp timestamp = Timestamp::NOT_SET_TIME 
)
virtual

Set w/ Accuracy functions.

References DataValue::getBaseUnit(), set(), and setAccuracy().

bool DataElement::setWrittenAccuracy ( )
protected

Called before set commands to update the written accuracy Returns true if the written accuracy has changed.

Called before set commands to update the written accuracy.

References getBaseAccuracy(), NO_ACCURACY, and writtenAccuracy_.

Referenced by set().

void DataElement::unregisterReader ( DataReader reader)

Remove the given DataReader from the list of reader for this DataElement.

Parameters
readerDataReader to be removed.

References FlexArrayBase::getMaxIndex(), FlexArrayBase::getMinIndex(), mutex_, FlexArray< T >::pop(), and readers_.

Referenced by DataReader::~DataReader().

void DataElement::unregisterWriter ( DataWriter writer)
bool DataElement::wasTouchedSinceLastRun ( const Component component)
virtual

Returns true if the value was touched since the last run of the indicated component.

Reimplemented in UniversalDataElement.

References Component::getTimeOfLastRun(), Timestamp::NOT_SET_TIME, and timestamp_.

Referenced by DataReader::wasTouchedSinceLastRun(), and UniversalDataElement::wasTouchedSinceLastRun().

unsigned int DataElement::writerCount ( void  ) const

Number of writers registered to this DataElement.

Returns
Number of writers registered to this DataElement

References FlexArrayBase::size(), and writers_.

Referenced by hasWriters(), and isOrphaned().

Friends And Related Function Documentation

friend class CommandLine
friend
friend class DataAccess
friend
friend class DataEntry
friend
friend class MissionStateLogger
friend
friend class Slate
friend
friend class UniversalDataElement
friend

Member Data Documentation

const Unit* DataElement::baseUnit_
protected

The base unit that all writers and readers must use when accessing this value.

Referenced by getBaseUnit().

float DataElement::frequency_
protected

Frequency of measurements possible.

Referenced by getFrequency(), and setFrequency().

bool DataElement::hasBeenSet_
protected

Flag – false until the first call to set done.

Referenced by isActive(), UniversalDataElement::recalculate(), and set().

bool DataElement::invalid_
protected

The "invalid" flag is actually a simple boolean which is set by the user or by the DataElement itself.

Referenced by isInvalid(), UniversalDataElement::recalculate(), and setInvalid().

float DataElement::latency_
protected

Latency involved in requesting a measurement.

Referenced by getLatency(), and setLatency().

ElementURI DataElement::name_
protected

The DataElement ElementURI.

Referenced by DataElement(), and getUri().

const float DataElement::NO_ACCURACY = 3.25e30
static

Defines an accuracy quantity which means "no accuracy specified" typically means "don't use" i.e.

GPS without lock.

Referenced by UniversalDataReader::getAccuracy(), UniversalDataElement::getWrittenAccuracy(), Component::newUniversalBlobWriter(), Component::newUniversalWriter(), WetLabsBB2FL::readConfig(), UniversalDataElement::recalculate(), and setWrittenAccuracy().

DataWriter* DataElement::notifier_
protected

The data writer responsable for notifying this element's Universal data element that a change is pending.

Referenced by registerChangeDone(), and registerChangePending().

float DataElement::power_
protected

Power used by the component that owns this element.

Referenced by getPower(), and setPower().

Timestamp DataElement::timestamp_
protected

Timestamp of last write.

Referenced by getTimestamp(), setTimestamp(), and wasTouchedSinceLastRun().

size_t DataElement::typeSize_
protected

The base size that all writers must specify.

Referenced by getTypeSize().

bool DataElement::unavailable_
protected

The "unavailable" flag is actually a simple boolean which is set by the user or by the DataElement itself.

Referenced by isOwnersFailed(), isUnavailable(), and setUnavailable().

UniversalDataElement* DataElement::universal_
protected

Queue of UniversalElements which this DataElement "participates in".

Referenced by getUniversal(), isBest(), isDataRequested(), isImplemented(), registerChangeDone(), registerUniversal(), and setTimestamp().

bool DataElement::wasOrphaned_
protected

Indicates that the element was previously orphaned.

Referenced by registerWriter(), and unregisterWriter().

FlexArray<DataWriter*> DataElement::writers_
protected

List of all registered DataWriters.

Referenced by findWriter(), isOwnersActive(), isOwnersFailed(), registerWriter(), unregisterWriter(), and writerCount().

float DataElement::writtenAccuracy_
protected

Accuracy of last written value.

Referenced by getWrittenAccuracy(), and setWrittenAccuracy().


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