Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

PFactory< _Abstract_T, _Key_T > Class Template Reference

#include <pfactory.h>

Inheritance diagram for PFactory< _Abstract_T, _Key_T >:

PFactoryBase

List of all members.


Detailed Description

template<class _Abstract_T, typename _Key_T = PString>
class PFactory< _Abstract_T, _Key_T >

Template class for generic factories of an abstract class.

Definition at line 208 of file pfactory.h.


Public Types

typedef _Abstract_T Abstract_T
typedef _Key_T Key_T
typedef std::vector< _Key_T > KeyList_T
typedef std::map< _Key_T,
WorkerBase * > 
KeyMap_T

Static Public Member Functions

static _Abstract_T * CreateInstance (const _Key_T &key)
static KeyList_T GetKeyList ()
static KeyMap_T & GetKeyMap ()
static PMutexGetMutex ()
static bool IsRegistered (const _Key_T &key)
static BOOL IsSingleton (const _Key_T &key)
static void Register (const _Key_T &key, Abstract_T *instance)
static void Register (const _Key_T &key, WorkerBase *worker)
static void Unregister (const _Key_T &key)
static void UnregisterAll ()

Protected Member Functions

_Abstract_T * CreateInstance_Internal (const _Key_T &key)
KeyList_T GetKeyList_Internal ()
bool IsRegistered_Internal (const _Key_T &key)
bool IsSingleton_Internal (const _Key_T &key)
void Register_Internal (const _Key_T &key, WorkerBase *worker)
void Unregister_Internal (const _Key_T &key)
void UnregisterAll_Internal ()

Static Protected Member Functions

static PFactoryGetInstance ()

Protected Attributes

KeyMap_T keyMap

Private Member Functions

void operator= (const PFactory &)
 PFactory (const PFactory &)

Static Private Member Functions

static FactoryMap & GetFactories ()
static PMutexGetFactoriesMutex ()

Private Attributes

PMutex mutex

Classes

class  Worker
class  WorkerBase

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

Generated by  Doxygen 1.6.0   Back to index