fesa-core
7.0.0
|
Field template class for string arrays. More...
#include <FieldStringArray.h>
Public Types | |
typedef const char * | value_type |
data type stored in the field string array | |
Public Member Functions | |
FieldStringArray (const FieldConfig &fieldConfig, DataStore *pDataStore, std::size_t arrayLength, std::size_t stringLength) | |
Constructor. More... | |
void | getMaxSize (uint32_t &size1, uint32_t &size2) |
retrieve the size of the array More... | |
Public Member Functions inherited from fesa::AbstractField | |
virtual | ~AbstractField () |
destructor | |
AbstractMultiplexingManager * | getMultiplexingManager () |
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... | |
Protected Member Functions | |
std::size_t | getFieldValueSize () const |
std::size_t | getFieldValueAlignment () const |
std::size_t | getFieldValueDataOffset () const |
void | initializeDimensions (const boost::shared_ptr< FieldElement > &fieldElement) |
used to initialize dimensions of the field from the instance document More... | |
void | checkMaxDimension (std::size_t size) const |
this method checks whether the size passed by parameter is within the max size of the array. If it is not, the method throws a FesaException More... | |
void | setSize (FieldValueArray2D< char > &fieldValue, std::size_t size) const |
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... | |
FieldValueArray2D< char > * | getFieldValue (int32_t slot) |
Get the field's value for a given slot. More... | |
void | copyValue (uint32_t slot, const std::string &str) |
this method puts in the slot the value passed by parameter in the corresponding format More... | |
void | getValueToStore (int32_t slot, std::string &value) const |
void | setFieldValue (FieldValueArray2D< char > &fieldValue, const char *const *values, std::size_t count) |
const char * | getStringPointer (const FieldValueArray2D< char > &fieldValue, std::size_t index) const |
const char *const * | getStringPointers (const FieldValueArray2D< char > &fieldValue, std::size_t &count) const |
void | setStringValue (FieldValueArray2D< char > &fieldValue, const char *value, std::size_t index) |
const std::string | getString (const FieldValueArray2D< char > &fieldValue, std::size_t index) const |
const std::vector< std::string > | getStringVector (const FieldValueArray2D< char > &fieldValue) const |
void | setStringValues (FieldValueArray2D< char > &fieldValue, const std::vector< std::string > &values) |
void | setStringValue (FieldValueArray2D< char > &fieldValue, const std::string &value, std::size_t index) |
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... | |
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 | |
std::size_t | maxSize1_ |
first dimension of the array | |
std::size_t | maxSize2_ |
second dimension of the array. Maximum size of a string | |
FieldValueArray2D< char > * | fieldValue_ |
value of the field | |
std::map< const void *, std::vector< const char * > > | pointers_ |
Mutex | pointersMutex_ |
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 | |
AbstractMultiplexingManager * | multiplexingManager_ |
multiplexing manager of the field | |
DataStore * | dataStore_ |
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() |
Field template class for string arrays.
fesa::FieldStringArray::FieldStringArray | ( | const FieldConfig & | fieldConfig, |
DataStore * | pDataStore, | ||
std::size_t | arrayLength, | ||
std::size_t | stringLength | ||
) |
Constructor.
name | of the field, field category, multiplexing criterion, pointer to DataStore |
|
protected |
this method checks whether the size passed by parameter is within the max size of the array. If it is not, the method throws a FesaException
FesaException |
|
protectedvirtual |
this method puts in the slot the value passed by parameter in the corresponding format
slot | to put the value |
val | value to put |
Implements fesa::AbstractField.
|
protectedvirtual |
Get the field's value for a given slot.
slot | The slot to get the field's value from |
Implements fesa::AbstractField.
|
protectedvirtual |
Returns the alignment requirement of a FieldValue instantiated by this AbstractField object.
Implements fesa::AbstractField.
|
protectedvirtual |
Returns the offset from the beginning of the field value object to the data contained in the field value.
Implements fesa::AbstractField.
|
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.
void fesa::FieldStringArray::getMaxSize | ( | uint32_t & | size1, |
uint32_t & | size2 | ||
) |
retrieve the size of the array
size1 | first dimension of the array |
size2 | second dimension of the array |
|
protected |
Returns the string at the given index.
|
protected |
Returns a pointer to the string at the given index.
|
protected |
Returns an array of pointers to the strings of the given fieldValue.
|
protected |
Returns all the string of the filedValue
|
protectedvirtual |
Implements fesa::AbstractField.
|
protectedvirtual |
used to initialize dimensions of the field from the instance document
fieldElement | that contains the values for the field |
Reimplemented from fesa::AbstractField.
|
protected |
Copies the given strings to the fieldValue.
fieldValue | the destination field value |
values | the strings to copy |
count | number of strings to copy |
|
protectedvirtual |
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. |
Implements fesa::AbstractField.
|
protected |
Checks and sets the current size of fieldValue.
fieldValue | |
size |
FesaException | if size is greater than the maximum size of this field. |
|
protected |
Copies the given string to the fieldValue at the given index.
|
protected |
Copies the given string to the fieldValue at the given index.
|
protected |
Copies all the given strings to the fieldValue.
|
mutableprotected |
Maps slots (by their address) to a vector of c-style strings.
|
protected |
Protects access to the pointers_ map.