neuray Services API Programmer's Manual

mi::nservices::Event_helper Class Reference

[Events]

Description

A helper class to facilitate event creation and sending.

Static Public Member Functions

static IEventcreate_event( IEvent_context* event_context, const base::Uuid& event_id)
Creates an event. More...
static mi::Sint32 send_event( IEvent_context* event_context, const base::Uuid& event_id, Uint32 event_argc = 0, base::IInterface* event_argv = NULL)
Sends an event. More...

Member Functions

static IEvent* mi::​nservices::​Event_helper::create_event( IEvent_context* event_context, const base::Uuid& event_id) [inline, static]

Creates an event.

Parameters

event_context
A valid event context.
event_id
The id of the event.

Returns

The new event or null on error.

static mi::Sint32 mi::​nservices::​Event_helper::send_event( IEvent_context* event_context, const base::Uuid& event_id, Uint32 event_argc = 0, base::IInterface* event_argv = NULL) [inline, static]

Sends an event.

Parameters

event_context
The event context to use.
event_id
The id of the event to send.
event_argc
The number of elements in event_argv
event_argv
The array of arguments passed to the event. These arguments should be place in the array in the order specified by the event.

Returns

the return value of the last event handler or one of the following errors:

  • NRS_ERROR_MEMORY : out of memory.
  • NRS_ERROR_INVALID_PARAMETERS : event_context is NULL.
  • NRS_ERROR_EVENT_NO_HANDLERS : no handlers registered for this event type.
  • NRS_ERROR_FAILED : internal error.