This class is an abstraction of the components of an equipment. It contains common services shared by both the server and real time parts.
More...
#include <AbstractComponentEquipment.h>
This class is an abstraction of the components of an equipment. It contains common services shared by both the server and real time parts.
void fesa::AbstractComponentEquipment::deregisterDeviceClass |
( |
const std::string & |
className | ) |
|
this method removes the abstract class passed by parameter from vector abstractDeviceClassCol_
- Parameters
-
className | the name of the class to deregister |
AbstractDeviceClass * fesa::AbstractComponentEquipment::getDeviceClass |
( |
const std::string & |
className | ) |
|
This method returns a pointer to the requested abstract device class.
- Parameters
-
className | the name of the class we are looking for |
- Returns
- AbstractDeviceClass reference if device class is found
- Exceptions
-
const std::vector< AbstractDeviceClass * > & fesa::AbstractComponentEquipment::getDeviceClassCol |
( |
| ) |
|
|
inline |
This method returns all abstract device classes, managed by this equipment.
- Returns
- a vector of device class pointers
const std::string & fesa::AbstractComponentEquipment::getServerName |
( |
| ) |
|
This method returns the server name.
- Returns
- server-name
bool fesa::AbstractComponentEquipment::isFirstProcess |
( |
| ) |
const |
- Returns
- true if the process running this component is the first to run; false otherwise. In mixed mode or single process mode, true if this component was the first to be instantiated; false otherwise. In split mode, true if the process running this component was the first to run; false otherwise. In split mode, this can be used to decide whether to initialize the shared memory or just attach to it.
void fesa::AbstractComponentEquipment::mapEquipmentSharedMemory |
( |
| ) |
|
|
protected |
Maps the equipment (DU) shared memory. If this is the first process, the shared memory will be created; otherwise it will be attached.
void fesa::AbstractComponentEquipment::registerDeviceClass |
( |
AbstractDeviceClass * |
abstractDeviceClass | ) |
|
|
inline |
This method registers abstract device class in vector abstractDeviceClassCol_.
- Parameters
-
abstractDeviceClass | The class we want to register |
void fesa::AbstractComponentEquipment::registerSettingFields |
( |
const std::vector< AbstractField * > & |
fields | ) |
|
|
protected |
Helper method which iterates over a vector of fields, and registers those of them which are shared setting fields.
- Parameters
-
fields | vector of fields. Can contain any type of field. |
void fesa::AbstractComponentEquipment::setupSignalHandlers |
( |
const sigset_t & |
sigset | ) |
const |
|
protected |
Sets signal handlers for all signals that can be processed, and creates necessary objects to handle signals. Signals in sigset_t can later be handled by calling waitForSignal(). This method must be called only once in the whole process, otherwise results are unexpected.
- Parameters
-
sigset | list of signals for which a handler must be set. |
- Exceptions
-
virtual void fesa::AbstractComponentEquipment::signalHandlingLoop |
( |
| ) |
|
|
protectedpure virtual |
Waits for and treats signals. Never returns, unless a non-fatal terminating signal has been received by the process, to let it shutdown gracefully. Non-fatal terminating signals are: SIGINT, SIGTERM, SIGHUP.
Implemented in fesa::AbstractRTEquipment, and fesa::AbstractServerEquipment.
virtual void fesa::AbstractComponentEquipment::start |
( |
RunMode |
runMode | ) |
|
|
pure virtual |
Starts the component equipment. This method can only be called only once with blocking runMode, otherwise results are unexpected (static objects are used for signal handling). If runMode is nonBlocking, this method returns immediately. If runMode is blocking:
- This method never returns, unless a non-fatal terminating signal has been received by the process, to let it shutdown gracefully.
- Non-fatal terminating signals are: SIGINT, SIGTERM, SIGHUP.
Implemented in fesa::AbstractRTEquipment, and fesa::AbstractServerEquipment.
void fesa::AbstractComponentEquipment::waitForSignal |
( |
int & |
signo | ) |
const |
|
protected |
Waits for a signal for which a handler has been previously set using setupSignalHandlers(). Stores the signal number in signo.
- Exceptions
-
void* fesa::AbstractComponentEquipment::equipmentSharedMemory_ |
|
protected |
Pointer to the base of the equipment shared memory.
std::size_t fesa::AbstractComponentEquipment::equipmentSharedMemorySize_ |
|
protected |
Size of the equipment shared memory.
bool fesa::AbstractComponentEquipment::firstProcess_ |
|
protected |
In mixed mode or single process mode, true if this component was the first to be instantiated; false otherwise. In split mode, true if the process running this component was the first to run; false otherwise.
The documentation for this class was generated from the following files:
- AbstractComponentEquipment.h
- AbstractComponentEquipment.cpp