fesa-core  7.0.0
fesa::Field< T > Class Template Reference

Field template class for scalar fields. More...

#include <Field.h>

Inheritance diagram for fesa::Field< T >:
fesa::AbstractField fesa::AcqFieldScalar< T > fesa::ConfigFieldScalar< T > fesa::GenericFieldScalar< T > fesa::SettingFieldScalar< T >

Public Types

typedef T value_type
 data type stored in the field
 

Public Member Functions

 Field (const FieldConfig &fieldConfig, DataStore *pDataStore)
 Constructor. More...
 
 ~Field ()
 destructor
 
- 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
 
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 Member Functions

static T valueFromString (const std::string &s)
 

Protected Member Functions

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...
 
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
 
- 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
 
virtual void getAttributeValueToStore (int32_t slot, const std::string &attribute, std::string &str)
 
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

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
 

Additional Inherited Members

- Static Public Attributes inherited from fesa::AbstractField
static const std::size_t INVALID_SIZE = std::numeric_limits<std::size_t>::max()
 

Detailed Description

template<typename T>
class fesa::Field< T >

Field template class for scalar fields.

Constructor & Destructor Documentation

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

Constructor.

Parameters
nameof the field, field category, multiplexing criterion, pointer to DataStore

Member Function Documentation

template<typename T >
void fesa::Field< T >::copyValue ( uint32_t  slot,
const std::string &  val 
)
protectedvirtual

this method puts in the slot the value passed by parameter in the corresponding format

Parameters
slotto put the value
valvalue to put

Implements fesa::AbstractField.

template<typename T >
FieldValue< T > * fesa::Field< T >::getFieldValue ( int32_t  slot)
protectedvirtual

Get the field's value for a given slot.

Parameters
slotThe slot to get the field's value from
Returns
The field's value

Implements fesa::AbstractField.

template<typename T >
std::size_t fesa::Field< T >::getFieldValueAlignment ( ) const
protectedvirtual

Returns the alignment requirement of a FieldValue instantiated by this AbstractField object.

Implements fesa::AbstractField.

template<typename T >
std::size_t fesa::Field< T >::getFieldValueDataOffset ( ) const
protectedvirtual

Returns the offset from the beginning of the field value object to the data contained in the field value.

Implements fesa::AbstractField.

template<typename T >
std::size_t fesa::Field< T >::getFieldValueSize ( ) const
protectedvirtual

Returns the size (in bytes) of a field value instantiated by this AbstractField object. This includes the FieldValue object itself, and any additional space needed for data storage.

Implements fesa::AbstractField.

template<typename T >
void fesa::Field< T >::getValueToStore ( int32_t  slot,
std::string &  str 
) const
protectedvirtual
Returns
the field's value as a string

Implements fesa::AbstractField.

template<typename T >
void fesa::Field< T >::setFieldValueAddress ( char *  pFV,
bool  initFieldsFlag 
)
protectedvirtual

Maps an address in shared memory or on the heap to the field value member of the field class.

Parameters
pFVpointer to a field value.

Implements fesa::AbstractField.

template<typename T >
T fesa::Field< T >::valueFromString ( const std::string &  s)
static

Returns the value represented by the given string.

Exceptions
FesaExceptionif the string contains an invalid representation.

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