fesa-core  5.0.1
fesa::FaultField< DataType > Class Template Reference

A specialized field for faults. This type of field is meant to indicate a fault or a problem in the system. It is a template class that can accept the FaultField_DataType type or its derived types as the template parameter. More...

#include <FaultField.h>

Inheritance diagram for fesa::FaultField< DataType >:
fesa::GenericFieldStruct< DataType > fesa::FieldStruct< DataType > fesa::AbstractField

Classes

class  PropertyNotifier
 Raising and lowering a fault field may automatically notify some lab-defined properties that display information about faults. Lowering a fault field should notify the properties whose get server actions were disabled by this field. More...
 

Public Member Functions

 FaultField (const FieldConfig &fieldConfig, DataStore *dataStore, const std::string &description, FaultSeverity::FaultSeverity severity, const OnFaultNotificationConfig &onFaultNotificationConfig)
 Constructor. More...
 
void initializeDefaultValue (const std::string &value)
 Initialize the default value with a value provided in the instantiation file. More...
 
- Public Member Functions inherited from fesa::GenericFieldStruct< DataType >
 GenericFieldStruct (const FieldConfig &fieldConfig, DataStore *pDataStore)
 Constructor. More...
 
 ~GenericFieldStruct ()
 destructor
 
const DataType * get (const MultiplexingContext *) const
 Method to retrieve the value of the field. More...
 
fesa::wrappers::PointerWrapper
< DataType,
fesa::FieldCallback
getMutable (const MultiplexingContext *context)
 
void set (const DataType *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...
 
- Public Member Functions inherited from fesa::AbstractFaultField
virtual void raise (int64_t time, const MultiplexingContext *context, int32_t errorCode=0)=0
 Raise a fault explicitly supplying its time of occurrence. If the fault field is already raised, the call will not do anything. More...
 
virtual void raise (const MultiplexingContext *context, int32_t errorCode=0)=0
 Raise a fault. The time of occurrence will be set to the current time during the call. If the fault field is already raised, the call will not do anything. More...
 
virtual void lower (int64_t time, const MultiplexingContext *context)=0
 Lower the fault explicitly supplying its time of disappearance. If the fault field is not raised, the call will not do anything. More...
 
virtual void lower (const MultiplexingContext *context)=0
 Lower the fault. The time of disappearance will be set to the current time during the call. If the fault field is not raised, the call will not do anything. More...
 
virtual void setState (bool raised, int64_t time, const MultiplexingContext *context, int32_t errorCode=0)=0
 Set the state of the fault explicitly supplying its time of occurrence/disappearance. If the new state is the same as the previous one, the call will not do anything. More...
 
virtual void setState (bool raised, const MultiplexingContext *context, int32_t errorCode=0)=0
 Set the state of the fault. The time of occurrence/disappearance will be set to the current time during the call. If the new state is the same as the previous one, the call will not do anything. More...
 
virtual bool isRaised (const MultiplexingContext *context) const =0
 Get the fault's state. More...
 
virtual
FaultSeverity::FaultSeverity 
getSeverity () const =0
 Get the severity of the fault.
 
virtual std::string getDescription () const =0
 Get the description of the fault.
 
virtual int64_t getTimestamp (const MultiplexingContext *context) const =0
 Get the timestamp of the last change of the fault's state (the time of occurrence/disappearance of the fault) More...
 

Protected Member Functions

void initializeSeverity (const std::string &value)
 Initialize the severity with a value provided in the instantiation file. More...
 
virtual void setFieldValueAddress (char *fieldValueAddress, bool initFieldsFlag)
 Maps an address in shared memory or on the heap to the field value member of the field class. More...
 
- Protected Member Functions inherited from fesa::FieldStruct< DataType >
std::size_t getFieldValueSize () const
 Method to get the size of the field-value object. The template of the field-value class depends on the field type. More...
 
FieldValue< DataType > * getFieldValue (int32_t slot)
 Get the field's value for a given slot. 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 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
 
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
 

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 Attributes inherited from fesa::FieldStruct< DataType >
FieldValue< DataType > * 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 DataType>
class fesa::FaultField< DataType >

A specialized field for faults. This type of field is meant to indicate a fault or a problem in the system. It is a template class that can accept the FaultField_DataType type or its derived types as the template parameter.

Constructor & Destructor Documentation

template<typename DataType >
fesa::FaultField< DataType >::FaultField ( const FieldConfig fieldConfig,
DataStore dataStore,
const std::string &  description,
FaultSeverity::FaultSeverity  severity,
const OnFaultNotificationConfig onFaultNotificationConfig 
)

Constructor.

Parameters
fieldConfigThe field's configuration
dataStoreThe data store the field belongs to
descriptionThe fault's description
severityThe fault's severity
onFaultNotificationConfigData needed to notify the properties on the fault's raise or lower

Member Function Documentation

template<typename DataType >
void fesa::FaultField< DataType >::initializeDefaultValue ( const std::string &  value)
virtual

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

Parameters
valuethe serialized value

Reimplemented from fesa::AbstractField.

template<typename DataType >
void fesa::FaultField< DataType >::initializeSeverity ( const std::string &  value)
protected

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

Parameters
valueThe value of the field containing the severity value
template<typename DataType >
void fesa::FaultField< DataType >::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.

Reimplemented from fesa::FieldStruct< DataType >.


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