fesa-core
4.2.0
|
The framework's abstraction of a multiplexed property's data It provides access to the underlying CMW context. More...
#include <PropertyData.h>
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 ContextData & | getContextData () 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 > | |
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... | |
The framework's abstraction of a multiplexed property's data It provides access to the underlying CMW context.
fesa::PropertyData::PropertyData | ( | ) |
Constructor. Allocates a cmw::data::Data object.
|
explicit |
Constructor. Keeps a reference to the Data object, no copy is performed.
data | the Data object to use |
|
explicit |
Constructor that takes ownership of the passed data object.
data | the Data object to use |
FesaException | if data points to NULL |
|
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().
acquiredData | object containing the data to copy |
requestType | the request type to set |
|
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
Implements fesa::ServerData.
|
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
FesaException | if the values of the items in the data are not the allowed ones |
Implements fesa::ServerData.
|
protectedvirtual |
Check if the types of the items in the data are the expected ones.
FesaException | if 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.
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.
maxLength | The maximal length of the cycle name's string |
FesaException | if the length of the string is longer than the maximal one |
int64_t fesa::PropertyData::getCycleStamp | ( | ) | const |
Get 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.
stamp | The 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.
name | The name of the cycle |
FesaException | if the length of the string is longer than the maximal one |
void fesa::PropertyData::setCycleStamp | ( | int64_t | stamp | ) |
Set the stamp of the cycle.
stamp | The 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.