LRAUV  revA
ConfigDataElement Class Reference

#include <ConfigDataElement.h>

Inheritance diagram for ConfigDataElement:
Collaboration diagram for ConfigDataElement:

Public Member Functions

 ConfigDataElement (const ConfigURI &name, DataValue *initialValue)
 
virtual ~ConfigDataElement ()
 
void setConfigValue (DataValue *setFromValue)
 
void applyConfigValue (const Timestamp &ifWrittenBefore)
 
virtual void setTimestamp (const Timestamp &timestamp)
 Override this to clear flag: isConfigValue_. More...
 
virtual bool requiresRestart () const
 
virtual void setRequiresRestart (bool requiresRestart)
 
virtual bool isSecure (void) const
 
virtual void setSecure (bool secure)
 
virtual bool isActive () const
 Indicates if the element is "active". More...
 
virtual bool isFailed (void) const
 
virtual bool isOrphaned (void) const
 Returns the value of the element's "orphand" flag. More...
 
- Public Member Functions inherited from SimpleDataElement
 SimpleDataElement (const ElementURI &name, DataValue *initialValue, float accuracy)
 Constructor for a "Simple" DataElement. More...
 
virtual ~SimpleDataElement ()
 Destructor. More...
 
virtual DataValuegetDataValue (void) const
 Get the DataValue for this DataElement. More...
 
virtual float getAccuracy (const Unit &unit) const throw ( UninitializedException )
 Get the current DataElement accuracy. More...
 
virtual float setAccuracy (const Unit &unit, float accuracy)
 Set the current DataElement accuracy Implements the pure virtual from DataElement. More...
 
- Public Member Functions inherited from DataElement
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 bool isOwnersActive (void) const
 
virtual bool isActivatable (void) const
 Indicates if the element is capable of being "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 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 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...
 
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 )
 
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 )
 
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...
 
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 Member Functions

static void ApplyConfigValues (const Timestamp &ifWrittenBefore)
 
static unsigned int GetConfigDataElementCount ()
 
static ConfigDataElementGetConfigDataElement (unsigned int index)
 

Protected Attributes

DataValueconfigValue_
 
bool isConfigValue_
 
bool requiresRestart_
 
bool secure_
 
- Protected Attributes inherited from SimpleDataElement
DataValuevalue_
 The DataValue for this DataElement. More...
 
float accuracy_
 The accuracy for this DataElement. More...
 
- Protected Attributes inherited from DataElement
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...
 

Static Protected Attributes

static Mutex ListMutex_
 
static FlexArray< ConfigDataElement * > ConfigDataElements_
 

Private Member Functions

 ConfigDataElement (const ConfigDataElement &old)
 

Additional Inherited Members

- Static Public Attributes inherited from DataElement
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 inherited from SimpleDataElement
virtual float getBaseAccuracy () const
 Returns the accuracy in base, unscaled SI units. More...
 
virtual void setDataValue (DataValue *dataValue)
 
- Protected Member Functions inherited from DataElement
 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 void setBaseUnit (const Unit *baseUnit)
 
virtual void setTypeSize (const size_t typeSize)
 

Constructor & Destructor Documentation

ConfigDataElement::ConfigDataElement ( const ConfigURI name,
DataValue initialValue 
)
ConfigDataElement::~ConfigDataElement ( )
virtual
ConfigDataElement::ConfigDataElement ( const ConfigDataElement old)
private

Member Function Documentation

void ConfigDataElement::ApplyConfigValues ( const Timestamp ifWrittenBefore)
static
ConfigDataElement * ConfigDataElement::GetConfigDataElement ( unsigned int  index)
static
static unsigned int ConfigDataElement::GetConfigDataElementCount ( )
inlinestatic
virtual bool ConfigDataElement::isActive ( void  ) const
inlinevirtual

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 from DataElement.

virtual bool ConfigDataElement::isFailed ( void  ) const
inlinevirtual
virtual bool ConfigDataElement::isOrphaned ( void  ) const
inlinevirtual

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

Returns
true if the element is considered orphaned

Reimplemented from DataElement.

virtual bool ConfigDataElement::isSecure ( void  ) const
inlinevirtual
virtual bool ConfigDataElement::requiresRestart ( ) const
inlinevirtual
void ConfigDataElement::setConfigValue ( DataValue setFromValue)
virtual void ConfigDataElement::setRequiresRestart ( bool  requiresRestart)
inlinevirtual
virtual void ConfigDataElement::setSecure ( bool  secure)
inlinevirtual

References secure_.

void ConfigDataElement::setTimestamp ( const Timestamp timestamp)
virtual

Override this to clear flag: isConfigValue_.

Reimplemented from DataElement.

References isConfigValue_, and DataElement::setTimestamp().

Referenced by applyConfigValue().

Member Data Documentation

FlexArray< ConfigDataElement * > ConfigDataElement::ConfigDataElements_
staticprotected
DataValue* ConfigDataElement::configValue_
protected
bool ConfigDataElement::isConfigValue_
protected

Referenced by applyConfigValue(), and setTimestamp().

Mutex ConfigDataElement::ListMutex_
staticprotected
bool ConfigDataElement::requiresRestart_
protected
bool ConfigDataElement::secure_
protected

Referenced by isSecure(), and setSecure().


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