Class CObjectFactory#

Inheritance Relationships#

Base Types#

Derived Type#

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#

Get 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 sequence<u8string> GetClassNames() const override#

The object class names implemented in the object. Overload of sdv::IObjectFactory::GetClassNames.

Returns:

Sequence with object class names string.

inline virtual SClassInfo GetClassInfo(const u8string &ssClassName) const override#

Get the class information. Overload of sdv::IObjectFactory::GetClassInfo.

Parameters:

ssClassName[in] The name of the class object to get the class information for.

Returns:

Returns the class information struct.

inline virtual IInterfaceAccess *CreateObject(const 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.

inline void ExposeObjectClass(ISdvObjectClassInfo *pClassInfo)#

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:

pClassInfo[in] The object class internal interface.

inline void RevokeObjectClass(const ISdvObjectClassInfo *pClassInfo)#

Revoke the object prototype from the object prototype list.

Parameters:

pClassInfo[in] The object class internal interface.

Protected Static Functions

static inline std::string QuoteText(const std::string &rssText)#

Quote the provided text following the string rules of TOML.

Parameters:

rssText[in] Reference to the text to quote.

Returns:

The quoted text string.