fesa-core  4.3.1
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...
 
int64_t getCycleStamp () const
 Get the stamp of the cycle. More...
 
void setCycleStamp (int64_t stamp)
 Set the stamp of the cycle. More...
 
int64_t getAcqStamp () const
 Get the stamp of the acquisition. More...
 
void setAcqStamp (int64_t stamp)
 Set the stamp of the acquisition. More...
 
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. More...
 
std::auto_ptr< cmw::data::Data > releaseCMWData ()
 
void checkOutgoingDataConsistency () const
 Check consistency of outgoing data. More...
 

Protected Member Functions

virtual bool areItemsAvailable () const
 Check that all the input value items are present in the data. More...
 
virtual void checkItemsTypes () const
 Check if the types of the items in the data are the expected ones. More...
 
virtual void checkIncomingItemsValues () const
 Check if the values of the items in the data belong to the allowed sets, e.g. 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...
 
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 **value, const StringArraySize &size)
 Set a string array value item. More...
 
void setArray2D (const std::string &name, const char **value, const StringArray2DSize &size)
 Set a string 2D array value item. 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 ** getStringArray (const std::string &name, StringArraySize &size) const
 Get a string array value item. More...
 
const char ** 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. 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. 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.

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.

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.

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

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

void fesa::PropertyData::setAcqStamp ( int64_t  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::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 ( int64_t  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.


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