fesa-core  7.0.0
fesa::GenericFieldStruct< T, MutableType > Class Template Reference

Wrapper class for generic fields. The generic field API offer methods to set fields, in contrast to configuration fields which cannot be set dynamically because they are constant. More...

#include <GenericField.h>

Inheritance diagram for fesa::GenericFieldStruct< T, MutableType >:
fesa::FieldStruct< T > fesa::AbstractField

Public Member Functions

 GenericFieldStruct (const FieldConfig &fieldConfig, DataStore *pDataStore)
 Constructor. More...
 
 ~GenericFieldStruct ()
 destructor
 
const T * get (const MultiplexingContext *) const
 Method to retrieve the value of the field. More...
 
MutableType getMutable (const MultiplexingContext *context)
 
void set (const T *val, const MultiplexingContext *)
 Method to set the new value of the pending buffer of the field. More...
 
virtual std::string getAsString (const MultiplexingContext *context) const
 Method to retrieve the value of the field converted to string. More...
 
- Public Member Functions inherited from fesa::AbstractField
virtual ~AbstractField ()
 destructor
 
AbstractMultiplexingManagergetMultiplexingManager ()
 
uint32_t getMuxDepth () const
 
bool isMultiplexed () const
 
const std::string & getName () const
 
FieldCategory getType () const
 
bool isPersistent () const
 
bool isShared () const
 
std::string getAttributeAsStringByName (const std::string &attribute, MultiplexingContext *context=NULL)
 Method to retrieve the struct attribute value converted to string. More...
 

Additional Inherited Members

- Static Public Attributes inherited from fesa::AbstractField
static const std::size_t INVALID_SIZE = std::numeric_limits<std::size_t>::max()
 
- Protected Member Functions inherited from fesa::FieldStruct< T >
std::size_t getFieldValueSize () const
 
std::size_t getFieldValueAlignment () const
 
std::size_t getFieldValueDataOffset () const
 
FieldValue< T > * getFieldValue (int32_t slot)
 Get the field's value for a given slot. More...
 
virtual void setFieldValueAddress (char *pFV, bool initFieldsFlag)
 Maps an address in shared memory or on the heap to the field value member of the field class. More...
 
void copyValue (uint32_t slot, const std::string &val)
 this method puts in the slot the value passed by parameter in the corresponding format More...
 
void getValueToStore (int32_t slot, std::string &str) const
 
void getAttributeValueToStore (int32_t slot, const std::string &attribute, std::string &str)
 
- Protected Member Functions inherited from fesa::AbstractField
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, bool ignoreInvalidValues)
 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
 
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
 
- Protected Attributes inherited from fesa::FieldStruct< T >
FieldValue< T > * fieldValue_
 value of the field in the first slot
 
- Protected Attributes inherited from fesa::AbstractField
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
 
AbstractMultiplexingManagermultiplexingManager_
 multiplexing manager of the field
 
DataStoredataStore_
 The data store this field belongs to.
 
std::size_t valueSize_
 size of the value
 

Detailed Description

template<typename T, typename MutableType = fesa::wrappers::PointerWrapper<T, fesa::FieldCallback>>
class fesa::GenericFieldStruct< T, MutableType >

Wrapper class for generic fields. The generic field API offer methods to set fields, in contrast to configuration fields which cannot be set dynamically because they are constant.

Constructor & Destructor Documentation

template<typename T , typename MutableType >
fesa::GenericFieldStruct< T, MutableType >::GenericFieldStruct ( const FieldConfig fieldConfig,
DataStore pDataStore 
)

Constructor.

Parameters
fieldNamename of the field
criterionNamemultiplexing criterion
pointerto DataStore that contains the field

Member Function Documentation

template<typename T , typename MutableType >
const T * fesa::GenericFieldStruct< T, MutableType >::get ( const MultiplexingContext context) const

Method to retrieve the value of the field.

Parameters
contextthe multiplexing context
Returns
the value of the pending buffer
template<typename T , typename MutableType >
std::string fesa::GenericFieldStruct< T, MutableType >::getAsString ( const MultiplexingContext context) const
virtual

Method to retrieve the value of the field converted to string.

Parameters
contextthe multiplexing context
Returns
the converted value

Implements fesa::AbstractField.

template<typename T , typename MutableType >
MutableType fesa::GenericFieldStruct< T, MutableType >::getMutable ( const MultiplexingContext context)

Returns a mutable version of the field value.

Parameters
contextthe multiplexing context
template<typename T, typename MutableType >
void fesa::GenericFieldStruct< T, MutableType >::set ( const T *  val,
const MultiplexingContext context 
)

Method to set the new value of the pending buffer of the field.

Parameters
valnew value of field
contextthe multiplexing context

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