PTLib  Version 2.14.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PFactoryTemplate< AbstractClass, ParamType, KeyType > Class Template Reference

Template class for generic factories of an abstract class. More...

#include <pfactory.h>

Inheritance diagram for PFactoryTemplate< AbstractClass, ParamType, KeyType >:
Collaboration diagram for PFactoryTemplate< AbstractClass, ParamType, KeyType >:

Classes

class  WorkerBase
 

Public Types

typedef AbstractClass Abstract_T
 
typedef ParamType Param_T
 
typedef KeyType Key_T
 
typedef std::vector< Key_TKeyList_T
 
typedef std::map< Key_T,
WorkerBase * > 
WorkerMap_T
 
typedef WorkerMap_T::iterator WorkerIter_T
 

Public Member Functions

virtual void DestroySingletons ()
 
- Public Member Functions inherited from PFactoryBase
virtual ~PFactoryBase ()
 

Protected Member Functions

 PFactoryTemplate ()
 
 ~PFactoryTemplate ()
 
bool InternalRegister (const Key_T &key, WorkerBase *worker)
 
bool InternalRegister (const Key_T &key, Abstract_T *instance, bool autoDeleteInstance)
 
PBoolean InternalRegisterAs (const Key_T &newKey, const Key_T &oldKey)
 
void InternalUnregister (const Key_T &key)
 
void InternalUnregister (WorkerBase *instance)
 
void InternalUnregisterAll ()
 
bool InternalIsRegistered (const Key_T &key)
 
Abstract_TInternalCreateInstance (const Key_T &key, Param_T param)
 
void InternalDestroy (const Key_T &key, Abstract_T *instance)
 
bool InternalIsSingleton (const Key_T &key)
 
KeyList_T InternalGetKeyList ()
 
- Protected Member Functions inherited from PFactoryBase
 PFactoryBase ()
 

Protected Attributes

WorkerMap_T m_workers
 
- Protected Attributes inherited from PFactoryBase
PMutex m_mutex
 

Additional Inherited Members

- Static Public Member Functions inherited from PFactoryBase
static FactoryMapGetFactories ()
 
- Static Protected Member Functions inherited from PFactoryBase
static PFactoryBaseInternalGetFactory (const std::string &className, PFactoryBase *(*createFactory)())
 
template<class TheFactory >
static PFactoryBaseCreateFactory ()
 
template<class TheFactory >
static TheFactory & GetFactoryAs ()
 

Detailed Description

template<class AbstractClass, typename ParamType, typename KeyType>
class PFactoryTemplate< AbstractClass, ParamType, KeyType >

Template class for generic factories of an abstract class.

Member Typedef Documentation

template<class AbstractClass, typename ParamType, typename KeyType>
typedef AbstractClass PFactoryTemplate< AbstractClass, ParamType, KeyType >::Abstract_T
template<class AbstractClass, typename ParamType, typename KeyType>
typedef KeyType PFactoryTemplate< AbstractClass, ParamType, KeyType >::Key_T
template<class AbstractClass, typename ParamType, typename KeyType>
typedef std::vector<Key_T> PFactoryTemplate< AbstractClass, ParamType, KeyType >::KeyList_T
template<class AbstractClass, typename ParamType, typename KeyType>
typedef ParamType PFactoryTemplate< AbstractClass, ParamType, KeyType >::Param_T
template<class AbstractClass, typename ParamType, typename KeyType>
typedef WorkerMap_T::iterator PFactoryTemplate< AbstractClass, ParamType, KeyType >::WorkerIter_T
template<class AbstractClass, typename ParamType, typename KeyType>
typedef std::map<Key_T, WorkerBase*> PFactoryTemplate< AbstractClass, ParamType, KeyType >::WorkerMap_T

Constructor & Destructor Documentation

template<class AbstractClass, typename ParamType, typename KeyType>
PFactoryTemplate< AbstractClass, ParamType, KeyType >::PFactoryTemplate ( )
inlineprotected
template<class AbstractClass, typename ParamType, typename KeyType>
PFactoryTemplate< AbstractClass, ParamType, KeyType >::~PFactoryTemplate ( )
inlineprotected

Member Function Documentation

template<class AbstractClass, typename ParamType, typename KeyType>
virtual void PFactoryTemplate< AbstractClass, ParamType, KeyType >::DestroySingletons ( )
inlinevirtual
template<class AbstractClass, typename ParamType, typename KeyType>
Abstract_T* PFactoryTemplate< AbstractClass, ParamType, KeyType >::InternalCreateInstance ( const Key_T key,
Param_T  param 
)
inlineprotected
template<class AbstractClass, typename ParamType, typename KeyType>
void PFactoryTemplate< AbstractClass, ParamType, KeyType >::InternalDestroy ( const Key_T key,
Abstract_T instance 
)
inlineprotected
template<class AbstractClass, typename ParamType, typename KeyType>
KeyList_T PFactoryTemplate< AbstractClass, ParamType, KeyType >::InternalGetKeyList ( )
inlineprotected
template<class AbstractClass, typename ParamType, typename KeyType>
bool PFactoryTemplate< AbstractClass, ParamType, KeyType >::InternalIsRegistered ( const Key_T key)
inlineprotected
template<class AbstractClass, typename ParamType, typename KeyType>
bool PFactoryTemplate< AbstractClass, ParamType, KeyType >::InternalIsSingleton ( const Key_T key)
inlineprotected
template<class AbstractClass, typename ParamType, typename KeyType>
bool PFactoryTemplate< AbstractClass, ParamType, KeyType >::InternalRegister ( const Key_T key,
WorkerBase worker 
)
inlineprotected
template<class AbstractClass, typename ParamType, typename KeyType>
bool PFactoryTemplate< AbstractClass, ParamType, KeyType >::InternalRegister ( const Key_T key,
Abstract_T instance,
bool  autoDeleteInstance 
)
inlineprotected
template<class AbstractClass, typename ParamType, typename KeyType>
PBoolean PFactoryTemplate< AbstractClass, ParamType, KeyType >::InternalRegisterAs ( const Key_T newKey,
const Key_T oldKey 
)
inlineprotected
template<class AbstractClass, typename ParamType, typename KeyType>
void PFactoryTemplate< AbstractClass, ParamType, KeyType >::InternalUnregister ( const Key_T key)
inlineprotected
template<class AbstractClass, typename ParamType, typename KeyType>
void PFactoryTemplate< AbstractClass, ParamType, KeyType >::InternalUnregister ( WorkerBase instance)
inlineprotected
template<class AbstractClass, typename ParamType, typename KeyType>
void PFactoryTemplate< AbstractClass, ParamType, KeyType >::InternalUnregisterAll ( )
inlineprotected

Member Data Documentation


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