PWLib
1.10.10
|
#include <pfactory.h>
Classes | |
class | Worker |
class | WorkerBase |
Public Types | |
typedef _Key_T | Key_T |
typedef _Abstract_T | Abstract_T |
typedef std::map< _Key_T, WorkerBase * > | KeyMap_T |
typedef std::vector< _Key_T > | KeyList_T |
Static Public Member Functions | |
static void | Register (const _Key_T &key, WorkerBase *worker) |
static void | Register (const _Key_T &key, Abstract_T *instance) |
static void | Unregister (const _Key_T &key) |
static void | UnregisterAll () |
static bool | IsRegistered (const _Key_T &key) |
static _Abstract_T * | CreateInstance (const _Key_T &key) |
static BOOL | IsSingleton (const _Key_T &key) |
static KeyList_T | GetKeyList () |
static KeyMap_T & | GetKeyMap () |
static PMutex & | GetMutex () |
Protected Member Functions | |
PFactory () | |
~PFactory () | |
void | Register_Internal (const _Key_T &key, WorkerBase *worker) |
void | Unregister_Internal (const _Key_T &key) |
void | UnregisterAll_Internal () |
bool | IsRegistered_Internal (const _Key_T &key) |
_Abstract_T * | CreateInstance_Internal (const _Key_T &key) |
bool | IsSingleton_Internal (const _Key_T &key) |
KeyList_T | GetKeyList_Internal () |
Static Protected Member Functions | |
static PFactory & | GetInstance () |
Protected Attributes | |
KeyMap_T | keyMap |
Template class for generic factories of an abstract class.
typedef _Abstract_T PFactory< _Abstract_T, _Key_T >::Abstract_T |
typedef _Key_T PFactory< _Abstract_T, _Key_T >::Key_T |
typedef std::vector<_Key_T> PFactory< _Abstract_T, _Key_T >::KeyList_T |
typedef std::map<_Key_T, WorkerBase *> PFactory< _Abstract_T, _Key_T >::KeyMap_T |
PFactory< _Abstract_T, _Key_T >::PFactory | ( | ) | [inline, protected] |
Referenced by PFactory< _Abstract_T, _Key_T >::GetInstance().
PFactory< _Abstract_T, _Key_T >::~PFactory | ( | ) | [inline, protected] |
References PFactory< _Abstract_T, _Key_T >::keyMap.
static _Abstract_T* PFactory< _Abstract_T, _Key_T >::CreateInstance | ( | const _Key_T & | key | ) | [inline, static] |
_Abstract_T* PFactory< _Abstract_T, _Key_T >::CreateInstance_Internal | ( | const _Key_T & | key | ) | [inline, protected] |
References PFactory< _Abstract_T, _Key_T >::keyMap, and PFactoryBase::mutex.
Referenced by PFactory< _Abstract_T, _Key_T >::CreateInstance().
static PFactory& PFactory< _Abstract_T, _Key_T >::GetInstance | ( | ) | [inline, static, protected] |
References PFactoryBase::GetFactories(), PFactoryBase::GetFactoriesMutex(), PAssert, and PFactory< _Abstract_T, _Key_T >::PFactory().
Referenced by PFactory< _Abstract_T, _Key_T >::CreateInstance(), PFactory< _Abstract_T, _Key_T >::GetKeyList(), PFactory< _Abstract_T, _Key_T >::GetKeyMap(), PFactory< _Abstract_T, _Key_T >::GetMutex(), PFactory< _Abstract_T, _Key_T >::IsRegistered(), PFactory< _Abstract_T, _Key_T >::IsSingleton(), PFactory< _Abstract_T, _Key_T >::Register(), PFactory< _Abstract_T, _Key_T >::Unregister(), and PFactory< _Abstract_T, _Key_T >::UnregisterAll().
static KeyList_T PFactory< _Abstract_T, _Key_T >::GetKeyList | ( | ) | [inline, static] |
KeyList_T PFactory< _Abstract_T, _Key_T >::GetKeyList_Internal | ( | ) | [inline, protected] |
References PFactory< _Abstract_T, _Key_T >::keyMap, and PFactoryBase::mutex.
Referenced by PFactory< _Abstract_T, _Key_T >::GetKeyList().
static PMutex& PFactory< _Abstract_T, _Key_T >::GetMutex | ( | ) | [inline, static] |
References PFactory< _Abstract_T, _Key_T >::GetInstance(), and PFactoryBase::mutex.
static bool PFactory< _Abstract_T, _Key_T >::IsRegistered | ( | const _Key_T & | key | ) | [inline, static] |
bool PFactory< _Abstract_T, _Key_T >::IsRegistered_Internal | ( | const _Key_T & | key | ) | [inline, protected] |
References PFactory< _Abstract_T, _Key_T >::keyMap, and PFactoryBase::mutex.
Referenced by PFactory< _Abstract_T, _Key_T >::IsRegistered().
static BOOL PFactory< _Abstract_T, _Key_T >::IsSingleton | ( | const _Key_T & | key | ) | [inline, static] |
bool PFactory< _Abstract_T, _Key_T >::IsSingleton_Internal | ( | const _Key_T & | key | ) | [inline, protected] |
References PFactory< _Abstract_T, _Key_T >::keyMap, and PFactoryBase::mutex.
Referenced by PFactory< _Abstract_T, _Key_T >::IsSingleton().
static void PFactory< _Abstract_T, _Key_T >::Register | ( | const _Key_T & | key, |
WorkerBase * | worker | ||
) | [inline, static] |
static void PFactory< _Abstract_T, _Key_T >::Register | ( | const _Key_T & | key, |
Abstract_T * | instance | ||
) | [inline, static] |
void PFactory< _Abstract_T, _Key_T >::Register_Internal | ( | const _Key_T & | key, |
WorkerBase * | worker | ||
) | [inline, protected] |
References PFactory< _Abstract_T, _Key_T >::keyMap, and PFactoryBase::mutex.
Referenced by PFactory< _Abstract_T, _Key_T >::Register().
static void PFactory< _Abstract_T, _Key_T >::Unregister | ( | const _Key_T & | key | ) | [inline, static] |
void PFactory< _Abstract_T, _Key_T >::Unregister_Internal | ( | const _Key_T & | key | ) | [inline, protected] |
References PFactory< _Abstract_T, _Key_T >::keyMap, and PFactoryBase::mutex.
Referenced by PFactory< _Abstract_T, _Key_T >::Unregister().
static void PFactory< _Abstract_T, _Key_T >::UnregisterAll | ( | ) | [inline, static] |
void PFactory< _Abstract_T, _Key_T >::UnregisterAll_Internal | ( | ) | [inline, protected] |
References PFactory< _Abstract_T, _Key_T >::keyMap, and PFactoryBase::mutex.
Referenced by PFactory< _Abstract_T, _Key_T >::UnregisterAll().
KeyMap_T PFactory< _Abstract_T, _Key_T >::keyMap [protected] |
Referenced by PFactory< _Abstract_T, _Key_T >::CreateInstance_Internal(), PFactory< _Abstract_T, _Key_T >::GetKeyList_Internal(), PFactory< _Abstract_T, _Key_T >::GetKeyMap(), PFactory< _Abstract_T, _Key_T >::IsRegistered_Internal(), PFactory< _Abstract_T, _Key_T >::IsSingleton_Internal(), PFactory< _Abstract_T, _Key_T >::Register_Internal(), PFactory< _Abstract_T, _Key_T >::Unregister_Internal(), PFactory< _Abstract_T, _Key_T >::UnregisterAll_Internal(), and PFactory< _Abstract_T, _Key_T >::~PFactory().