Plasma Engine  2.0
Loading...
Searching...
No Matches
RttiMappedObjectFactory.h
1#pragma once
2
3#include <Foundation/Reflection/Reflection.h>
4#include <ToolsFoundation/ToolsFoundationDLL.h>
5
11template <typename Object>
13{
14 PL_DISALLOW_COPY_AND_ASSIGN(plRttiMappedObjectFactory);
15
16public:
19
20 using CreateObjectFunc = Object* (*)(const plRTTI*);
21
22 void RegisterCreator(const plRTTI* pType, CreateObjectFunc creator);
23 void UnregisterCreator(const plRTTI* pType);
24 Object* CreateObject(const plRTTI* pType);
25
26 struct Event
27 {
28 enum class Type
29 {
30 CreatorAdded,
31 CreatorRemoved
32 };
33
34 Type m_Type;
35 const plRTTI* m_pRttiType;
36 };
37
38 plEvent<const Event&> m_Events;
39
40private:
42};
43
44#include <ToolsFoundation/Factory/Implementation/RttiMappedObjectFactory_inl.h>
Definition Event.h:177
Definition HashTable.h:333
This class holds information about reflected types. Each instance represents one type that is known t...
Definition RTTI.h:30
A factory that creates the closest matching objects according to the passed type.
Definition RttiMappedObjectFactory.h:13
Definition RttiMappedObjectFactory.h:27