IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Public Member Functions | Static Public Member Functions | Protected Types | Protected Attributes | List of all members
ipsdk::DynamicObjectFactory Class Reference

Factory singleton allowing dynamic creation of registred objects. More...

#include <DynamicObjectFactory.h>

Inheritance diagram for ipsdk::DynamicObjectFactory:

Public Member Functions

bool isRegistredClass (const std::string &className) const
 test if a given class is already registred
 
void registerClass (const std::string &className, DynamicNewObjectCreator newObjectCreator, DynamicSharedObjectCreator sharedObjectCreator)
 register new class into factory More...
 
void unRegisterClass (const std::string &className)
 un register an existing class from factory More...
 
BaseDynamicObjectcreateNewObject (const std::string &className) const
 create new instance of a registered class More...
 
DynamicObjectPtr createSharedObject (const std::string &className) const
 create shared instance of a registered class More...
 

Static Public Member Functions

static DynamicObjectFactorygetInstance ()
 retrieve unique instance of factory
 

Protected Types

typedef std::pair< DynamicNewObjectCreator, DynamicSharedObjectCreatorDynamicObjectCreator
 pair of function pointers allowing to create new and shared dynamic objects
 
typedef std::map< std::string, DynamicObjectCreatorFactoryMap
 typedef for string associated to dynamic object creation function
 

Protected Member Functions

Constructors and destructors
 DynamicObjectFactory ()
 
 ~DynamicObjectFactory ()
 

Protected Attributes

FactoryMap _factoryMap
 map storing string to creation function association
 

Detailed Description

Factory singleton allowing dynamic creation of registred objects.

Author
E. Noirfalise
Date
2013/2/15

Member Function Documentation

◆ registerClass()

void ipsdk::DynamicObjectFactory::registerClass ( const std::string &  className,
DynamicNewObjectCreator  newObjectCreator,
DynamicSharedObjectCreator  sharedObjectCreator 
)

register new class into factory

Exceptions
ipsdk::IPSDKUtilExceptionif isRegistredClass(className) == true

◆ unRegisterClass()

void ipsdk::DynamicObjectFactory::unRegisterClass ( const std::string &  className)

un register an existing class from factory

Exceptions
ipsdk::IPSDKUtilExceptionif isRegistredClass(className) == false

◆ createNewObject()

BaseDynamicObject* ipsdk::DynamicObjectFactory::createNewObject ( const std::string &  className) const

create new instance of a registered class

Exceptions
ipsdk::IPSDKUtilExceptionif isRegistred(className) == false

◆ createSharedObject()

DynamicObjectPtr ipsdk::DynamicObjectFactory::createSharedObject ( const std::string &  className) const

create shared instance of a registered class

Exceptions
ipsdk::IPSDKUtilExceptionif isRegistred(className) == false

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