Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cObjectFactory.h
Go to the documentation of this file.
1 //
4 //
5 
6 #ifndef _INC_cObjectFactory_H
7 #define _INC_cObjectFactory_H
8 #ifndef NO_PRAGMA_ONCE
9 #pragma once
10 #endif
11 #include "cTypeInfo.h"
12 #include "cObject.h"
13 
14 namespace Gray
15 {
17  {
27 
28  public:
29  const char* const m_pszName;
31 
32  public:
33  cObjectFactory(const char* pszName, const TYPEINFO_t& rTypeInfo) noexcept
34  : m_pszName(pszName)
35  , m_TypeInfo((const cTypeInfo&)rTypeInfo)
36  {
37  }
38 
40  virtual CObject* CreateObject() const = 0;
41 
42  static CObject* GRAYCALL CreateObject(const char* pszName);
43  static CObject* GRAYCALL CreateObject(const TYPEINFO_t& type);
44  };
45 
47  {
48  // collection of cObjectFactory(s)
49 
50  };
51 
52 }
53 
54 #endif
#define GRAYCORE_LINK
Definition: GrayCore.h:47
#define GRAYCALL
declare calling convention for static functions so everyone knows the arg passing scheme....
Definition: GrayCore.h:36
Definition: cObject.h:67
Definition: cObjectFactory.h:17
const cTypeInfo & m_TypeInfo
The main name we can create by. Might have multiple alternate aliases for interfaces....
Definition: cObjectFactory.h:30
cObjectFactory(const char *pszName, const TYPEINFO_t &rTypeInfo) noexcept
the typeid() of some object we would create.
Definition: cObjectFactory.h:33
static CObject *__stdcall CreateObject(const TYPEINFO_t &type)
virtual CObject * CreateObject() const =0
Create CObject of some derived cTypeInfo.
const char *const m_pszName
Definition: cObjectFactory.h:29
static CObject *__stdcall CreateObject(const char *pszName)
Definition: cObjectFactory.h:47
Definition: cTypeInfo.h:33
< The main namespace for all Core functions.
Definition: GrayCore.cpp:14
std::type_info TYPEINFO_t
Definition: cTypeInfo.h:29