MachineIntelligenceCore:Toolchain
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
mic::application::ApplicationFactory Class Reference

Application factory, class responsible for generation of an application object. Defined in the form of a singleton, with double-checked locking pattern (DCLP) based access to instance. More...

#include <ApplicationFactory.hpp>

Inheritance diagram for mic::application::ApplicationFactory:
Collaboration diagram for mic::application::ApplicationFactory:

Public Member Functions

virtual ~ApplicationFactory ()
 
template<class AppType >
void RegisterFactory ()
 
mic::application::Applicationcreate (std::string app_name_)
 
- Public Member Functions inherited from mic::application::FactoryInterface
virtual ~FactoryInterface ()
 

Static Public Member Functions

static ApplicationFactorygetInstance ()
 

Private Member Functions

 ApplicationFactory ()
 

Private Attributes

FactoryInterfaceinternal_factory
 "Internal factory", responsible for returning of classes of different objects (applications). More...
 

Static Private Attributes

static boost::atomic
< ApplicationFactory * > 
instance_
 
static boost::mutex instantiation_mutex
 

Detailed Description

Application factory, class responsible for generation of an application object. Defined in the form of a singleton, with double-checked locking pattern (DCLP) based access to instance.

Author
tkornuta

Definition at line 90 of file ApplicationFactory.hpp.

Constructor & Destructor Documentation

mic::application::ApplicationFactory::~ApplicationFactory ( )
virtual

Destructor. Empty.

Definition at line 62 of file ApplicationFactory.cpp.

mic::application::ApplicationFactory::ApplicationFactory ( )
private

Constructor. Sets internal factory pointer to null.

Definition at line 57 of file ApplicationFactory.cpp.

References internal_factory.

Referenced by getInstance().

Member Function Documentation

mic::application::Application* mic::application::ApplicationFactory::create ( std::string  app_name_)
inlinevirtual

Method responsible for run time specified object creation - calls internal factory to do this job.

Parameters
app_name_Name of the application.
Returns
Application of a given, template type.

Implements mic::application::FactoryInterface.

Definition at line 120 of file ApplicationFactory.hpp.

References mic::application::FactoryInterface::create(), and internal_factory.

Here is the call graph for this function:

ApplicationFactory * mic::application::ApplicationFactory::getInstance ( )
static

Method for accessing the object instance, with double-checked locking optimization.

Returns
Instance of ApplicationState singleton.

Definition at line 36 of file ApplicationFactory.cpp.

References ApplicationFactory(), instance_, and instantiation_mutex.

Here is the call graph for this function:

template<class AppType >
void mic::application::ApplicationFactory::RegisterFactory ( )
inline

Template method responsible for registration of an "internal application factory".

Template Parameters
AppTypeTemplate parameter denoting the application type.

Definition at line 108 of file ApplicationFactory.hpp.

References internal_factory.

Member Data Documentation

boost::atomic< ApplicationFactory * > mic::application::ApplicationFactory::instance_
staticprivate

Private instance - accessed as atomic operation.

Definition at line 131 of file ApplicationFactory.hpp.

Referenced by getInstance().

boost::mutex mic::application::ApplicationFactory::instantiation_mutex
staticprivate

Mutex used for instantiation of the instance.

Definition at line 136 of file ApplicationFactory.hpp.

Referenced by getInstance().

FactoryInterface* mic::application::ApplicationFactory::internal_factory
private

"Internal factory", responsible for returning of classes of different objects (applications).

Definition at line 145 of file ApplicationFactory.hpp.

Referenced by ApplicationFactory(), create(), and RegisterFactory().


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