|
LRAUV
revA
|
Abstact base class for one "element" of the Slate. More...
#include <DataElement.h>


Classes | |
| class | UninitializedException |
Public Member Functions | |||||||
| virtual | ~DataElement () | ||||||
| Destructor. More... | |||||||
| DataReader * | findReader (const ElementURI &uri) | ||||||
| Returns the DataReader associated with this DataElement and the specified ElementURI. More... | |||||||
| DataWriter * | findWriter (const ElementURI &uri) | ||||||
| Returns the DataWriter associated with this DataElement and the specified ElementURI. More... | |||||||
| const ElementURI & | getUri (void) const | ||||||
| Get the full ElementURI for the DataElement. More... | |||||||
| virtual const Timestamp & | getTimestamp () 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 ×tamp=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 Unit * | getUnit (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... | |||||||
| UniversalDataElement * | getUniversal (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 Unit * | getBaseUnit () | ||||||
| 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.
| |||||||
| virtual bool | set (DataWriter &writer, const Unit &unit, const bool value, const Timestamp ×tamp=Timestamp::NOT_SET_TIME) | ||||||
| Set functions set int value. More... | |||||||
| virtual bool | set (DataWriter &writer, const Unit &unit, const unsigned char value, const Timestamp ×tamp=Timestamp::NOT_SET_TIME) | ||||||
| Set functions set int value. More... | |||||||
| virtual bool | set (DataWriter &writer, const Unit &unit, const double value, const Timestamp ×tamp=Timestamp::NOT_SET_TIME) | ||||||
| Set functions set int value. More... | |||||||
| virtual bool | set (DataWriter &writer, const Unit &unit, const float value, const Timestamp ×tamp=Timestamp::NOT_SET_TIME) | ||||||
| Set functions set int value. More... | |||||||
| virtual bool | set (DataWriter &writer, const Unit &unit, const int value, const Timestamp ×tamp=Timestamp::NOT_SET_TIME) | ||||||
| Set functions set int value. More... | |||||||
| virtual bool | set (DataWriter &writer, const DataValue &value, const Timestamp ×tamp=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.
| |||||||
| virtual bool | setWithAccuracy (DataWriter &writer, const Unit &unit, const bool value, const float accuracy, const Timestamp ×tamp=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 ×tamp=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 ×tamp=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 ×tamp=Timestamp::NOT_SET_TIME) | ||||||
| Set w/ Accuracy functions. More... | |||||||
| virtual bool | setWithAccuracy (DataWriter &writer, const DataValue &value, const float accuracy, const Timestamp ×tamp=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 DataValue * | getDataValue (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... | |
| UniversalDataElement * | universal_ |
| Queue of UniversalElements which this DataElement "participates in". More... | |
| DataWriter * | notifier_ |
| 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 Unit * | baseUnit_ |
| 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 |
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.
|
virtual |
Destructor.
|
protected |
Protected constructor for base class.
Protected Constructor.
References Slate::CodifyElementURI(), and name_.
|
private |
|
virtual | ||||||||||||||||||||
Referenced by DataReader::asDouble().
|
virtual | ||||||||||||||||||||
Referenced by DataReader::asInt().
|
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().
|
virtual | ||||||||||||||||||||||||
Referenced by DataReader::read().
|
virtual | ||||||||||||||||||||||||
|
virtual | ||||||||||||||||||||||||
|
virtual | ||||||||||||||||||||||||
|
virtual | ||||||||||||||||||||||||
|
virtual | ||||||||||||||||||||
|
pure virtual | ||||||||||||||
Access to get the current accuracy.
Exact implementation will depend on the type of data element.
Implemented in UniversalDataElement, and SimpleDataElement.
Referenced by UniversalDataReader::getAccuracy(), UniversalDataWriter::getAccuracy(), and setAccuracy().
|
pure virtual |
Returns the accuracy in base, unscaled SI units.
Implemented in UniversalDataElement, and SimpleDataElement.
Referenced by getError(), UniversalDataElement::recalculate(), setAccuracy(), and setWrittenAccuracy().
|
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().
|
protectedpure virtual |
Provides access to the an Element's DataValue.
Implementation depends on the type of DataElement.
Implemented in UniversalDataElement, and SimpleDataElement.
Referenced by DataAccess::DataAccess(), DataEntry::DataEntry(), UniversalDataElement::getDataValue(), getUnit(), Slate::NewDataElement(), Slate::NewInputReader(), MissionStateLogger::NewResume(), DataEntry::Read(), Slate::ReadOnce(), and set().
|
inline |
Error in measurements.
References getBaseAccuracy().
Referenced by UniversalDataElement::recalculate().
|
inline |
Frequency of measurements possible.
References frequency_.
Referenced by UniversalDataElement::recalculate().
|
inline |
Latency involved in requesting a measurement.
References latency_.
Referenced by UniversalDataElement::recalculate().
|
inline |
Power used by the component that owns this element.
References power_.
Referenced by UniversalDataElement::recalculate().
|
inlinevirtual |
Returns the timestamp of last write.
Reimplemented in UniversalDataElement.
References timestamp_.
Referenced by ConfigDataElement::applyConfigValue(), DataWriter::getTimestamp(), DataReader::getTimestamp(), and UniversalDataElement::getTimestamp().
|
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().
|
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 |
Get the full ElementURI for the DataElement.
Property getter and ter Methods.
References name_.
Referenced by CommandLine::commandFailVariable(), CommandLine::commandShowBest(), DataAccess::DataAccess(), findReader(), findWriter(), DataAccessor::getUri(), ParsedCommand::matchConfigVariable(), Config::ParseLine(), DataEntry::Read(), and ArgDataElement::registerWrite().
|
inlinevirtual |
Returns the accuracy at the time of the last write;.
Reimplemented in UniversalDataElement.
References Unit::getScaled(), and writtenAccuracy_.
Referenced by UniversalDataReader::getWrittenAccuracy(), and UniversalDataElement::getWrittenAccuracy().
|
inline |
Does this DataElement have any readers?
References readerCount().
|
inline |
Does this DataElement have any writers?
References writerCount().
|
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
References isOrphaned(), and isUnavailable().
Referenced by isActive(), and UniversalDataElement::recalculate().
|
virtual |
Indicates if the element is "active".
At present, this means the element is activatable and its owner is active
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.
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().
|
virtual |
Is the element "invalid".
References invalid_, and isUnavailable().
Referenced by CommandLine::commandFailVariable(), UniversalDataElement::getDataValue(), UniversalDataElement::getWrittenAccuracy(), DataWriter::isInvalid(), DataReader::isInvalid(), and UniversalDataElement::recalculate().
|
virtual |
Returns the value of the element's "orphand" flag.
Reimplemented in UniversalDataElement, and ConfigDataElement.
References writerCount().
Referenced by CommandLine::commandShowVariable(), isActivatable(), DataReader::isOrphaned(), Slate::ReadOnce(), and unregisterWriter().
|
virtual |
References FlexArray< T >::get(), DataAccessor::getOwner(), Component::isActive(), isUniversal(), FlexArrayBase::size(), and writers_.
Referenced by isActive().
|
virtual |
References FlexArray< T >::get(), DataAccessor::getOwner(), Component::isFailed(), isUniversal(), FlexArrayBase::size(), unavailable_, and writers_.
Referenced by isUnavailable().
|
virtual |
Is the element "unavailable".
References isOwnersFailed(), and unavailable_.
Referenced by CommandLine::commandFailVariable(), isActivatable(), isImplemented(), isInvalid(), DataWriter::isUnavailable(), and DataReader::isUnavailable().
|
inlinevirtual |
Reimplemented in UniversalDataElement.
Referenced by CommandLine::commandShowBest(), DataAccess::DataAccess(), isOwnersActive(), isOwnersFailed(), and Slate::NewDataElement().
| unsigned int DataElement::readerCount | ( | void | ) | const |
The number of readers currently registered to this DataElement.
References readers_, and FlexArrayBase::size().
Referenced by hasReaders().
| void DataElement::registerChangeDone | ( | Component * | notifier | ) |
References UniversalDataElement::notifyChangeDone(), and universal_.
Referenced by DataWriter::registerChange().
| void DataElement::registerChangeDone | ( | void | ) |
References notifier_, UniversalDataElement::notifyChangeDone(), and universal_.
Referenced by registerWriter(), set(), setAccuracy(), setInvalid(), setUnavailable(), and unregisterWriter().
| void DataElement::registerChangePending | ( | DataWriter * | writer | ) |
References notifier_.
Referenced by DataWriter::registerChange(), registerWriter(), set(), setAccuracy(), setInvalid(), setUnavailable(), and unregisterWriter().
|
virtual |
| void DataElement::registerReader | ( | DataReader * | reader | ) |
Add the given DataReader to the list of readers for this DataElement.
| reader | DataReader 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.
| abstract | The UniversalDataElement which this DataElement should forward any changes. |
References mutex_, and universal_.
Referenced by Slate::NewUniversalWriter(), and Component::newUniversalWriter().
|
virtual |
Reimplemented in ArgDataElement.
References Component::getLogger(), DataAccessor::getOwner(), and Logger::logData().
Referenced by ArgDataElement::registerWrite(), and set().
| void DataElement::registerWriter | ( | DataWriter * | writer | ) |
Add the given writer to the list of registered writers for this DataElement.
| writer | Writer 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().
|
virtual |
Set functions set int value.
References getDataValue(), hasBeenSet_, mutex_, registerChangeDone(), registerChangePending(), registerWrite(), setDataValue(), DataValue::setFrom(), setTimestamp(), and setWrittenAccuracy().
Referenced by setWithAccuracy(), and DataWriter::write().
|
virtual |
Set functions set int value.
References getDataValue(), hasBeenSet_, mutex_, registerChangeDone(), registerChangePending(), registerWrite(), setDataValue(), DataValue::setFrom(), setTimestamp(), and setWrittenAccuracy().
|
virtual |
Set functions set int value.
References getDataValue(), hasBeenSet_, mutex_, registerChangeDone(), registerChangePending(), registerWrite(), setDataValue(), DataValue::setFrom(), setTimestamp(), and setWrittenAccuracy().
|
virtual |
Set functions set int value.
References getDataValue(), hasBeenSet_, mutex_, registerChangeDone(), registerChangePending(), registerWrite(), setDataValue(), DataValue::setFrom(), setTimestamp(), and setWrittenAccuracy().
|
virtual |
Set functions set int value.
References getDataValue(), hasBeenSet_, mutex_, registerChangeDone(), registerChangePending(), registerWrite(), setDataValue(), DataValue::setFrom(), setTimestamp(), and setWrittenAccuracy().
|
virtual |
Set functions set int value.
References DataValue::copy(), getDataValue(), hasBeenSet_, mutex_, registerChangeDone(), registerChangePending(), registerWrite(), setDataValue(), DataValue::setFrom(), setTimestamp(), and setWrittenAccuracy().
|
virtual |
Set just the accuracy.
Set Accuracy functions set double value.
| writer | The DataWriter which is setting the accuracy |
| unit | The Unit in which the new accuracy value is expressed |
| accuracy | The 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().
|
protectedpure virtual |
Protected access to set the Element's accuracy.
Implementation dependent on the type of data element.
| unit | The unit of the accuracy value |
| accuracy | New accuracy to use |
Implemented in UniversalDataElement, and SimpleDataElement.
|
inlineprotectedvirtual |
Referenced by Slate::NewUniversalElement().
|
protectedpure virtual |
Implemented in UniversalDataElement, and SimpleDataElement.
Referenced by Slate::NewInputReader(), and set().
|
inline |
Frequency of measurements possible.
References frequency_.
Referenced by Slate::ConfigureNewDataElement().
| bool DataElement::setInvalid | ( | bool | invalid, |
| DataWriter * | notifier | ||
| ) |
Set the element's invalid flag.
| invalid | new value of invalid flag |
| notifier | – the writer that has alerted us to the condition |
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().
| bool DataElement::setInvalid | ( | bool | invalid, |
| Component * | notifier | ||
| ) |
|
inline |
Latency involved in requesting a measurement.
References latency_.
Referenced by Slate::ConfigureNewDataElement().
|
inline |
Power used by the component that owns this element.
References power_.
Referenced by Slate::ConfigureNewDataElement().
|
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().
|
inlineprotectedvirtual |
Referenced by Slate::NewUniversalElement().
| bool DataElement::setUnavailable | ( | bool | unavailable, |
| DataWriter * | notifier | ||
| ) |
Set the element's unavailable flag.
| unavailable | new value of unavailable flag |
| notifier | – the writer that has alerted us to the condition |
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::setUnavailable | ( | bool | unavailable, |
| Component * | notifier | ||
| ) |
|
virtual |
Set w/ Accuracy functions.
References set(), and setAccuracy().
Referenced by UniversalDataWriter::writeWithAccuracy().
|
virtual |
Set w/ Accuracy functions.
References set(), and setAccuracy().
|
virtual |
Set w/ Accuracy functions.
References set(), and setAccuracy().
|
virtual |
Set w/ Accuracy functions.
References set(), and setAccuracy().
|
virtual |
Set w/ Accuracy functions.
References DataValue::getBaseUnit(), set(), and setAccuracy().
|
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.
| reader | DataReader to be removed. |
References FlexArrayBase::getMaxIndex(), FlexArrayBase::getMinIndex(), mutex_, FlexArray< T >::pop(), and readers_.
Referenced by DataReader::~DataReader().
| void DataElement::unregisterWriter | ( | DataWriter * | writer | ) |
Remove the given writer from the list of registered writers for this DataElement.
| writer | Writer to remove (disassociate) from this DataElement. |
References EventEntry::DATA_STATE_CHANGE_ORPHANED, Component::getLogger(), FlexArrayBase::getMaxIndex(), FlexArrayBase::getMinIndex(), DataAccessor::getOwner(), isOrphaned(), Logger::log(), mutex_, FlexArray< T >::pop(), registerChangeDone(), registerChangePending(), wasOrphaned_, and writers_.
Referenced by DataWriter::~DataWriter().
|
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.
References FlexArrayBase::size(), and writers_.
Referenced by hasWriters(), and isOrphaned().
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
protected |
The base unit that all writers and readers must use when accessing this value.
Referenced by getBaseUnit().
|
protected |
Frequency of measurements possible.
Referenced by getFrequency(), and setFrequency().
|
protected |
Flag – false until the first call to set done.
Referenced by isActive(), UniversalDataElement::recalculate(), and set().
|
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().
|
protected |
Latency involved in requesting a measurement.
Referenced by getLatency(), and setLatency().
|
protected |
Mutex for thread-safing an instance of DataElement.
Referenced by UniversalDataElement::addElement(), ConfigDataElement::applyConfigValue(), findReader(), findWriter(), UniversalDataElement::recalculate(), registerReader(), registerUniversal(), registerWriter(), set(), setAccuracy(), unregisterReader(), and unregisterWriter().
|
protected |
The DataElement ElementURI.
Referenced by DataElement(), and getUri().
|
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().
|
protected |
The data writer responsable for notifying this element's Universal data element that a change is pending.
Referenced by registerChangeDone(), and registerChangePending().
|
protected |
Power used by the component that owns this element.
Referenced by getPower(), and setPower().
|
protected |
List of all registered DataReaders.
Referenced by findReader(), UniversalDataElement::isAnyDataRequested(), UniversalDataElement::isDataRequested(), isDataRequested(), isImplemented(), readerCount(), registerReader(), and unregisterReader().
|
protected |
Timestamp of last write.
Referenced by getTimestamp(), setTimestamp(), and wasTouchedSinceLastRun().
|
protected |
The base size that all writers must specify.
Referenced by getTypeSize().
|
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().
|
protected |
Queue of UniversalElements which this DataElement "participates in".
Referenced by getUniversal(), isBest(), isDataRequested(), isImplemented(), registerChangeDone(), registerUniversal(), and setTimestamp().
|
protected |
Indicates that the element was previously orphaned.
Referenced by registerWriter(), and unregisterWriter().
|
protected |
List of all registered DataWriters.
Referenced by findWriter(), isOwnersActive(), isOwnersFailed(), registerWriter(), unregisterWriter(), and writerCount().
|
protected |
Accuracy of last written value.
Referenced by getWrittenAccuracy(), and setWrittenAccuracy().