Om
1.0.0
A universal framework for multimedia simulation
|
A collection of EngineSystem objects that operate on a set of abstract entities and their components. More...
#include <omEngineContext.h>
Public Member Functions | |
EngineContext () | |
Create a new empty engine context with no systems, entities, or components. More... | |
virtual | ~EngineContext () |
Destroy an engine context, releasing all internally allocated data. More... | |
virtual void | update (const Time &dt) |
Update the state of all systems in this engine for the specified time interval. More... | |
template<typename T > | |
Bool | addComponent (T *component, ResourceID *componentID=((void *) 0)) |
Add a component of a concete template type to the engine. More... | |
Bool | addComponent (const ResourceType &type, void *componentData) |
Add an opaque component of the specified type to the engine. More... | |
Bool | addComponent (const OpaqueResource &component) |
Add an opaque component to the engine. More... | |
template<typename T > | |
Bool | removeComponent (T *component) |
Remove the specified component of the template type from the engine. More... | |
Bool | removeComponent (const OpaqueResource &component) |
Remove an opaque component from the engine. More... | |
Bool | removeComponent (const ResourceType &type, void *componentData) |
Remove an opaque component of the specified type from the engine. More... | |
void | clearComponents () |
Remove all components from the engine. More... | |
Size | getComponentTypeCount () const |
Return the number of different component types that this engine context is processing. More... | |
template<typename T > | |
ComponentSet< T > | newComponentType () |
Return a pointer to the component manager for components with the specified type in this engine. More... | |
template<typename T > | |
ComponentSet< T > | getComponentType () const |
Return a pointer to the component manager for components with the specified type in this engine. More... | |
Bool | addConnection (const Connection *connection) |
Add a data flow connection to this engine so that it is processed during simulation updates. More... | |
Bool | removeConnection (const Connection *connection) |
Remove a data flow connection from this engine so that it is no longer processed. More... | |
void | clearConnections () |
Clear all connections from this engine context. More... | |
Size | getSystemCount () const |
Return the number of systems there are in this engine context. More... | |
EngineSystem * | getSystem (Index systemIndex) const |
Return a pointer to the system in this engine context at the specified index. More... | |
Bool | addSystem (EngineSystem *system) |
Add a system to this engine context. More... | |
Bool | removeSystem (const EngineSystem *system) |
Remove the system in this engine with the given pointer. More... | |
void | clearSystems () |
Remove all systems from this engine. More... | |
Size | getEventTypeCount () const |
Return the number of different event types that this engine context is processing. More... | |
template<typename ValueType > | |
EventManager< ValueType > * | newEventType (const EventType &eventType) |
Return a pointer to the event manager for events with the specified type in this engine. More... | |
template<typename ValueType > | |
EventManager< ValueType > * | getEventType (const EventType &eventType) |
Return a pointer to the event manager for events with the specified type in this engine. More... | |
template<typename ValueType > | |
const EventManager< ValueType > * | getEventType (const EventType &eventType) const |
Return a const pointer to the event manager for events with the specified type in this engine. More... | |
template<typename ValueType > | |
Bool | addEvent (const EventType &eventType, const Event< ValueType > &newEvent) |
Post a new event to the engine context. More... | |
template<typename ValueType > | |
Bool | addEvent (const EventType &eventType, const ValueType &value, const OpaqueResource &target=OpaqueResource(), const OpaqueResource &sender=OpaqueResource(), const EngineSystem *systemSender=((void *) 0)) |
Post a new event to the engine context with the specified type, value, and other parameters. More... | |
template<typename ValueType > | |
Bool | addEvent (const EventType &eventType, const ValueType &value, const OpaqueResource &target, const OpaqueResource &sender, const EngineSystem *systemSender, const Time &eventTime) |
Post a new event to the engine context with the specified type, value, and other parameters. More... | |
void | clearEventTypes () |
Clear the managers for every type of event that this engine was previously handling. More... | |
const Time & | getTime () const |
Return the current reference wall-clock time of the engine context. More... | |
void | setTime (const Time &newTime) |
Set the current reference wall-clock time of the engine context. More... | |
Static Public Attributes | |
static const EventType | ADD_COMPONENT_EVENT |
A static event type object that represents a add component event type. More... | |
static const EventType | REMOVE_COMPONENT_EVENT |
A static event type object that represents a remove component event type. More... | |
A collection of EngineSystem objects that operate on a set of abstract entities and their components.
om::engine::base::EngineContext::EngineContext | ( | ) |
Create a new empty engine context with no systems, entities, or components.
|
virtual |
Destroy an engine context, releasing all internally allocated data.
|
virtual |
Update the state of all systems in this engine for the specified time interval.
|
inline |
Add a component of a concete template type to the engine.
The method returns whether or not the component was able to be added.
Bool om::engine::base::EngineContext::addComponent | ( | const ResourceType & | type, |
void * | componentData | ||
) |
Add an opaque component of the specified type to the engine.
The method returns whether or not the component was able to be added.
Bool om::engine::base::EngineContext::addComponent | ( | const OpaqueResource & | component | ) |
Add an opaque component to the engine.
The method returns whether or not the component was able to be added.
|
inline |
Remove the specified component of the template type from the engine.
The method returns whether or not the component was able to be removed from the engine.
Bool om::engine::base::EngineContext::removeComponent | ( | const OpaqueResource & | component | ) |
Remove an opaque component from the engine.
The method returns whether or not the component was able to be removed.
Bool om::engine::base::EngineContext::removeComponent | ( | const ResourceType & | type, |
void * | componentData | ||
) |
Remove an opaque component of the specified type from the engine.
The method returns whether or not the component was able to be removed.
void om::engine::base::EngineContext::clearComponents | ( | ) |
Remove all components from the engine.
|
inline |
Return the number of different component types that this engine context is processing.
|
inline |
Return a pointer to the component manager for components with the specified type in this engine.
If there is no type manager for that templated parameter type, a new one is created.
|
inline |
Return a pointer to the component manager for components with the specified type in this engine.
If there is a manager for the templated component type in this engine, a pointer to it is returned. Otherwise, a NULL pointer is returned indicating there is no manager for that type.
Bool om::engine::base::EngineContext::addConnection | ( | const Connection * | connection | ) |
Add a data flow connection to this engine so that it is processed during simulation updates.
Bool om::engine::base::EngineContext::removeConnection | ( | const Connection * | connection | ) |
Remove a data flow connection from this engine so that it is no longer processed.
void om::engine::base::EngineContext::clearConnections | ( | ) |
Clear all connections from this engine context.
|
inline |
Return the number of systems there are in this engine context.
|
inline |
Return a pointer to the system in this engine context at the specified index.
Bool om::engine::base::EngineContext::addSystem | ( | EngineSystem * | system | ) |
Add a system to this engine context.
The method returns whether or not the given system was able to be added to the engine. The method can fail if the system pointer is NULL.
Bool om::engine::base::EngineContext::removeSystem | ( | const EngineSystem * | system | ) |
Remove the system in this engine with the given pointer.
The method returns whether or not the system was able to be removed.
void om::engine::base::EngineContext::clearSystems | ( | ) |
Remove all systems from this engine.
The entities in the engine are unaffected.
|
inline |
Return the number of different event types that this engine context is processing.
|
inline |
Return a pointer to the event manager for events with the specified type in this engine.
If there is a manager for the event type and templated value type in this engine, a pointer to it is returned. Otherwise, a new empty event manager is created and a pointer to it returned.
|
inline |
Return a pointer to the event manager for events with the specified type in this engine.
If there is a manager for the event type and templated value type in this engine, a pointer to it is returned. Otherwise, a NULL pointer is returned indicating there is no manager for that type.
|
inline |
Return a const pointer to the event manager for events with the specified type in this engine.
If there is a manager for the event type and templated value type in this engine, a pointer to it is returned. Otherwise, a NULL pointer is returned indicating there is no manager for that type.
|
inline |
Post a new event to the engine context.
|
inline |
Post a new event to the engine context with the specified type, value, and other parameters.
|
inline |
Post a new event to the engine context with the specified type, value, and other parameters.
void om::engine::base::EngineContext::clearEventTypes | ( | ) |
Clear the managers for every type of event that this engine was previously handling.
|
inline |
Return the current reference wall-clock time of the engine context.
This is the reference time that all engine timing is done relative to. It is originally initialized to the current time via Time::getCurrent() when the engine is first started. Each call to update() advances the time by the specified delta.
|
inline |
Set the current reference wall-clock time of the engine context.
This is the reference time that all engine timing is done relative to. Each call to update() advances the time by the specified delta.
|
static |
A static event type object that represents a add component event type.
|
static |
A static event type object that represents a remove component event type.