Urho3D execution context. Provides access to subsystems, object factories and attributes, and event receivers.
More...
|
| Context () |
| Construct.
|
|
| ~Context () override |
| Destruct. More...
|
|
void | RegisterSubsystem (Object *object, StringHash type) |
| Register a subsystem by explicitly using a type. Type must belong to inheritance hierarchy.
|
|
void | RegisterSubsystem (Object *object) |
| Register a subsystem.
|
|
void | RemoveSubsystem (StringHash objectType) |
| Remove a subsystem.
|
|
VariantMap & | GetEventDataMap () |
| Return a preallocated map for event data. Used for optimization to avoid constant re-allocation of event data maps.
|
|
bool | RequireSDL (unsigned int sdlFlags) |
| Initialises the specified SDL systems, if not already. Returns true if successful. This call must be matched with ReleaseSDL() when SDL functions are no longer required, even if this call fails.
|
|
void | ReleaseSDL () |
| Indicate that you are done with using SDL. Must be called after using RequireSDL().
|
|
template<class T > |
void | RegisterFactory (ea::string_view category={}) |
| Deprecated. Use AddFactoryReflection, AddAbstractReflection or AddReflection instead.
|
|
template<class T , class U = T> |
T * | RegisterSubsystem () |
| Template version of registering subsystem.
|
|
template<class T > |
void | RemoveSubsystem () |
| Template version of removing a subsystem.
|
|
Object * | GetSubsystem (StringHash type) const |
| Return subsystem by type.
|
|
const Variant & | GetGlobalVar (StringHash key) const |
| Return global variable based on key.
|
|
const VariantMap & | GetGlobalVars () const |
| Return all global variables.
|
|
void | SetGlobalVar (StringHash key, const Variant &value) |
| Set global variable with the respective key and value.
|
|
const SubsystemCache & | GetSubsystems () const |
| Return all subsystems.
|
|
Object * | GetEventSender () const |
| Return active event sender. Null outside event handling.
|
|
EventHandler * | GetEventHandler () const |
| Return active event handler. Set by Object. Null outside event handling.
|
|
const ea::string & | GetTypeName (StringHash objectType) const |
| Return object type name from hash, or empty if unknown.
|
|
AttributeInfo * | GetAttribute (StringHash objectType, const char *name) |
| Return a specific attribute description for an object, or null if not found.
|
|
template<class T > |
T * | GetSubsystem () const |
| Template version of returning a subsystem.
|
|
template<class T > |
AttributeInfo * | GetAttribute (const char *name) |
| Template version of returning a specific attribute description.
|
|
const ea::vector< AttributeInfo > * | GetAttributes (StringHash type) const |
| Return attribute descriptions for an object type, or null if none defined.
|
|
EventReceiverGroup * | GetEventReceivers (Object *sender, StringHash eventType) |
| Return event receivers for a sender and event type, or null if they do not exist.
|
|
EventReceiverGroup * | GetEventReceivers (StringHash eventType) |
| Return event receivers for an event type, or null if they do not exist.
|
|
| 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 () |
|
int | ReleaseRef () |
|
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.
|
|
| 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.
|
|
template<class T > |
void | RemoveAttribute (StringHash nameHash) |
|
template<class T > |
void | UpdateAttributeDefaultValue (StringHash nameHash, const Variant &defaultValue) |
|
Urho3D execution context. Provides access to subsystems, object factories and attributes, and event receivers.