fesa-core
4.3.1
|
Base class which defines virtual methods to manage all the FESA fields. More...
#include <AbstractField.h>
Public Member Functions | |
virtual | ~AbstractField () |
destructor | |
AbstractMultiplexingManager * | getMultiplexingManager () |
uint32_t | getMuxDepth () const |
virtual std::size_t | getFieldValueSize () const =0 |
bool | isMultiplexed () const |
const std::string & | getName () const |
FieldCategory | getType () const |
bool | isPersistent () const |
bool | isShared () const |
virtual std::string | getAsString (const MultiplexingContext *context) const =0 |
Method to retrieve the value of the field converted to string. More... | |
std::string | getAttributeAsStringByName (const std::string &attribute, MultiplexingContext *context=NULL) |
Method to retrieve the struct attribute value converted to string. More... | |
Static Public Attributes | |
static const std::size_t | INVALID_SIZE = std::numeric_limits<std::size_t>::max() |
Protected Member Functions | |
virtual void | initializeDefaultValue (const std::string &value) |
Initialize the default value with a value provided in the instantiation file. More... | |
virtual void | initializeDimensions (const boost::shared_ptr< FieldElement > &fieldElement) |
Used to initialize dimensions coming from the instantation. More... | |
void | setMultiplexingManager (AbstractMultiplexingManager *muxManager) |
changes the multiplexing manager of the field. More... | |
void | setDataIntegrity (DataIntegrity dataIntegrity) |
changes the data integrity value of the field | |
void | restore (const PersistanceFieldElement &fieldElement) |
gives the value to the field from the field element This method should be used to populate the fields at instantiation More... | |
void | store (PersistanceFieldElement &fieldElement) |
Used to persist fields. More... | |
AbstractField (const FieldConfig &fieldConfig, DataStore *dataStore) | |
Constructor. More... | |
template<typename T > | |
T * | getSlotPointer (void *baseAddress, std::size_t slot) |
template<typename T > | |
const T * | getSlotPointer (const void *baseAddress, std::size_t slot) const |
virtual void | getValueToStore (int32_t slot, std::string &str) const =0 |
virtual void | getAttributeValueToStore (int32_t slot, const std::string &attribute, std::string &str) |
virtual void | setFieldValueAddress (char *pFV, bool initFieldsFlag)=0 |
Maps an address in shared memory or on the heap to the field value member of the field class. More... | |
virtual void | copyValue (uint32_t slot, const std::string &val)=0 |
copy the value passed by parameter in the specified slot More... | |
template<typename T > | |
void | validateValue (const T &value) const |
template<typename T > | |
void | validateValues (const T *values, const std::size_t count) const |
void | setMultiplexed (bool multiplexed) |
changes the multiplexing status | |
virtual FieldValueBase * | getFieldValue (int32_t slot)=0 |
Get the field's value for a given slot. More... | |
Protected Attributes | |
std::string | name_ |
name of the field | |
FieldCategory | fieldCategory_ |
category of the field (Acquisition, Generic, Setting or Configuration) | |
bool | multiplexed_ |
true if the field is multiplexed | |
bool | shared_ |
flag that indicates whether field is shared byt RT and Server | |
bool | persistent_ |
flag that indicates whether field is persistent | |
DataIntegrity | buffer_ |
type of buffer of the field | |
AbstractMultiplexingManager * | multiplexingManager_ |
multiplexing manager of the field | |
DataStore * | dataStore_ |
The data store this field belongs to. | |
std::size_t | valueSize_ |
size of the value | |
Base class which defines virtual methods to manage all the FESA fields.
|
protected |
Constructor.
fieldName | name of the field |
fieldCategory | category of the field |
multiplexed | true if the field is multiplexed |
multiMultiplexed | true if the field is multi-multiplexed |
persistent | true if the field must be persisted |
DataIntegrity | indicates whether the field is double-buffered or not |
dataStore | datastore that contains this field |
|
protectedpure virtual |
copy the value passed by parameter in the specified slot
slot | to put the value |
val | value to put |
Implemented in fesa::FieldArray< T >, fesa::FieldArray< Point >, fesa::FieldArray< detail::FunctionStorage >, fesa::FieldStringArray, fesa::FieldArray2D< T >, fesa::FieldString, fesa::Field< T >, fesa::Field< int32_t >, fesa::Field< bool >, fesa::FieldFunctionList, fesa::FieldStruct< T >, and fesa::FieldStruct< DataType >.
|
pure virtual |
Method to retrieve the value of the field converted to string.
context | the multiplexing context |
Implemented in fesa::AcqFieldStruct< T, MutableType >, fesa::GenericFieldStruct< T, MutableType >, fesa::GenericFieldStruct< DataType >, fesa::SettingFieldStruct< T, MutableType >, fesa::ConfigFieldStruct< T >, fesa::AcqFieldScalar< T >, fesa::GenericFieldScalar< T >, fesa::GenericFieldScalar< int32_t >, fesa::GenericFieldScalar< bool >, fesa::SettingFieldScalar< T >, and fesa::ConfigFieldScalar< T >.
std::string fesa::AbstractField::getAttributeAsStringByName | ( | const std::string & | attribute, |
MultiplexingContext * | context = NULL |
||
) |
Method to retrieve the struct attribute value converted to string.
attribute | the attribute name |
context | the multiplexing context |
|
protectedvirtual |
Reimplemented in fesa::FieldStruct< T >, and fesa::FieldStruct< DataType >.
|
protectedpure virtual |
Get the field's value for a given slot.
slot | The slot to get the field's value from |
Implemented in fesa::FieldStringArray, fesa::FieldArray< T >, fesa::FieldArray< Point >, fesa::FieldArray< detail::FunctionStorage >, fesa::FieldArray2D< T >, fesa::FieldString, fesa::Field< T >, fesa::Field< int32_t >, fesa::Field< bool >, fesa::FieldStruct< T >, and fesa::FieldStruct< DataType >.
|
pure virtual |
Returns the size (in bytes) of a FieldValue instantiated by this AbstractField object.
Implemented in fesa::FieldStringArray, fesa::FieldString, fesa::FieldArray2D< T >, fesa::FieldArray< T >, fesa::FieldArray< Point >, fesa::FieldArray< detail::FunctionStorage >, fesa::Field< T >, fesa::Field< int32_t >, fesa::Field< bool >, fesa::FieldStruct< T >, and fesa::FieldStruct< DataType >.
AbstractMultiplexingManager * fesa::AbstractField::getMultiplexingManager | ( | ) |
uint32_t fesa::AbstractField::getMuxDepth | ( | ) | const |
const std::string & fesa::AbstractField::getName | ( | ) | const |
|
protected |
Returns a pointer to the value at the address of the given slot.
T | the type to return |
baseAddress | address where the field storage begins |
slot | the slot to look for |
FesaException | if slot is out of bounds |
|
protected |
Returns a pointer to the value at the address of the given slot.
T | the type to return |
baseAddress | address where the field storage begins |
slot | the slot to look for |
FesaException | if slot is out of bounds |
FieldCategory fesa::AbstractField::getType | ( | ) | const |
|
protectedpure virtual |
Implemented in fesa::FieldArray< T >, fesa::FieldArray< Point >, fesa::FieldArray< detail::FunctionStorage >, fesa::FieldStringArray, fesa::FieldArray2D< T >, fesa::FieldString, fesa::Field< T >, fesa::Field< int32_t >, fesa::Field< bool >, fesa::FieldStruct< T >, fesa::FieldStruct< DataType >, and fesa::FieldFunctionList.
|
protectedvirtual |
Initialize the default value with a value provided in the instantiation file.
value | the serialized value |
Reimplemented in fesa::FaultField< DataType >.
|
protectedvirtual |
Used to initialize dimensions coming from the instantation.
fieldElement | that contains the values |
Reimplemented in fesa::FieldStringArray, fesa::FieldArray< T >, fesa::FieldArray< Point >, fesa::FieldArray< detail::FunctionStorage >, fesa::FieldString, fesa::FieldArray2D< T >, and fesa::FieldFunctionList.
bool fesa::AbstractField::isMultiplexed | ( | ) | const |
bool fesa::AbstractField::isPersistent | ( | ) | const |
bool fesa::AbstractField::isShared | ( | ) | const |
|
protected |
gives the value to the field from the field element This method should be used to populate the fields at instantiation
field | element with information extracted from the instantiation |
|
protectedpure virtual |
Maps an address in shared memory or on the heap to the field value member of the field class.
pFV | pointer to a field value. |
Implemented in fesa::FieldStringArray, fesa::FieldArray< T >, fesa::FieldArray< Point >, fesa::FieldArray< detail::FunctionStorage >, fesa::FieldString, fesa::FieldArray2D< T >, fesa::FaultField< DataType >, fesa::Field< T >, fesa::Field< int32_t >, fesa::Field< bool >, fesa::FieldStruct< T >, fesa::FieldStruct< DataType >, fesa::FieldFunctionList, and fesa::FieldFunction.
|
protected |
changes the multiplexing manager of the field.
muxManager | pointer to an already created multiplexing manager |
|
protected |
Used to persist fields.
fieldElement | with information extracted from the field |
|
inlineprotected |
Ensures that the given value is compatible with this field. Throws FesaException if not.
value | the value to check |
|
inlineprotected |
Ensures that the given values are compatible with this field. Throws FesaException if not.
value | pointer to an array of values to check |
count | the number of values in the array |
|
static |
Represents an invalid field size.