![]() ![]() BRAHMS
Reference Manual » Component Interface » Native » Component Events
This documentation is offline - click here to go online
Index | Search: Go online to use Search
| ||
OverviewC API (Component Interface)
struct Event
Symbol typeUINT32 flagsSymbol Components offer services to the Engine (and to other components) by exporting a function to handle events. All component processing is done during the servicing of these events. The When authoring the Events interface of a new component, you can start by servicing no events. The framework will tell you when failure to service a particular event has caused a problem. A process will need to service two or three events to function properly. Notes
Fields
Flags
Event typesThe event types defined by the framework are listed below (components may define their own events too). Each type links to a page describing the event type in more detail. The documentation for individual event types should be largely self-explanatory. To see all these events as they appear in the context of an execution, see Life Cycles. Notes
Module-level EventsThis interface is used to manage Component instances through a Component Module. EVENT_MODULE_INIT Initialise module, return module-specific information. EVENT_MODULE_TERM Terminate module. EVENT_MODULE_CREATE Create a new component instance. EVENT_MODULE_DESTROY Destroy an existing component instance. EVENT_MODULE_DUPLICATE Duplicate an existing component instance. Component-level EventsAll ComponentsFrameworkThis interface is used exclusively by the framework to access the functionality of all Component objects. EVENT_STATE_SET Set component state from an XML node. EVENT_STATE_GET Retrieve component state as an XML node. EVENT_LOG_INIT Advise component it should log during upcoming execution. EVENT_LOG_TERM Retrieve component's log. ProcessesFrameworkThis interface is used exclusively by the framework to access the functionality of Process objects. EVENT_INIT_PRECONNECT The process input interface now has its structure finalised (though the ports are currently all empty). EVENT_INIT_CONNECT This event is fired multiple times, with more input ports filled on each call. The process may create outputs on any call. EVENT_INIT_POSTCONNECT The connection phase has finished, and all input ports are now connected and filled. The system-wide base sample rate has been calculated, and all timing values are now finalized. If you receive EVENT_RUN_PLAY, you will receive EVENT_RUN_STOP, even if you raised an error whilst servicing EVENT_RUN_PLAY. If you receive EVENT_RUN_RESUME, you will receive EVENT_RUN_PAUSE, even if you raised an error whilst servicing EVENT_RUN_RESUME. In general, if you raise an error at any time in the run phase, you will receive the necessary events to walk you back down to a STOP state. EVENT_RUN_PLAY The process is now running in its run-phase environment. Do expensive run-phase environment initialisation now (e.g. GUI construction). EVENT_RUN_RESUME Execution is moving from pause state to run state. EVENT_RUN_SERVICE The Engine requests the process to service its interfaces. EVENT_RUN_PAUSE Execution is moving from run state to pause state. EVENT_RUN_STOP The process is running in its run-phase environment for the last time. Do expensive run-phase environment termination now (e.g. GUI deconstruction). DataWarnings
FrameworkThis interface is used exclusively by the framework to access the functionality of Data objects. EVENT_LOG_SERVICE The component has just been written and should log its current state into its log. Note that a process should service its log, if keeping one, during EVENT_RUN_SERVICE. EVENT_CONTENT_SET Set data content from a byte stream (i.e. EVENT_CONTENT_GET Retrieve data content as a byte stream (i.e. NativeThis interface is used by native Process objects to access the functionality of Data objects. All Data objects will fill this interface with events that allow access to their state in a structured way. Note that Datas should define inline accessors in the header file that simplify use of this interface from C++, so C++ Processes should never need to fire these events directly. GenericThis interface is used by non-native Process objects to access the functionality of Data objects. This interface will be used exclusively by language bindings, and Data access will be translated for non-native Processes by the bindings onto an interface appropriate for the language. We describe the complete state of any component using the term "State". Data objects have, in addition, a distinction made between their "Structure" (that which does not change over time) and their "Content" (that which does). EVENT_GENERIC_STRUCTURE_GET Return the state structure as a string. EVENT_GENERIC_STRUCTURE_SET Set the state structure from a string. EVENT_GENERIC_FORM_ADVANCE Return the form of the "generic" representation of the state content in advance. EVENT_GENERIC_FORM_CURRENT Return the form of the "generic" representation of the current state content. EVENT_GENERIC_CONTENT_GET Return the "generic" representation of the current state content. EVENT_GENERIC_CONTENT_SET Set the current state content from the "generic" representation. Utility onlyWarnings
FrameworkUtility objects have no framework interface, since the framework does not need to call them. NativeThis interface is used by native Components to access the functionality of Utility objects. All Utility objects will fill this interface with events that allow access to their functionality in a structured way. Note that Utilities should define inline accessors in the header file that simplify use of this interface from C++, so C++ Processes should never need to fire these events directly. GenericThis interface is used by non-native Components to access the functionality of Utility objects. This interface will be used exclusively by language bindings, and Utility functionality will be translated for non-native Processes by the bindings onto an interface appropriate for the language. EVENT_FUNCTION_GET The utility object should return usage information for the specified utility function. EVENT_FUNCTION_CALL The utility object should provide functionality by servicing this event. |
||
This is a documentation page for the BRAHMS Modular Execution (Simulation) Framework. For details of licensing and distribution, please click here. To advise of an error or omission, please click here. |