fesa-core  5.0.1
fesa::AbstractServerEquipment Class Reference

This class contains all the AbstractServerDeviceClass for the equipment and validates the requests from external clients. More...

#include <AbstractServerEquipment.h>

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

Public Member Functions

void initialize ()
 this method configures the equipment component
 
void start (RunMode runMode)
 this method starts the equipment More...
 
void shutDown ()
 Shut down the equipment component.
 
AbstractServerDeviceClassgetServerDeviceClass (const std::string &serverDeviceClass)
 
AbstractServerDeviceClassgetDeviceClassFromDeviceName (const std::string &devicename)
 this method searches and returns the class, which is responsible for the given device More...
 
void reportErrorToAllSubscribers (std::string Message)
 this method generates an Listener error for all subscribers of this equipment More...
 
AbstractServerControllergetServerController ()
 Returns the single reference of the Server Controller. More...
 
- Public Member Functions inherited from fesa::AbstractComponentEquipment
virtual void specificInit ()=0
 Custom initialization of the Equipment.
 
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.
 

Static Public Member Functions

static AbstractServerEquipmentgetInstance ()
 Singleton implementation.
 

Protected Member Functions

 AbstractServerEquipment ()
 Constructor.
 
virtual ~AbstractServerEquipment ()
 destructor
 
void signalHandlingLoop ()
 
- Protected Member Functions inherited from fesa::AbstractComponentEquipment
 AbstractComponentEquipment ()
 Constructor.
 
void mapEquipmentSharedMemory ()
 
void registerSettingFields (const std::vector< AbstractField * > &fields)
 
void setupSignalHandlers (const sigset_t &sigset) const
 
void waitForSignal (int &signo) const
 

Protected Attributes

boost::scoped_ptr
< AbstractServerController
serverController_
 controller configuration for the equipment
 
std::map< std::string,
AbstractDeviceClass * > 
deviceNameToClass_
 
- Protected Attributes inherited from fesa::AbstractComponentEquipment
std::vector
< AbstractDeviceClass * > 
abstractDeviceClassCol_
 contains the complete list of device classes
 
bool firstProcess_
 
void * equipmentSharedMemory_
 
std::size_t equipmentSharedMemorySize_
 

Static Protected Attributes

static AbstractServerEquipmenttheInstance_ = NULL
 the single instance
 

Detailed Description

This class contains all the AbstractServerDeviceClass for the equipment and validates the requests from external clients.

It also lets retrieve the devices by its name

Member Function Documentation

AbstractServerDeviceClass * fesa::AbstractServerEquipment::getDeviceClassFromDeviceName ( const std::string &  devicename)

this method searches and returns the class, which is responsible for the given device

Parameters
deviceDeviceNamae of the device
Returns
a ref to the AbstractServerDeviceClass, or NULL if not found
AbstractServerController * fesa::AbstractServerEquipment::getServerController ( )

Returns the single reference of the Server Controller.

Returns
pointer to the Server Controller
AbstractServerDeviceClass * fesa::AbstractServerEquipment::getServerDeviceClass ( const std::string &  serverDeviceClass)

Returns the AbstractServerDeviceClass whose name is passed by parameter

Parameters
serverDeviceClassname of the class to retrieve
Exceptions
FesaExceptionif class is not found
void fesa::AbstractServerEquipment::reportErrorToAllSubscribers ( std::string  Message)

this method generates an Listener error for all subscribers of this equipment

Parameters
MesssageThe error message
void fesa::AbstractServerEquipment::signalHandlingLoop ( )
protectedvirtual

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.

Implements fesa::AbstractComponentEquipment.

void fesa::AbstractServerEquipment::start ( RunMode  runMode)
virtual

this method starts the equipment

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

Implements fesa::AbstractComponentEquipment.

Member Data Documentation

std::map<std::string, AbstractDeviceClass*> fesa::AbstractServerEquipment::deviceNameToClass_
protected

Maps a device name to the class containing it. Used as a cache by getDeviceClassFromDeviceName().


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