Rebel Fork Framework
Urho3D::ObjectReflectionRegistry Class Reference

Registry of Object reflections. More...

#include <Urho3D/Core/ObjectReflection.h>

Inheritance diagram for Urho3D::ObjectReflectionRegistry:
Urho3D::ActionManager Urho3D::Context Urho3D::ParticleGraphSystem

Public Member Functions

 ObjectReflectionRegistry (Context *context)
ObjectReflection * Reflect (const TypeInfo *typeInfo)
 Return existing or new reflection for given type.
ObjectReflection * ReflectCustomType (ea::unique_ptr< TypeInfo > typeInfo)
template<class T>
ObjectReflection * Reflect ()
template<class T>
ObjectReflection * AddReflection (ea::string_view category="")
 Add new object reflection with or without object creation factory and assign it to the category.
template<class T>
ObjectReflection * AddFactoryReflection (ea::string_view category="")
template<class T>
ObjectReflection * AddAbstractReflection (ea::string_view category="")
ObjectReflection * GetReflection (StringHash typeNameHash)
 Return existing reflection for given type.
const ObjectReflection * GetReflection (StringHash typeNameHash) const
bool IsReflected (StringHash typeNameHash) const
template<class T>
ObjectReflection * GetReflection ()
template<class T>
const ObjectReflection * GetReflection () const
template<class T>
bool IsReflected () const
void SetReflectionCategory (const TypeInfo *typeInfo, ea::string_view category)
 Assign object reflection to the category.
template<class T>
void SetReflectionCategory (ea::string_view category)
void RemoveReflection (StringHash typeNameHash)
 Remove reflection.
template<class T>
void RemoveReflection ()
SharedPtr< Object > CreateObject (StringHash typeNameHash)
 Create an object by type. Return pointer to it or null if no reflection is found.
const ea::unordered_map< StringHash, SharedPtr< ObjectReflection > > & GetObjectReflections () const
 Return reflections of all objects.
const ea::unordered_map< ea::string, ea::vector< StringHash > > & GetObjectCategories () const
 Return categories of reflected objects.
Shortcuts to call ObjectReflection methods without creating new reflection if one doesn't exist
template<class T>
void RemoveAttribute (StringHash nameHash)
template<class T>
void UpdateAttributeDefaultValue (StringHash nameHash, const Variant &defaultValue)

Public Attributes

Signal< void(ObjectReflection *), ObjectReflectionRegistry > OnReflectionRemoved

Private Member Functions

template<class T, bool EnableFactory, bool RequireFactory>
ObjectReflection * AddReflectionInternal (ea::string_view category)
void ErrorReflectionNotFound (StringHash typeNameHash) const
void ErrorDuplicateReflection (StringHash typeNameHash) const
void AddReflectionToCurrentCategory (ObjectReflection *reflection)
void RemoveReflectionFromCurrentCategory (ObjectReflection *reflection)

Private Attributes

Context * context_ {}
ea::unordered_map< StringHash, SharedPtr< ObjectReflection > > reflections_
ea::unordered_map< ea::string, ea::vector< StringHash > > categories_

Detailed Description

Registry of Object reflections.

Member Data Documentation

◆ OnReflectionRemoved

Signal<void(ObjectReflection*), ObjectReflectionRegistry> Urho3D::ObjectReflectionRegistry::OnReflectionRemoved

Object type is removed from reflection. All existing instances of the type shall be immediately destroyed.


The documentation for this class was generated from the following files:
  • Urho3D/Core/ObjectReflection.h
  • Urho3D/Core/ObjectReflection.cpp