Class CObjectFactory#
Defined in File component_impl.h
Inheritance Relationships#
Base Types#
public sdv::IInterfaceAccess
(Struct IInterfaceAccess)public sdv::IObjectFactory
(Struct IObjectFactory)
Derived Type#
public sdv::CModule
(Class CModule)
Class Documentation#
-
class CObjectFactory : public sdv::IInterfaceAccess, public sdv::IObjectFactory#
Global tracking of active objects. Functions in this class will only be called by CSdvObject and CSdvObjectClass.
Subclassed by sdv::CModule
Public Functions
-
CObjectFactory() = default#
Constructor.
-
inline CLifetimeCookie CreateLifetimeCookie()#
Interface map.
Create a lifetime cookie that keeps track of the module lifetime as long as it is alive.
- Returns:
Returns a lifetime cookie.
-
inline uint32_t GetActiveObjects() const#
Gets the amount of active SDV objects.
- Returns:
Returns the number of active SDV objects.
-
inline const char *GetManifest()#
Get the module manifest.
- Returns:
Returns the pointer to a zero terminated string containing the module manifest or NULL when there is no string.
-
inline virtual IInterfaceAccess *CreateObject(const sdv::u8string &ssClassName) override#
Create or get the object using the name from the object class info. Overload of sdv::IObjectFactory::CreateObject.
- Attention
The objects lifetime is ended by a call to the DestroyObject function or the unloading of he module.
- Parameters:
ssClassName – [in] The name of the class object to instantiate.
- Returns:
Pointer to IInterfaceAccess interface of the object or NULL when the requested object doesn’t exist.
-
inline virtual void DestroyObject(IInterfaceAccess *object) override#
Destroy an instantiated object using the name of the object class info. Overload of sdv::IObjectFactory::DestroyObject.
- Parameters:
object – [in] The object to destroy.
-
inline virtual void DestroyAllObjects() override#
Destroys all active objects in reverse order of creation.
Protected Functions
-
inline void BuildManifest()#
Build the module manifest.
- Returns:
Returns the pointer to a zero terminated string containing the module manifest or NULL when there is no string.
-
inline void ExposeObjectClass(ISdvObjectClassInfo *pObjectClassInfo)#
Expose the object prototype by placing it into the object prototype list.
Expose the object class to allow class access. This function is called by the constructor of the class object.
- Parameters:
pObjectClassInfo – [in] The object class internal interface.
-
inline void RevokeObjectClass(const ISdvObjectClassInfo *pObjectClassInfo)#
Revoke the object prototype from the object prototype list.
- Parameters:
pObjectClassInfo – [in] The object class internal interface.
-
CObjectFactory() = default#