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

Class for a factory to create concrete class instances without parameters during construction. More...

#include <pfactory.h>

Inheritance diagram for PFactory< AbstractClass, KeyType >:
Collaboration diagram for PFactory< AbstractClass, KeyType >:

Classes

class  Worker
 

Public Types

typedef PFactoryTemplate
< AbstractClass, const KeyType
&, KeyType > 
Base_T
 
typedef Base_T::WorkerBase WorkerBase_T
 
typedef Base_T::Abstract_T Abstract_T
 
typedef Base_T::Param_T Param_T
 
typedef Base_T::Key_T Key_T
 
- Public Types inherited from PFactoryTemplate< AbstractClass, const KeyType &, KeyType >
typedef AbstractClass Abstract_T
 
typedef const KeyType & Param_T
 
typedef KeyType Key_T
 
typedef std::vector< Key_TKeyList_T
 
typedef std::map< Key_T,
WorkerWrap > 
WorkerMap_T
 
typedef WorkerMap_T::iterator WorkerIter_T
 

Public Member Functions

 PFACTORY_STATICS (PFactory)
 
- Public Member Functions inherited from PFactoryTemplate< AbstractClass, const KeyType &, KeyType >
virtual void DestroySingletons ()
 
- Public Member Functions inherited from PFactoryBase
virtual ~PFactoryBase ()
 

Static Public Member Functions

static Abstract_TCreateInstance (const Key_T &key)
 
template<class Derived_T >
static Derived_T * CreateInstanceAs (const Key_T &key)
 
- Static Public Member Functions inherited from PFactoryBase
static FactoryMapGetFactories ()
 

Additional Inherited Members

- Protected Member Functions inherited from PFactoryTemplate< AbstractClass, const KeyType &, KeyType >
 PFactoryTemplate ()
 
 ~PFactoryTemplate ()
 
bool InternalRegister (const Key_T &key, WorkerBase *worker, bool autoDeleteWorker)
 
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 ()
 
 PDECLARE_MUTEX (m_mutex,"PFactoryBase")
 
- 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 ()
 
- Protected Attributes inherited from PFactoryTemplate< AbstractClass, const KeyType &, KeyType >
WorkerMap_T m_workers
 

Detailed Description

template<class AbstractClass, typename KeyType = PDefaultPFactoryKey>
class PFactory< AbstractClass, KeyType >

Class for a factory to create concrete class instances without parameters during construction.

Member Typedef Documentation

template<class AbstractClass , typename KeyType = PDefaultPFactoryKey>
typedef Base_T::Abstract_T PFactory< AbstractClass, KeyType >::Abstract_T
template<class AbstractClass , typename KeyType = PDefaultPFactoryKey>
typedef PFactoryTemplate<AbstractClass, const KeyType &, KeyType> PFactory< AbstractClass, KeyType >::Base_T
template<class AbstractClass , typename KeyType = PDefaultPFactoryKey>
typedef Base_T::Key_T PFactory< AbstractClass, KeyType >::Key_T
template<class AbstractClass , typename KeyType = PDefaultPFactoryKey>
typedef Base_T::Param_T PFactory< AbstractClass, KeyType >::Param_T
template<class AbstractClass , typename KeyType = PDefaultPFactoryKey>
typedef Base_T::WorkerBase PFactory< AbstractClass, KeyType >::WorkerBase_T

Member Function Documentation

template<class AbstractClass , typename KeyType = PDefaultPFactoryKey>
static Abstract_T* PFactory< AbstractClass, KeyType >::CreateInstance ( const Key_T key)
inlinestatic
template<class AbstractClass , typename KeyType = PDefaultPFactoryKey>
template<class Derived_T >
static Derived_T* PFactory< AbstractClass, KeyType >::CreateInstanceAs ( const Key_T key)
inlinestatic
template<class AbstractClass , typename KeyType = PDefaultPFactoryKey>
PFactory< AbstractClass, KeyType >::PFACTORY_STATICS ( PFactory< AbstractClass, KeyType >  )

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