fesa-core  4.3.1
fesa::AbstractField Class Referenceabstract

Base class which defines virtual methods to manage all the FESA fields. More...

#include <AbstractField.h>

Inheritance diagram for fesa::AbstractField:
fesa::Field< T > fesa::FieldArray< T > fesa::FieldArray2D< T > fesa::FieldString fesa::FieldStringArray fesa::FieldStruct< T > fesa::Field< bool > fesa::Field< int32_t > fesa::FieldArray< detail::FunctionStorage > fesa::FieldArray< Point > fesa::FieldStruct< DataType >

Public Member Functions

virtual ~AbstractField ()
 destructor
 
AbstractMultiplexingManagergetMultiplexingManager ()
 
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
 
AbstractMultiplexingManagermultiplexingManager_
 multiplexing manager of the field
 
DataStoredataStore_
 The data store this field belongs to.
 
std::size_t valueSize_
 size of the value
 

Detailed Description

Base class which defines virtual methods to manage all the FESA fields.

Constructor & Destructor Documentation

fesa::AbstractField::AbstractField ( const FieldConfig fieldConfig,
DataStore dataStore 
)
protected

Constructor.

Parameters
fieldNamename of the field
fieldCategorycategory of the field
multiplexedtrue if the field is multiplexed
multiMultiplexedtrue if the field is multi-multiplexed
persistenttrue if the field must be persisted
DataIntegrityindicates whether the field is double-buffered or not
dataStoredatastore that contains this field

Member Function Documentation

virtual void fesa::AbstractField::copyValue ( uint32_t  slot,
const std::string &  val 
)
protectedpure virtual
virtual std::string fesa::AbstractField::getAsString ( const MultiplexingContext context) const
pure virtual
std::string fesa::AbstractField::getAttributeAsStringByName ( const std::string &  attribute,
MultiplexingContext context = NULL 
)

Method to retrieve the struct attribute value converted to string.

Parameters
attributethe attribute name
contextthe multiplexing context
Returns
the converted value
void fesa::AbstractField::getAttributeValueToStore ( int32_t  slot,
const std::string &  attribute,
std::string &  str 
)
protectedvirtual
Returns
the struct attribute value of the pending buffer as a string

Reimplemented in fesa::FieldStruct< T >, and fesa::FieldStruct< DataType >.

virtual FieldValueBase* fesa::AbstractField::getFieldValue ( int32_t  slot)
protectedpure virtual
virtual std::size_t fesa::AbstractField::getFieldValueSize ( ) const
pure virtual
AbstractMultiplexingManager * fesa::AbstractField::getMultiplexingManager ( )
Returns
the multiplexing manager of the field
uint32_t fesa::AbstractField::getMuxDepth ( ) const
Returns
retrieves the multiplexing depth of the field
const std::string & fesa::AbstractField::getName ( ) const
Returns
string reference containing name of the field.
template<typename T >
T * fesa::AbstractField::getSlotPointer ( void *  baseAddress,
std::size_t  slot 
)
protected

Returns a pointer to the value at the address of the given slot.

Template Parameters
Tthe type to return
Parameters
baseAddressaddress where the field storage begins
slotthe slot to look for
Exceptions
FesaExceptionif slot is out of bounds
template<typename T >
const T * fesa::AbstractField::getSlotPointer ( const void *  baseAddress,
std::size_t  slot 
) const
protected

Returns a pointer to the value at the address of the given slot.

Template Parameters
Tthe type to return
Parameters
baseAddressaddress where the field storage begins
slotthe slot to look for
Exceptions
FesaExceptionif slot is out of bounds
FieldCategory fesa::AbstractField::getType ( ) const
Returns
the type of the field
virtual void fesa::AbstractField::getValueToStore ( int32_t  slot,
std::string &  str 
) const
protectedpure virtual
void fesa::AbstractField::initializeDefaultValue ( const std::string &  value)
protectedvirtual

Initialize the default value with a value provided in the instantiation file.

Parameters
valuethe serialized value

Reimplemented in fesa::FaultField< DataType >.

void fesa::AbstractField::initializeDimensions ( const boost::shared_ptr< FieldElement > &  fieldElement)
protectedvirtual

Used to initialize dimensions coming from the instantation.

Parameters
fieldElementthat 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
Returns
true if the field is multiplexed
bool fesa::AbstractField::isPersistent ( ) const
Returns
true if the field is persistent
bool fesa::AbstractField::isShared ( ) const
Returns
true if the field is shared between server and RT parts
void fesa::AbstractField::restore ( const PersistanceFieldElement &  fieldElement)
protected

gives the value to the field from the field element This method should be used to populate the fields at instantiation

Parameters
fieldelement with information extracted from the instantiation
virtual void fesa::AbstractField::setFieldValueAddress ( char *  pFV,
bool  initFieldsFlag 
)
protectedpure virtual
void fesa::AbstractField::setMultiplexingManager ( AbstractMultiplexingManager muxManager)
protected

changes the multiplexing manager of the field.

Parameters
muxManagerpointer to an already created multiplexing manager
void fesa::AbstractField::store ( PersistanceFieldElement &  fieldElement)
protected

Used to persist fields.

Parameters
fieldElementwith information extracted from the field
template<typename T >
void fesa::AbstractField::validateValue ( const T &  value) const
inlineprotected

Ensures that the given value is compatible with this field. Throws FesaException if not.

Parameters
valuethe value to check
template<typename T >
void fesa::AbstractField::validateValues ( const T *  values,
const std::size_t  count 
) const
inlineprotected

Ensures that the given values are compatible with this field. Throws FesaException if not.

Parameters
valuepointer to an array of values to check
countthe number of values in the array

Member Data Documentation

const std::size_t fesa::AbstractField::INVALID_SIZE = std::numeric_limits<std::size_t>::max()
static

Represents an invalid field size.


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