|
PTLib Version 2.10.2
|
Template class for generic factories of an abstract class. More...
#include <pfactory.h>
Classes | |
| class | Worker |
| class | WorkerBase |
Public Types | |
| typedef KeyType | Key_T |
| typedef AbstractClass | 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, bool autoDeleteInstance=true) |
| static PBoolean | RegisterAs (const Key_T &newKey, const Key_T &oldKey) |
| 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) |
| template<class Derived_T > | |
| static Derived_T * | CreateInstanceAs (const Key_T &key) |
| static PBoolean | 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) |
| PBoolean | RegisterAs_Internal (const Key_T &newKey, const Key_T &oldKey) |
| 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 AbstractClass PFactory< AbstractClass, KeyType >::Abstract_T |
| typedef KeyType PFactory< AbstractClass, KeyType >::Key_T |
| typedef std::vector<Key_T> PFactory< AbstractClass, KeyType >::KeyList_T |
| typedef std::map<Key_T, WorkerBase *> PFactory< AbstractClass, KeyType >::KeyMap_T |
| PFactory< AbstractClass, KeyType >::PFactory | ( | ) | [inline, protected] |
Referenced by PFactory< AbstractClass, KeyType >::GetInstance().
| PFactory< AbstractClass, KeyType >::~PFactory | ( | ) | [inline, protected] |
References PFactory< AbstractClass, KeyType >::keyMap.
| static Abstract_T* PFactory< AbstractClass, KeyType >::CreateInstance | ( | const Key_T & | key | ) | [inline, static] |
| Abstract_T* PFactory< AbstractClass, KeyType >::CreateInstance_Internal | ( | const Key_T & | key | ) | [inline, protected] |
| static PFactory& PFactory< AbstractClass, KeyType >::GetInstance | ( | ) | [inline, static, protected] |
References PFactoryBase::GetFactories(), PFactoryBase::GetFactoriesMutex(), PAssert, PFactory< AbstractClass, KeyType >::PFactory(), and PMEMORY_IGNORE_ALLOCATIONS_FOR_SCOPE.
Referenced by PFactory< AbstractClass, KeyType >::CreateInstance(), PFactory< AbstractClass, KeyType >::CreateInstanceAs(), PFactory< AbstractClass, KeyType >::GetKeyList(), PFactory< AbstractClass, KeyType >::GetKeyMap(), PFactory< AbstractClass, KeyType >::GetMutex(), PFactory< AbstractClass, KeyType >::IsRegistered(), PFactory< AbstractClass, KeyType >::IsSingleton(), PFactory< AbstractClass, KeyType >::Register(), PFactory< AbstractClass, KeyType >::RegisterAs(), PFactory< AbstractClass, KeyType >::Unregister(), and PFactory< AbstractClass, KeyType >::UnregisterAll().
| KeyList_T PFactory< AbstractClass, KeyType >::GetKeyList_Internal | ( | ) | [inline, protected] |
References PFactory< AbstractClass, KeyType >::keyMap, and PFactoryBase::mutex.
Referenced by PFactory< AbstractClass, KeyType >::GetKeyList().
| static PMutex& PFactory< AbstractClass, KeyType >::GetMutex | ( | ) | [inline, static] |
References PFactory< AbstractClass, KeyType >::GetInstance(), and PFactoryBase::mutex.
| bool PFactory< AbstractClass, KeyType >::IsRegistered_Internal | ( | const Key_T & | key | ) | [inline, protected] |
References PFactory< AbstractClass, KeyType >::keyMap, and PFactoryBase::mutex.
Referenced by PFactory< AbstractClass, KeyType >::IsRegistered().
| bool PFactory< AbstractClass, KeyType >::IsSingleton_Internal | ( | const Key_T & | key | ) | [inline, protected] |
References PFactory< AbstractClass, KeyType >::keyMap, and PFactoryBase::mutex.
Referenced by PFactory< AbstractClass, KeyType >::IsSingleton().
| static void PFactory< AbstractClass, KeyType >::Register | ( | const Key_T & | key, |
| Abstract_T * | instance, | ||
| bool | autoDeleteInstance = true |
||
| ) | [inline, static] |
| static void PFactory< AbstractClass, KeyType >::Register | ( | const Key_T & | key, |
| WorkerBase * | worker | ||
| ) | [inline, static] |
| void PFactory< AbstractClass, KeyType >::Register_Internal | ( | const Key_T & | key, |
| WorkerBase * | worker | ||
| ) | [inline, protected] |
| PBoolean PFactory< AbstractClass, KeyType >::RegisterAs_Internal | ( | const Key_T & | newKey, |
| const Key_T & | oldKey | ||
| ) | [inline, protected] |
References PFactory< AbstractClass, KeyType >::keyMap, and PFactoryBase::mutex.
Referenced by PFactory< AbstractClass, KeyType >::RegisterAs().
| void PFactory< AbstractClass, KeyType >::Unregister_Internal | ( | const Key_T & | key | ) | [inline, protected] |
References PFactory< AbstractClass, KeyType >::keyMap, and PFactoryBase::mutex.
Referenced by PFactory< AbstractClass, KeyType >::Unregister().
| static void PFactory< AbstractClass, KeyType >::UnregisterAll | ( | ) | [inline, static] |
| void PFactory< AbstractClass, KeyType >::UnregisterAll_Internal | ( | ) | [inline, protected] |
References PFactory< AbstractClass, KeyType >::keyMap, and PFactoryBase::mutex.
Referenced by PFactory< AbstractClass, KeyType >::UnregisterAll().
KeyMap_T PFactory< AbstractClass, KeyType >::keyMap [protected] |
Referenced by PFactory< AbstractClass, KeyType >::CreateInstance_Internal(), PFactory< AbstractClass, KeyType >::GetKeyList_Internal(), PFactory< AbstractClass, KeyType >::GetKeyMap(), PFactory< AbstractClass, KeyType >::IsRegistered_Internal(), PFactory< AbstractClass, KeyType >::IsSingleton_Internal(), PFactory< AbstractClass, KeyType >::Register_Internal(), PFactory< AbstractClass, KeyType >::RegisterAs_Internal(), PFactory< AbstractClass, KeyType >::Unregister_Internal(), PFactory< AbstractClass, KeyType >::UnregisterAll_Internal(), and PFactory< AbstractClass, KeyType >::~PFactory().