VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtVirtualBaseClassCreator.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <vrvCore/vrvCore.h>
4 #include <vrvCore/DtDe.h>
5 
6 namespace makVrv
7 {
8  template<class T>
10  {
11  public:
14 
17 
19  virtual T* create();
20 
21  protected:
24 
25  protected:
27  };
28 
29  template <typename T>
30  inline const char* typeName(void) { return "unknown"; }
31 
32  template<class T>
34  : myDe(de)
35  {
36 
37  }
38 
39  template<class T>
41  {
42 
43  }
44 
45  template<class T>
47  {
48  std::string creatorType = std::string(typeName<T>()) + "creator";
50  de.findInstance(creatorType));
51  if (!inst)
52  {
53  inst = new DtVirtualBaseClassCreator<T>(de);
54  de.registerInstance(creatorType, inst);
55  }
56  return *inst;
57  }
58 
59  template<class T>
61  {
62  return new T(myDe);
63  }
64 
65 }

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)