fesa-core  7.0.0
fesa::PropertyData Class Reference

The framework's abstraction of a multiplexed property's data It provides access to the underlying CMW context. More...

#include <PropertyData.h>

Inheritance diagram for fesa::PropertyData:
fesa::ServerData

Public Member Functions

 PropertyData ()
 
 PropertyData (cmw::data::Data &data)
 
 PropertyData (std::auto_ptr< cmw::data::Data > data)
 
 PropertyData (const cmw::rda3::common::AcquiredData &acquiredData, RequestType::RequestType requestType=RequestType::GET)
 
const std::string & getCycleName () const
 Get the name of the cycle. More...
 
void setCycleName (const std::string &name)
 Set the name of the cycle. More...
 
timestamp_ns getCycleStamp () const
 Get the stamp of the cycle. More...
 
void setCycleStamp (timestamp_ns stamp)
 Set the stamp of the cycle. More...
 
timestamp_ns getAcqStamp () const
 Get the stamp of the acquisition. More...
 
void setAcqStamp (timestamp_ns stamp)
 Set the stamp of the acquisition. More...
 
timestamp_ns getSetStamp () const
 Get the set stamp of the setting, or 0 if it is unknown. More...
 
void setSetStamp (timestamp_ns stamp)
 Set the set stamp of the setting. More...
 
ContextData::ContextType getContextType () const
 
void setContextType (ContextData::ContextType contextType)
 
RequestType::RequestType getRequestType () const
 
void setRequestType (RequestType::RequestType requestType)
 
std::auto_ptr
< cmw::rda3::common::AcquiredContext > 
getAcquiredContext () const
 
UpdateType::UpdateType getUpdateType () const
 
const ContextDatagetContextData () const
 
void setContextData (const ContextData &context)
 
- Public Member Functions inherited from fesa::ServerData
const cmw::data::Data & getCMWData () const
 Get the underlying CMW data STD: Not sure we can do everything w/o this member function, e.g. set with ProxyInterface. Needed for ServerAction to return it to property and CallbackGetSet. Needed by ProxyInterface to give it to CMW. More...
 
std::auto_ptr< cmw::data::Data > releaseCMWData ()
 
void checkOutgoingDataConsistency () const
 Check consistency of outgoing data. Ensure validity of the value items. More...
 

Protected Member Functions

virtual bool areItemsAvailable () const
 Check that all the input value items are present in the data. The check is necessary when partial setting of a property is not allowed. More...
 
virtual std::string getUnavailableItemName () const
 
virtual void checkItemsTypes () const
 Check if the types of the items in the data are the expected ones. More...
 
virtual void checkOnlyValidItemsAvailable () const
 Check if any of the items in the data are not valid items from the design. More...
 
virtual void checkIncomingItemsValues () const
 Check if the values of the items in the data belong to the allowed sets, e.g. the value is in the range between the minimal and the maximal value, the value of an enumeration type is one of the enumerated values. More...
 
- Protected Member Functions inherited from fesa::ServerData
 ServerData (std::auto_ptr< cmw::data::Data > data)
 
bool isItemAvailable (const std::string &name) const
 Check if a value item is available in the data. More...
 
void checkOnlyTheseItemsAvailable (const std::set< std::string > &validNames) const
 
template<class T >
void set (const std::string &name, T value)
 Set a scalar value item. More...
 
void set (const std::string &name, const char *value, std::size_t maxLength)
 Set a string value item. More...
 
void setArray (const std::string &name, const char *const *value, const StringArraySize &size)
 Set a string array value item. More...
 
void setArray2D (const std::string &name, const char *const *value, const StringArray2DSize &size)
 Set a string 2D array value item. The array must be allocated contiguously. FESA doesn't support 2D arrays of strings. More...
 
void setDiscreteFunction (const std::string &name, const ImmutableFunction &value, std::size_t maxSize)
 Set a discrete function value item. More...
 
void setDiscreteFunctionList (const std::string &name, const ImmutableFunctionList &value, std::size_t maxNFunctions, std::size_t maxNPoints)
 Set a discrete function list value item. More...
 
const char * getString (const std::string &name, std::size_t maxLength) const
 Get a string value item. More...
 
const char *const * getStringArray (const std::string &name, StringArraySize &size) const
 Get a string array value item. More...
 
const char *const * getStringArray2D (const std::string &name, StringArray2DSize &size) const
 Get a string 2D array value item. More...
 
ImmutableFunction getDiscreteFunction (const std::string &name, ArraySize &size) const
 Get a function value item. More...
 
ImmutableFunctionList getDiscreteFunctionList (const std::string &name, Array2DSize &size) const
 Get a function-list value item. More...
 
void checkItemType (const std::string &name, const std::string &expectedType) const
 Check if the type of the item in the data is the expected one. More...
 
template<class T >
void checkItemValue (const std::string &name) const
 Check if the value of the item in the data belong to the allowed set, e.g. the value is in the range between the minimal and the maximal value, the value of an enumeration type is one of the enumerated values. More...
 
template<class T >
void setArray (const std::string &name, const T *value, const ArraySize &size)
 Set an array value item. More...
 
template<class T >
void setArray2D (const std::string &name, const T *value, const Array2DSize &size)
 Set an 2D array value item. The array must be allocated contiguously. More...
 
template<class T >
get (const std::string &name) const
 Get a scalar value item. More...
 
template<class T >
const T * getArray (const std::string &name, ArraySize &size) const
 Get an array value item. More...
 
template<class T >
const T * getArray2D (const std::string &name, Array2DSize &size) const
 Get a 2D array value item. More...
 

Detailed Description

The framework's abstraction of a multiplexed property's data It provides access to the underlying CMW context.

Constructor & Destructor Documentation

fesa::PropertyData::PropertyData ( )

Constructor. Allocates a cmw::data::Data object.

fesa::PropertyData::PropertyData ( cmw::data::Data &  data)
explicit

Constructor. Keeps a reference to the Data object, no copy is performed.

Parameters
datathe Data object to use
fesa::PropertyData::PropertyData ( std::auto_ptr< cmw::data::Data >  data)
explicit

Constructor that takes ownership of the passed data object.

Parameters
datathe Data object to use
Exceptions
FesaExceptionif data points to NULL
fesa::PropertyData::PropertyData ( const cmw::rda3::common::AcquiredData &  acquiredData,
RequestType::RequestType  requestType = RequestType::GET 
)
explicit

This constructor copies the data and the context from acquiredData. Meant to be used with the result of a call to rda3's AccessPoint::get().

Parameters
acquiredDataobject containing the data to copy
requestTypethe request type to set

Member Function Documentation

bool fesa::PropertyData::areItemsAvailable ( ) const
protectedvirtual

Check that all the input value items are present in the data. The check is necessary when partial setting of a property is not allowed.

Returns
'true' if the data contains all the items, 'false' otherwise

Implements fesa::ServerData.

void fesa::PropertyData::checkIncomingItemsValues ( ) const
protectedvirtual

Check if the values of the items in the data belong to the allowed sets, e.g. the value is in the range between the minimal and the maximal value, the value of an enumeration type is one of the enumerated values.

Exceptions
FesaExceptionif the values of the items in the data are not the allowed ones

Implements fesa::ServerData.

void fesa::PropertyData::checkItemsTypes ( ) const
protectedvirtual

Check if the types of the items in the data are the expected ones.

Exceptions
FesaExceptionif the types of the items in the data are not the expected ones

Implements fesa::ServerData.

void fesa::PropertyData::checkOnlyValidItemsAvailable ( ) const
protectedvirtual

Check if any of the items in the data are not valid items from the design.

Exceptions
FesaExceptionif the names of the items in the data are unexpected

Reimplemented from fesa::ServerData.

int64_t fesa::PropertyData::getAcqStamp ( ) const

Get the stamp of the acquisition.

Returns
The stamp of the acquisition
std::auto_ptr< cmw::rda3::common::AcquiredContext > fesa::PropertyData::getAcquiredContext ( ) const

Creates and returns a CMW AcquiredContext object from the ContextData.

const ContextData & fesa::PropertyData::getContextData ( ) const

Returns the ContextData associated to this object.

ContextData::ContextType fesa::PropertyData::getContextType ( ) const

Returns the Context type associated to this object.

const std::string & fesa::PropertyData::getCycleName ( ) const

Get the name of the cycle.

Parameters
maxLengthThe maximal length of the cycle name's string
Returns
The name of the cycle
Exceptions
FesaExceptionif the length of the string is longer than the maximal one
int64_t fesa::PropertyData::getCycleStamp ( ) const

Get the stamp of the cycle.

Returns
The stamp of the cycle
RequestType::RequestType fesa::PropertyData::getRequestType ( ) const

Returns the RequestType associated to this object. Only meaningful for Get requests.

timestamp_ns fesa::PropertyData::getSetStamp ( ) const

Get the set stamp of the setting, or 0 if it is unknown.

Returns
The set stamp of the setting
std::string fesa::PropertyData::getUnavailableItemName ( ) const
protectedvirtual

Returns the name of the first item that is not available for a property.

See Also
areItemsAvailable
Exceptions
FesaExceptionif all items are available

Implements fesa::ServerData.

UpdateType::UpdateType fesa::PropertyData::getUpdateType ( ) const

Returns the UpdateType associated to this object. Only meaningful for Get requests.

void fesa::PropertyData::setAcqStamp ( timestamp_ns  stamp)

Set the stamp of the acquisition.

Parameters
stampThe stamp of the acquisition
void fesa::PropertyData::setContextData ( const ContextData context)

Sets the ContextData of this object. Should only be used by the Property or ServerAction objects. The given context is copied.

void fesa::PropertyData::setContextType ( ContextData::ContextType  contextType)

Sets the ContextType associated to this object.

void fesa::PropertyData::setCycleName ( const std::string &  name)

Set the name of the cycle.

Parameters
nameThe name of the cycle
Exceptions
FesaExceptionif the length of the string is longer than the maximal one
void fesa::PropertyData::setCycleStamp ( timestamp_ns  stamp)

Set the stamp of the cycle.

Parameters
stampThe stamp of the cycle
void fesa::PropertyData::setRequestType ( RequestType::RequestType  requestType)

Sets the RequestType of this object. Should only be used by the Property or ServerAction objects.

void fesa::PropertyData::setSetStamp ( timestamp_ns  stamp)

Set the set stamp of the setting.

Parameters
stampThe set stamp of the setting

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