LRAUV  revA
UniversalDataReader Class Reference

A DataAccessor that reads values from the Slate Contains a default dataValue that must not be NULL, which is returned if a dataValue request is made and this Accessor's associated DataElement is unavailable for some reason (not initialized, orphaned, or failed). More...

#include <UniversalDataReader.h>

Inheritance diagram for UniversalDataReader:
Collaboration diagram for UniversalDataReader:

Public Member Functions

 UniversalDataReader (Component *owner, UniversalDataElement &universalElement, const DataValue *defaultValue, bool deleteDefaultValue=true)
 
 UniversalDataReader (Component *owner, UniversalDataElement &universalElement, const Unit &defaultUnit)
 
virtual ~UniversalDataReader ()
 
float getAccuracy (const Unit &unit)
 Returns the DataElement's current accuracy (i.e., for the next write) More...
 
float getWrittenAccuracy (const Unit &unit)
 Returns the DataElement's accuracy at the time of the last write;. More...
 
virtual void requestData (bool requestingData)
 
void requestData (RequestStrategy requestStrategy)
 
UniversalDataElementgetUniversalElement ()
 
- Public Member Functions inherited from DataReader
 DataReader (Component *owner, DataElement &element, const DataValue *defaultValue, bool deleteDefaultValue=true)
 
 DataReader (Component *owner, DataElement &element, const Unit &defaultUnit)
 
virtual ~DataReader ()
 
const UnitgetDefaultUnit ()
 
bool isUnavailable (void)
 Status and state functions. More...
 
bool isInvalid (void)
 
bool isOrphaned (void)
 
bool isActive (void)
 
bool read (const Unit &unit, unsigned char &readTo)
 Get functions. More...
 
bool read (const Unit &unit, double &readTo)
 
bool read (const Unit &unit, float &readTo)
 
bool read (const Unit &unit, int &readTo)
 
bool read (bool &readTo)
 
bool read (Timespan &readTo)
 
bool read (DataValue &readTo)
 
int asInt (const Unit &unit)
 
double asDouble (const Unit &unit) __attribute__((deprecated))
 
Str asString (const Unit &unit)
 
const TimestampgetTimestamp (void) const
 Returns the Timestamp of the last write to this reader's DataElement. More...
 
bool wasTouchedSinceLastRun (const Component *component)
 Returns true if the value was touched since the last run of the indicated component. More...
 
bool isRequestingData (void)
 
RequestStrategy getRequestStrategy (void)
 
void setImplementor (bool implementor=true)
 
bool isImplementor ()
 
- Public Member Functions inherited from DataAccessor
virtual ~DataAccessor ()
 
virtual DataElementgetElement (void) const
 
virtual ComponentgetOwner (void) const
 
virtual const ElementURIgetUri (void) const
 
AccessorType getAccessorType () const
 
DataAccessgetDataAccess () const
 
Logger::TimePrecisionType getTimePrecision () const
 

Private Member Functions

 UniversalDataReader (const UniversalDataReader &old)
 

Private Attributes

UniversalDataElementuniversalElement_
 

Additional Inherited Members

- Public Types inherited from DataAccessor
enum  AccessorType { DATA_READER = 0, DATA_WRITER = 1 }
 
enum  RequestStrategy {
  NO_STRATEGY = -1, MIN_POWER, MIN_ERROR, MIN_LATENCY,
  MAX_FREQUENCY, ALL_DEVICES, STRATEGY_COUNT
}
 
- Static Public Member Functions inherited from DataAccessor
static RequestStrategy Str2RequestStrategy (const char *const strategyStr)
 
static const char * RequestStrategy2Str (DataAccessor::RequestStrategy strategy)
 
- Static Public Attributes inherited from DataAccessor
static const char *const REQUEST_STRATEGY_STRS [STRATEGY_COUNT]
 
- Protected Member Functions inherited from DataAccessor
 DataAccessor (Component *owner, DataElement &element, AccessorType accessorType, UniversalDataElement *universal, Logger::TimePrecisionType timePrecision=Logger::TIME_PRECISION_MILLIS)
 Protected Constructor. More...
 
- Protected Attributes inherited from DataReader
RequestStrategy requestStrategy_
 
const DataValuedefaultValue_
 
const UnitdefaultUnit_
 
bool deleteDefaultValue_
 
bool implementor_
 
- Protected Attributes inherited from DataAccessor
Componentowner_
 
DataElementelement_
 
AccessorType accessorType_
 
Logger::TimePrecisionType timePrecision_
 
DataAccessdataAccess_
 

Detailed Description

A DataAccessor that reads values from the Slate Contains a default dataValue that must not be NULL, which is returned if a dataValue request is made and this Accessor's associated DataElement is unavailable for some reason (not initialized, orphaned, or failed).

Constructor & Destructor Documentation

UniversalDataReader::UniversalDataReader ( Component owner,
UniversalDataElement universalElement,
const DataValue defaultValue,
bool  deleteDefaultValue = true 
)
UniversalDataReader::UniversalDataReader ( Component owner,
UniversalDataElement universalElement,
const Unit defaultUnit 
)
UniversalDataReader::~UniversalDataReader ( )
virtual
UniversalDataReader::UniversalDataReader ( const UniversalDataReader old)
private

Member Function Documentation

UniversalDataElement& UniversalDataReader::getUniversalElement ( )
inline

References universalElement_.

float UniversalDataReader::getWrittenAccuracy ( const Unit unit)

Returns the DataElement's accuracy at the time of the last write;.

Returns
DataElement's accuracy at the time of the last write.

References DataAccessor::element_, and DataElement::getWrittenAccuracy().

Referenced by Navigator::readExternalFix().

void UniversalDataReader::requestData ( RequestStrategy  requestStrategy)
virtual

Reimplemented from DataReader.

References DataReader::requestStrategy_.

Member Data Documentation

UniversalDataElement& UniversalDataReader::universalElement_
private

Referenced by getUniversalElement().


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