Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray::cObjectFactory Class Referenceabstract

#include <cObjectFactory.h>

Inheritance diagram for Gray::cObjectFactory:
GrayLib::cHashTypeDef GrayLib::cHashTypeMD5 GrayLib::cHashTypeSHA1 GrayLib::cHashTypeSHA224 GrayLib::cHashTypeSHA256 GrayLib::cHashTypeSHA384 GrayLib::cHashTypeSHA512

Public Member Functions

 cObjectFactory (const char *pszName, const TYPEINFO_t &rTypeInfo) noexcept
 the typeid() of some object we would create. More...
 
virtual CObjectCreateObject () const =0
 Create CObject of some derived cTypeInfo. More...
 

Static Public Member Functions

static CObject *__stdcall CreateObject (const char *pszName)
 
static CObject *__stdcall CreateObject (const TYPEINFO_t &type)
 

Public Attributes

const char *const m_pszName
 
const cTypeInfom_TypeInfo
 The main name we can create by. Might have multiple alternate aliases for interfaces. e.g. "IObjectName". More...
 

Detailed Description

Service Locater / Creator pattern for CObject based objects https://en.wikipedia.org/wiki/Service_locator_pattern like MFC CRuntimeClass. used to create CObject based objects by string name. Allow runtime binding. Create a new object by name. It may be overridden. Typically one would ask for an Interface and a concrete object would be created. similar to Object Injection. ALA Ninject. Used to allow creation of overloaded singletons. TODO Allocation of the object is unknown! Is it static? must delete ? cRefPtr? ???

Constructor & Destructor Documentation

◆ cObjectFactory()

Gray::cObjectFactory::cObjectFactory ( const char *  pszName,
const TYPEINFO_t rTypeInfo 
)
inlinenoexcept

the typeid() of some object we would create.

Member Function Documentation

◆ CreateObject() [1/3]

virtual CObject* Gray::cObjectFactory::CreateObject ( ) const
pure virtual

Create CObject of some derived cTypeInfo.

Implemented in GrayLib::cHashTypeDef.

◆ CreateObject() [2/3]

static CObject* __stdcall Gray::cObjectFactory::CreateObject ( const char *  pszName)
static

◆ CreateObject() [3/3]

static CObject* __stdcall Gray::cObjectFactory::CreateObject ( const TYPEINFO_t type)
static

Member Data Documentation

◆ m_pszName

const char* const Gray::cObjectFactory::m_pszName

◆ m_TypeInfo

const cTypeInfo& Gray::cObjectFactory::m_TypeInfo

The main name we can create by. Might have multiple alternate aliases for interfaces. e.g. "IObjectName".


The documentation for this class was generated from the following file: