3template <
typename Object>
6template <
typename Object>
9template <
typename Object>
12 PL_ASSERT_DEV(!m_Creators.Contains(pType),
"Type already registered.");
14 m_Creators.Insert(pType, creator);
16 e.m_Type = Event::Type::CreatorAdded;
17 e.m_pRttiType = pType;
18 m_Events.Broadcast(e);
21template <
typename Object>
24 PL_ASSERT_DEV(m_Creators.Contains(pType),
"Type was never registered.");
25 m_Creators.Remove(pType);
28 e.m_Type = Event::Type::CreatorRemoved;
29 e.m_pRttiType = pType;
30 m_Events.Broadcast(e);
33template <
typename Object>
36 CreateObjectFunc* creator =
nullptr;
37 while (pType !=
nullptr)
39 if (m_Creators.TryGetValue(pType, creator))
41 return (*creator)(pType);
This class holds information about reflected types. Each instance represents one type that is known t...
Definition RTTI.h:30
PL_ALWAYS_INLINE const plRTTI * GetParentType() const
Returns the type that is the base class of this type. May be nullptr if this type has no base class.
Definition RTTI.h:54
A factory that creates the closest matching objects according to the passed type.
Definition RttiMappedObjectFactory.h:13
constexpr TYPE e()
Returns the natural constant e.