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)
 
ObjectReflectionReflect (const TypeInfo *typeInfo)
 Return existing or new reflection for given type.
 
ObjectReflectionReflectCustomType (ea::unique_ptr< TypeInfo > typeInfo)
 
template<class T >
ObjectReflectionReflect ()
 
template<class T >
ObjectReflectionAddReflection (ea::string_view category="")
 Add new object reflection with or without object creation factory and assign it to the category.
 
template<class T >
ObjectReflectionAddFactoryReflection (ea::string_view category="")
 
template<class T >
ObjectReflectionAddAbstractReflection (ea::string_view category="")
 
ObjectReflectionGetReflection (StringHash typeNameHash)
 Return existing reflection for given type.
 
const ObjectReflectionGetReflection (StringHash typeNameHash) const
 
bool IsReflected (StringHash typeNameHash) const
 
template<class T >
ObjectReflectionGetReflection ()
 
template<class T >
const ObjectReflectionGetReflection () 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< ObjectCreateObject (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 *), ObjectReflectionRegistryOnReflectionRemoved
 

Private Member Functions

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

Private Attributes

Contextcontext_ {}
 
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: