Manager for object factories.
More...
#include <SObjectFactory.h>
|
| | SObjectFactoryMgr (void) |
| | Constructor for SObjectFactoryMgr.
|
| |
| BOOL | RegisterFactory (const IObjectFactory *objFactory, BOOL bReplace=false) |
| | Registers an object factory.
|
| |
| BOOL | UnregisterFactory (const SObjectInfo &objInfo) |
| | Unregisters an object factory.
|
| |
| void | SetSwndDefAttr (IObject *pObject) const |
| | Sets default attributes for a given object.
|
| |
| SObjectInfo | BaseObjectInfoFromObjectInfo (const SObjectInfo &objInfo) |
| | Gets the base object information from a given object information.
|
| |
| template<class T> |
| BOOL | TplRegisterFactory () |
| | Template method to register a factory for a specific object type.
|
| |
| template<class T> |
| BOOL | TplUnregisterFactory () |
| | Template method to unregister a factory for a specific object type.
|
| |
| | SCmnMap (void(*funOnKeyRemoved)(const SObjectFactoryPtr &)=NULL) |
| | Constructor.
|
| |
| virtual | ~SCmnMap () |
| | Destructor.
|
| |
| bool | HasKey (const SObjectInfo &key) const |
| | Checks if a key exists in the map.
|
| |
| bool | GetKeyObject (const SObjectInfo &key, SObjectFactoryPtr &obj) const |
| | Retrieves an object associated with a key.
|
| |
| SObjectFactoryPtr & | GetKeyObject (const SObjectInfo &key) const |
| | Retrieves an object associated with a key.
|
| |
| bool | AddKeyObject (const SObjectInfo &key, const SObjectFactoryPtr &obj) |
| | Adds a key-object pair to the map.
|
| |
| void | SetKeyObject (const SObjectInfo &key, const SObjectFactoryPtr &obj) |
| | Sets an object for a key, replacing any existing object.
|
| |
| bool | RemoveKeyObject (const SObjectInfo &key) |
| | Removes a key-object pair from the map.
|
| |
| void | RemoveAll () |
| | Removes all key-object pairs from the map.
|
| |
| size_t | GetCount () |
| | Gets the number of key-object pairs in the map.
|
| |
|
| virtual IObject * | CreateObject (const SObjectInfo &objInfo) const |
| | Creates an object based on the given object information.
|
| |
| virtual IObject * | OnCreateUnknownObject (const SObjectInfo &objInfo) const |
| | Handles the creation of an unknown object.
|
| |
|
| static void | OnFactoryRemoved (const SObjectFactoryPtr &obj) |
| | Static callback for when a factory is removed.
|
| |
Manager for object factories.
Description: Manages the registration, unregistration, and creation of objects using factories.
Definition at line 142 of file SObjectFactory.h.
◆ SObjectFactoryMgr()
| SObjectFactoryMgr::SObjectFactoryMgr |
( |
void | | ) |
|
◆ BaseObjectInfoFromObjectInfo()
| SObjectInfo SObjectFactoryMgr::BaseObjectInfoFromObjectInfo |
( |
const SObjectInfo & | objInfo | ) |
|
Gets the base object information from a given object information.
- Parameters
-
| objInfo | Object information structure. |
- Returns
- Base object information structure.
Definition at line 91 of file SObjectFactory.cpp.
◆ CreateObject()
| IObject * SObjectFactoryMgr::CreateObject |
( |
const SObjectInfo & | objInfo | ) |
const |
|
protectedvirtual |
Creates an object based on the given object information.
- Parameters
-
| objInfo | Object information structure. |
- Returns
- Pointer to the created object.
Definition at line 79 of file SObjectFactory.cpp.
◆ OnCreateUnknownObject()
| IObject * SObjectFactoryMgr::OnCreateUnknownObject |
( |
const SObjectInfo & | objInfo | ) |
const |
|
protectedvirtual |
Handles the creation of an unknown object.
- Parameters
-
| objInfo | Object information structure. |
- Returns
- Pointer to the created object.
Definition at line 140 of file SObjectFactory.cpp.
◆ OnFactoryRemoved()
| void SObjectFactoryMgr::OnFactoryRemoved |
( |
const SObjectFactoryPtr & | obj | ) |
|
|
staticprotected |
Static callback for when a factory is removed.
- Parameters
-
| obj | Pointer to the object factory. |
Definition at line 61 of file SObjectFactory.cpp.
◆ RegisterFactory()
| BOOL SObjectFactoryMgr::RegisterFactory |
( |
const IObjectFactory * | objFactory, |
|
|
BOOL | bReplace = false ) |
Registers an object factory.
- Parameters
-
| objFactory | Pointer to the object factory. |
| bReplace | Flag to replace existing factory if it exists. |
- Returns
- TRUE if registration is successful, FALSE otherwise.
Definition at line 38 of file SObjectFactory.cpp.
◆ SetSwndDefAttr()
| void SObjectFactoryMgr::SetSwndDefAttr |
( |
IObject * | pObject | ) |
const |
Sets default attributes for a given object.
- Parameters
-
| pObject | Pointer to the object. |
Definition at line 105 of file SObjectFactory.cpp.
◆ TplRegisterFactory()
template<class T>
| BOOL SObjectFactoryMgr::TplRegisterFactory |
( |
| ) |
|
|
inline |
Template method to register a factory for a specific object type.
- Template Parameters
-
- Returns
- TRUE if registration is successful, FALSE otherwise.
Definition at line 183 of file SObjectFactory.h.
◆ TplUnregisterFactory()
template<class T>
| BOOL SObjectFactoryMgr::TplUnregisterFactory |
( |
| ) |
|
|
inline |
Template method to unregister a factory for a specific object type.
- Template Parameters
-
- Returns
- TRUE if unregistration is successful, FALSE otherwise.
Definition at line 195 of file SObjectFactory.h.
◆ UnregisterFactory()
| BOOL SObjectFactoryMgr::UnregisterFactory |
( |
const SObjectInfo & | objInfo | ) |
|
Unregisters an object factory.
- Parameters
-
| objInfo | Object information structure. |
- Returns
- TRUE if unregistration is successful, FALSE otherwise.
Definition at line 74 of file SObjectFactory.cpp.
The documentation for this class was generated from the following files: