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< Object > CreateObject ()
bool HasObjectFactory () const
Category management
void SetCategory (ea::string_view category)
const ea::string & GetCategory () const
Return type info
const TypeInfo * GetTypeInfo () 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
AttributeInfo * GetAttribute (StringHash nameHash)
const AttributeInfo * GetAttribute (StringHash nameHash) const
const AttributeInfo & GetAttributeByIndex (unsigned index) const
const ea::vector< AttributeInfo > & GetAttributes () const
unsigned GetNumAttributes () const
Metadata
void SetMetadata (const StringHash &key, const Variant &value)
const Variant & GetMetadata (const StringHash &key) const
template<class T>
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.
RefCounted & operator= (const RefCounted &rhs)=delete
 Prevent assignment.
int AddRef () const
int ReleaseRef () const
int Refs () const
int WeakRefs () const
RefCount * RefCountPtr () 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

Context * context_ {}
const TypeInfo * typeInfo_ {}
 Type info of reflected object.
ea::unique_ptr< TypeInfo > ownedTypeInfo_
ObjectFactoryCallback createObject_ {}
ea::string category_
 Category of the object.
ea::unordered_map< StringHash, Variant > metadata_
 Reflection metadata.
AttributeScopeHint scopeHint_ {}
 Scope hint for the entire object.
ea::vector< AttributeInfo > attributes_
 Attributes of the Serializable.
ea::vector< StringHash > attributeNames_

Detailed Description

Reflection of a class derived from Object.


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