Dry execution context. Provides access to subsystems, object factories and attributes, and event receivers.
More...
|
| Context () |
| Construct.
|
|
| ~Context () override |
| Destruct. More...
|
|
template<class T > |
SharedPtr< T > | CreateObject () |
| Create an object by type. Return pointer to it or null if no factory found.
|
|
SharedPtr< Object > | CreateObject (StringHash objectType) |
| Create an object by type hash. Return pointer to it or null if no factory found.
|
|
void | RegisterFactory (ObjectFactory *factory) |
| Register a factory for an object type.
|
|
void | RegisterFactory (ObjectFactory *factory, const char *category) |
| Register a factory for an object type and specify the object category.
|
|
void | RegisterSubsystem (Object *object) |
| Register a subsystem.
|
|
void | RemoveSubsystem (StringHash objectType) |
| Remove a subsystem.
|
|
AttributeHandle | RegisterAttribute (StringHash objectType, const AttributeInfo &attr) |
| Register object attribute.
|
|
void | RemoveAttribute (StringHash objectType, const char *name) |
| Remove object attribute.
|
|
void | RemoveAllAttributes (StringHash objectType) |
| Remove all object attributes.
|
|
void | UpdateAttributeDefaultValue (StringHash objectType, const char *name, const Variant &defaultValue) |
| Update object attribute's default value.
|
|
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().
|
|
void | CopyBaseAttributes (StringHash baseType, StringHash derivedType) |
| Copy base class attributes to derived class.
|
|
template<class T > |
void | RegisterFactory () |
| Template version of registering an object factory.
|
|
template<class T > |
void | RegisterFactory (const char *category) |
| Template version of registering an object factory with category.
|
|
template<class T > |
T * | RegisterSubsystem () |
| Template version of registering subsystem.
|
|
template<class T > |
void | RemoveSubsystem () |
| Template version of removing a subsystem.
|
|
template<class T > |
AttributeHandle | RegisterAttribute (const AttributeInfo &attr) |
| Template version of registering an object attribute.
|
|
template<class T > |
void | RemoveAttribute (const char *name) |
| Template version of removing an object attribute.
|
|
template<class T > |
void | RemoveAllAttributes () |
| Template version of removing all object attributes.
|
|
template<class T , class U > |
void | CopyBaseAttributes () |
| Template version of copying base class attributes to derived class.
|
|
template<class T > |
void | UpdateAttributeDefaultValue (const char *name, const Variant &defaultValue) |
| Template version of updating an object attribute's default value.
|
|
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 HashMap< StringHash, SharedPtr< Object > > & | GetSubsystems () const |
| Return all subsystems.
|
|
const HashMap< StringHash, SharedPtr< ObjectFactory > > & | GetObjectFactories () const |
| Return all object factories.
|
|
const HashMap< String, Vector< StringHash > > & | GetObjectCategories () const |
| Return all object categories.
|
|
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 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 Vector< AttributeInfo > * | GetAttributes (StringHash type) const |
| Return attribute descriptions for an object type, or null if none defined.
|
|
const Vector< AttributeInfo > * | GetNetworkAttributes (StringHash type) const |
| Return network replication attribute descriptions for an object type, or null if none defined.
|
|
const HashMap< StringHash, Vector< AttributeInfo > > & | GetAllAttributes () const |
| Return all registered attributes.
|
|
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.
|
|
void | AddRef () |
| Increment reference count. Can also be called outside of a SharedPtr for traditional reference counting.
|
|
void | ReleaseRef () |
| Decrement reference count and delete self if no more references. Can also be called outside of a SharedPtr for traditional reference counting.
|
|
int | Refs () const |
| Return reference count.
|
|
int | WeakRefs () const |
| Return weak reference count.
|
|
RefCount * | RefCountPtr () |
| Return pointer to the reference count structure.
|
|
Dry execution context. Provides access to subsystems, object factories and attributes, and event receivers.