fesa-core  5.0.1
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

Public Member Functions

DevInstType * getDevice (const std::string &deviceName) const
 this method retrieves the device instance by its name More...
 
DomainStoreType * getDomainStore (const std::string &domainStoreName) const
 this method retrieves the domain store instance by its name More...
 
GlobalDeviceType * getGlobalDevice () const
 this method retrieves the global-device instance More...
 
const std::vector< DevInstType * > & getDeviceCollection () const
 this method retrieves all concrete-devices More...
 
const std::vector
< DomainStoreType * > & 
getDomainStoreCollection () const
 this method retrieves all concrete-domain stores More...
 
 ~DeviceFactory ()
 destructor
 
- Public Member Functions inherited from fesa::AbstractDeviceFactory
virtual const std::vector
< AbstractDevice * > & 
getAbstractDeviceCollection () const
 this method retrieves all abstract devices More...
 
std::vector< AbstractDevice * > getDevices (const std::vector< std::string > &deviceNames) const
 Get the devices by their names. More...
 
virtual const std::vector
< DomainStore * > & 
getAbstractDomainStoreCollection () const
 this method retrieves all abstract domain-store More...
 

Protected Member Functions

 DeviceFactory (boost::shared_ptr< ClassElement > &instantiationXMLElementClass, const std::string &classVersion)
 Constructor. More...
 
- Protected Member Functions inherited from fesa::AbstractDeviceFactory
 AbstractDeviceFactory (const std::string &name, const std::string &version)
 

Static Protected Attributes

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

Additional Inherited Members

- Protected Attributes inherited from fesa::AbstractDeviceFactory
std::string className_
 class name of the abstract device factory
 
std::string classVersion_
 version of the abstract device factory
 
std::vector< AbstractDevice * > abstractDeviceCol_
 abstract device collection of the device factory
 
std::vector< DomainStore * > domainStoreCol_
 abstract domain-store collection of the device factory
 

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
GlobalDeviceTypeis the type of the concrete GlobalDevice class
DevInstTypeis the type of the concrete Device class
DomainStoreTypeis the type of the concrete DomainStore class

Constructor & Destructor Documentation

template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
fesa::DeviceFactory< GlobalDeviceType, DomainStoreType, DevInstType >::DeviceFactory ( boost::shared_ptr< ClassElement > &  instantiationXMLElementClass,
const std::string &  classVersion 
)
protected

Constructor.

Parameters
instantiationXMLElementClassC++ class-tree in order to access the class-specific data of the instantiation-file
classVersionthe version of the class to which the device factory belongs

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

Member Function Documentation

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

this method retrieves the device instance by its name

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

Implements fesa::AbstractDeviceFactory.

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

this method retrieves all concrete-devices

Returns
all devices
template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
DomainStoreType * fesa::DeviceFactory< GlobalDeviceType, DomainStoreType, DevInstType >::getDomainStore ( const std::string &  domainStoreName) const
inlinevirtual

this method retrieves the domain store instance by its name

Parameters
domainStoreNamethe name of the domain store
Returns
concrete domain store reference or NULL if the domain store is not found

Implements fesa::AbstractDeviceFactory.

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

this method retrieves all concrete-domain stores

Returns
all domain stores
template<typename GlobalDeviceType , typename DomainStoreType , typename DevInstType >
GlobalDeviceType * fesa::DeviceFactory< GlobalDeviceType, DomainStoreType, DevInstType >::getGlobalDevice ( ) const
inlinevirtual

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.


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