Rebel Fork Framework
Urho3D::ObjectReflection Class Reference

Reflection of a class derived from Object. More...

#include <Urho3D/Core/ObjectReflection.h>

Inheritance diagram for Urho3D::ObjectReflection:
Urho3D::RefCounted

Public Types

using ObjectFactoryCallback = SharedPtr< Object >(*)(const TypeInfo *typeInfo, Context *context)
 

Public Member Functions

 ObjectReflection (Context *context, const TypeInfo *typeInfo)
 
 ObjectReflection (Context *context, ea::unique_ptr< TypeInfo > typeInfo)
 
Factory management
void SetObjectFactory (ObjectFactoryCallback callback)
 
template<class T >
void SetObjectFactory ()
 
SharedPtr< ObjectCreateObject ()
 
bool HasObjectFactory () const
 
Category management
void SetCategory (ea::string_view category)
 
const ea::string & GetCategory () const
 
Return type info
const TypeInfoGetTypeInfo () const
 
const ea::string & GetTypeName () const
 
StringHash GetTypeNameHash () const
 
Modify attributes
AttributeHandle AddAttribute (const AttributeInfo &attr)
 
void RemoveAttribute (StringHash nameHash)
 
void RemoveAllAttributes ()
 
void CopyAttributesFrom (const ObjectReflection *other)
 
void UpdateAttributeDefaultValue (StringHash nameHash, const Variant &defaultValue)
 
Return attributes
unsigned GetAttributeIndex (StringHash nameHash) const
 
unsigned GetAttributeIndex (StringHash nameHash, unsigned hintIndex) const
 
AttributeInfoGetAttribute (StringHash nameHash)
 
const AttributeInfoGetAttribute (StringHash nameHash) const
 
const AttributeInfoGetAttributeByIndex (unsigned index) const
 
const ea::vector< AttributeInfo > & GetAttributes () const
 
unsigned GetNumAttributes () const
 
Metadata
void SetMetadata (const StringHash &key, const Variant &value)
 
const VariantGetMetadata (const StringHash &key) const
 
template<class T >
GetMetadata (const StringHash &key) const
 
void SetScopeHint (AttributeScopeHint hint)
 
AttributeScopeHint GetScopeHint () const
 
AttributeScopeHint GetEffectiveScopeHint () const
 
- Public Member Functions inherited from Urho3D::RefCounted
 RefCounted ()
 Construct. Allocate the reference count structure and set an initial self weak reference.
 
virtual ~RefCounted ()
 Destruct. Mark as expired and also delete the reference count structure if no outside weak references exist.
 
 RefCounted (const RefCounted &rhs)=delete
 Prevent copy construction.
 
RefCountedoperator= (const RefCounted &rhs)=delete
 Prevent assignment.
 
int AddRef ()
 
int ReleaseRef ()
 
int Refs () const
 
int WeakRefs () const
 
RefCountRefCountPtr () const
 Return pointer to the reference count structure.
 
bool HasScriptObject () const
 Return true if script runtime object wrapping this native object exists.
 
bool IsScriptStrongRef () const
 Return true if script reference is strong.
 

Private Attributes

Contextcontext_ {}
 
const TypeInfotypeInfo_ {}
 Type info of reflected object.
 
ea::unique_ptr< TypeInfoownedTypeInfo_
 
ObjectFactoryCallback createObject_ {}
 
ea::string category_
 Category of the object.
 
ea::unordered_map< StringHash, Variantmetadata_
 Reflection metadata.
 
AttributeScopeHint scopeHint_ {}
 Scope hint for the entire object.
 
ea::vector< AttributeInfoattributes_
 Attributes of the Serializable.
 
ea::vector< StringHashattributeNames_
 

Detailed Description

Reflection of a class derived from Object.


The documentation for this class was generated from the following files: