fesa-core
7.0.0
|
The framework's abstraction of a property's data or of a property's data filters. It provides access to the "raw" CMW data for get and set requests. More...
#include <ServerData.h>
Classes | |
struct | Array2DSize |
Representation of the size of a two-dimensional array. More... | |
struct | ArraySize |
Representation of the size of a one-dimensional array. More... | |
struct | StringArray2DSize |
Representation of the size of a two-dimensional array of strings. More... | |
struct | StringArraySize |
Representation of the size of a one-dimensional array of strings. More... | |
Public Member Functions | |
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 | |
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... | |
virtual bool | areItemsAvailable () const =0 |
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 =0 |
void | checkOnlyTheseItemsAvailable (const std::set< std::string > &validNames) const |
virtual void | checkItemsTypes () const =0 |
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... | |
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... | |
virtual void | checkIncomingItemsValues () const =0 |
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... | |
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 > | |
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 property's data or of a property's data filters. It provides access to the "raw" CMW data for get and set requests.
|
explicitprotected |
Constructor that takes ownership of the passed Data object.
data | auto_ptr containing the data to use. |
FesaException | if data points to NULL |
|
protectedpure virtual |
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.
Implemented in fesa::PropertyData.
|
protectedpure virtual |
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 |
Implemented in fesa::PropertyData.
|
protectedpure virtual |
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 |
Implemented in fesa::PropertyData.
|
protected |
Check if the type of the item in the data is the expected one.
name | The name of the item |
expectedType | The expected type of the item |
FesaException | if the type of the item in the data is not the expected one |
|
inlineprotected |
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.
name | The name of the value item |
direction | Optional direction. If set, the value is checked taking into account the direction. |
FesaException | if the values of the items in the data are not the allowed ones |
|
protected |
Check that the data container only contains valid names
validNames | set of valid item names from the design |
FesaException | if the data contains any items that are not in validNames |
|
protectedvirtual |
Check if any of the items in the data are not valid items from the design.
FesaException | if the names of the items in the data are unexpected |
Reimplemented in fesa::PropertyData.
void fesa::ServerData::checkOutgoingDataConsistency | ( | ) | const |
Check consistency of outgoing data. Ensure validity of the value items.
FesaException | if the values of items in the data do not belong to the set of allowed values |
|
protected |
Get a scalar value item.
name | The name of the item |
|
protected |
Get an array value item.
name | The name of the item |
size | [IN][OUT] The size of the array (size.size is [OUT], size.maxSize is [IN]) |
FesaException | if the number of elements is bigger than the maximal one |
|
protected |
Get a 2D array value item.
name | The name of the item |
size | [IN][OUT] The size of the array (size.nRows is [OUT], size.nColumns is [OUT], size.maxNRows is [IN], size.maxNColumns is [IN]) |
FesaException | if the number of rows is bigger than the maximal one |
FesaException | if the number of columns is bigger than the maximal one |
const cmw::data::Data & fesa::ServerData::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.
|
protected |
Get a function value item.
name | The name of the item |
size | [IN][OUT] The size of the function (size.size is [OUT], size.maxSize is [IN]) |
FesaException | if the number of points is greater than the maximal one |
|
protected |
Get a function-list value item.
name | The name of the item |
size | [IN][OUT] The size of the function list. Inputs: maxNRows is the maximum number of functions, maxNColumns the maximum number of points per function. Outputs: nRows is the number of functions, nCols is the maximum number of points in a single function. |
FesaException | if the number of functions or points is greater than the maximal one |
|
protected |
Get a string value item.
name | The name of the item |
maxLength | The maximal length of the string |
FesaException | if the length of the string is longer than the maximal one |
|
protected |
Get a string array value item.
name | The name of the item |
size | [IN][OUT] The size of the array (size.size is [OUT], size.maxSize is [IN], size.maxLength is [IN]) |
FesaException | if the number of elements is bigger than the maximal one |
FesaException | if the length of a string is longer than the maximal one |
|
protected |
Get a string 2D array value item.
name | The name of the item |
size | [IN][OUT] The size of the array (size.nRows is [OUT], size.nColumns is [OUT], size.maxNRows is [IN], size.maxNColumns is [IN], size.maxLength is [IN]) |
FesaException | if the number of rows is bigger than the maximal one |
FesaException | if the number of columns is bigger than the maximal one |
FesaException | if the length of a string is longer than the maximal one |
|
protectedpure virtual |
Returns the name of the first item that is not available for a property.
FesaException | if all items are available |
Implemented in fesa::PropertyData.
|
protected |
Check if a value item is available in the data.
name | The name of the value item |
std::auto_ptr< cmw::data::Data > fesa::ServerData::releaseCMWData | ( | ) |
/!\ /!\ This object cannot be used anymore after this function is called. /!\ /!\ Releases the contained CMW Data object. Ownership is transfered to the caller. Leaves this object in an unusable state.
FesaException | if this object was instantiated with a reference to a Data object. |
|
inlineprotected |
Set a scalar value item.
name | The name of the item |
value | The value of the item |
|
protected |
Set a string value item.
name | The name of the item |
value | The value of the item |
maxLength | The maximal length of the string |
FesaException | if the length of the string is longer than the maximal one |
|
inlineprotected |
Set an array value item.
name | The name of the item |
value | The value of the item |
size | The size of the array |
FesaException | if the provided number of elements is bigger than the maximal one |
|
protected |
Set a string array value item.
name | The name of the item |
value | The value of the item |
size | The size of the array |
FesaException | if the provided number of elements is bigger than the maximal one |
FesaException | if the length of a string is longer than the maximal one |
|
inlineprotected |
Set an 2D array value item. The array must be allocated contiguously.
name | The name of the item |
value | The value of the item |
size | The size of the array |
FesaException | if the provided number of rows is bigger than the maximal one |
FesaException | if the provided number of columns is bigger than the maximal one |
|
protected |
Set a string 2D array value item. The array must be allocated contiguously. FESA doesn't support 2D arrays of strings.
name | The name of the item |
value | The value of the item |
size | The size of the array |
FesaException | if the provided number of rows is bigger than the maximal one |
FesaException | if the provided number of columns is bigger than the maximal one |
FesaException | if the length of a string is longer than the maximal one |
|
protected |
Set a discrete function value item.
name | The name of the item |
value | The value of the item |
maxSize | The maximum size (in number of points) of the item |
|
protected |
Set a discrete function list value item.
name | The name of the item |
value | The value of the item |
maxNFunctions | The maximum number of functions of the item |
maxNPoints | The maximum number of points per function of the item |