fesa::DeviceFactory< GlobalDeviceType, DomainStoreType, DevInstType > Class Template Reference

This class is responsible for the instantiation of all the devices, global-device and domain-store. The DeviceFactory is designed as a bridge pattern to allow sub-classing of the class interface (this one) and the class implementation (DeviceFactoryImp) separately. More...

#include <DeviceFactory.h>

Inheritance diagram for fesa::DeviceFactory< GlobalDeviceType, DomainStoreType, DevInstType >:
fesa::AbstractDeviceFactory

List of all members.

Public Member Functions

DevInstType * getDevice (const std::string &deviceName)
 this method retrieves the device instance by its name
GlobalDeviceType * getGlobalDevice ()
 this method retrieves the global-device instance
const std::vector< DevInstType * > & getDeviceCollection ()
 this method retrieves all concrete-devices
 ~DeviceFactory ()
 destructor

Protected Member Functions

 DeviceFactory (const std::string &className)
 Constructor.

Static Protected Attributes

static DeviceFactoryinstance_
 unique instance of the derived-class which will be a singleton

Private Attributes

DeviceFactoryImp
< GlobalDeviceType,
DomainStoreType, DevInstType > * 
imp_
 reference to device-factory implementation class, respecting the bridge design pattern

Detailed Description

template<typename GlobalDeviceType, typename DomainStoreType, typename DevInstType>
class fesa::DeviceFactory< GlobalDeviceType, DomainStoreType, DevInstType >

This class is responsible for the instantiation of all the devices, global-device and domain-store. The DeviceFactory is designed as a bridge pattern to allow sub-classing of the class interface (this one) and the class implementation (DeviceFactoryImp) separately.

Parameters:
GlobalDeviceType is the type of the concrete GlobalDevice class
DevInstType is the type of the concrete Device class
DomainStoreType is the type of the concrete DomainStore class

Definition at line 27 of file DeviceFactory.h.


Constructor & Destructor Documentation

template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
fesa::DeviceFactory< GlobalDeviceType, DomainStoreType, DevInstType >::~DeviceFactory< GlobalDeviceType, DomainStoreType, DevInstType > (  )  [inline]

destructor

template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
fesa::DeviceFactory< GlobalDeviceType, DomainStoreType, DevInstType >::DeviceFactory ( const std::string &  className  )  [inline, protected]

Constructor.

Parameters:
className name of the class that contains this device factory

The device-factory constructor is responsible to instantiate its implementation class.

Definition at line 81 of file DeviceFactory.h.

References fesa::AbstractEquipment::getInstance(), fesa::DeviceFactory< GlobalDeviceType, DomainStoreType, DevInstType >::imp_, fesa::AbstractDeviceFactory::pAbstractDeviceCol_, and fesa::unsplit.


Member Function Documentation

template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
DevInstType * fesa::DeviceFactory< GlobalDeviceType, DomainStoreType, DevInstType >::getDevice ( const std::string &  deviceName  )  [inline, virtual]

this method retrieves the device instance by its name

Parameters:
deviceName the name of the device
Returns:
concrete device reference or NULL if the device is not found

Implements fesa::AbstractDeviceFactory.

Definition at line 112 of file DeviceFactory.h.

References fesa::DeviceFactory< GlobalDeviceType, DomainStoreType, DevInstType >::imp_.

template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
const std::vector< DevInstType * > & fesa::DeviceFactory< GlobalDeviceType, DomainStoreType, DevInstType >::getDeviceCollection (  )  [inline]

this method retrieves all concrete-devices

Returns:
all devices

Definition at line 125 of file DeviceFactory.h.

References fesa::DeviceFactory< GlobalDeviceType, DomainStoreType, DevInstType >::imp_.

template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
GlobalDeviceType * fesa::DeviceFactory< GlobalDeviceType, DomainStoreType, DevInstType >::getGlobalDevice (  )  [inline, virtual]

this method retrieves the global-device instance

Returns:
concrete global-device reference or NULL if the device is not found. This last case is usual when having optional classes.

Implements fesa::AbstractDeviceFactory.

Definition at line 119 of file DeviceFactory.h.

References fesa::DeviceFactory< GlobalDeviceType, DomainStoreType, DevInstType >::imp_.


Member Data Documentation

template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
fesa::DeviceFactory< GlobalDeviceType, DomainStoreType, DevInstType >::imp_ [private]
template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
fesa::DeviceFactory< GlobalDeviceType, DomainStoreType, DevInstType >::instance_ [static, protected]

unique instance of the derived-class which will be a singleton

Definition at line 68 of file DeviceFactory.h.


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

Generated on 18 Jan 2013 for Fesa by  doxygen 1.6.1