fesa-core  4.0.0
fesa::AbstractComponentEquipment Class Referenceabstract

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>

Inheritance diagram for fesa::AbstractComponentEquipment:
fesa::AbstractRTEquipment fesa::AbstractServerEquipment

Public Member Functions

virtual void initialize ()
 This method configures the equipment component and calls the initialize method of all the classes registered in it.
 
virtual void specificInit ()=0
 Custom initialization of the Equipment.
 
virtual void start (RunMode runMode)=0
 This method starts the component equipment. More...
 
virtual void shutDown ()
 Shut down the equipment component.
 
const std::vector
< AbstractDeviceClass * > & 
getDeviceClassCol ()
 This method returns all abstract device classes, managed by this equipment. More...
 
AbstractDeviceClassgetDeviceClass (const std::string &className)
 This method returns a pointer to the requested abstract device class. More...
 
const std::string & getServerName ()
 This method returns the server name. More...
 
void registerDeviceClass (AbstractDeviceClass *abstractDeviceClass)
 This method registers abstract device class in vector abstractDeviceClassCol_. More...
 
void deregisterDeviceClass (const std::string &className)
 this method removes the abstract class passed by parameter from vector abstractDeviceClassCol_ More...
 
bool isFirstProcess () const
 
virtual ~AbstractComponentEquipment ()
 Destructor.
 

Protected Member Functions

 AbstractComponentEquipment ()
 Constructor.
 
void mapEquipmentSharedMemory ()
 
void registerSettingFields (const std::vector< AbstractField * > &fields)
 
virtual void waitSignal ()=0
 Blocking call that waits for and treats signals.
 

Protected Attributes

std::vector
< AbstractDeviceClass * > 
abstractDeviceClassCol_
 contains the complete list of device classes
 
bool firstProcess_
 
void * equipmentSharedMemory_
 
std::size_t equipmentSharedMemorySize_
 

Detailed Description

This class is an abstraction of the components of an equipment. It contains common services shared by both the server and real time parts.

Member Function Documentation

void fesa::AbstractComponentEquipment::deregisterDeviceClass ( const std::string &  className)

this method removes the abstract class passed by parameter from vector abstractDeviceClassCol_

Parameters
classNamethe 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
classNamethe name of the class we are looking for
Returns
AbstractDeviceClass reference if device class is found; otherwise NULL
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
abstractDeviceClassThe 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
fieldsvector of fields. Can contain any type of field.
virtual void fesa::AbstractComponentEquipment::start ( RunMode  runMode)
pure virtual

This method starts the component equipment.

Parameters
runModeindicates if thread should block on this call or keep run

Implemented in fesa::AbstractRTEquipment, and fesa::AbstractServerEquipment.

Member Data Documentation

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: