An abstract interface for a program's event handling infrastructure.
An NvSciEventService is an abstraction that a library can use to interact with the event handling infrastructure of the containing program.
If a library needs to handle asynchronous events or report asynchronous events to its users, but the library does not wish to impose a threading model on its users, the library can require each user to provide an NvSciEventService when the user initializes the library (or a portion thereof).
An NvSciEventService provides two categories of services related to event handling:
(1) The ability to define "event notifiers", which are objects that can notify event handling infrastructure each time an event has occurred. Note that event notifications carry no payload; it is expected that any event payload information is conveyed separately.
(2) The ability to bind an "event handler" to each event notifier. An event handler is essentially a callback that is invoked each time the bound event notifier reports the occurrence of an event.
Definition at line 281 of file nvscievent.h.
Data Fields | |
NvSciError(* | CreateLocalEvent )(NvSciEventService *thisEventService, NvSciLocalEvent **newLocalEvent) |
Creates an intra-process local event with an event notifier that reports each event signaled through it. More... | |
void(* | Delete )(NvSciEventService *thisEventService) |
Releases any resources associated with this event service. More... | |
NvSciError(* NvSciEventService::CreateLocalEvent) (NvSciEventService *thisEventService, NvSciLocalEvent **newLocalEvent) |
Creates an intra-process local event with an event notifier that reports each event signaled through it.
[in] | thisEventService | NvSciEventService object pointer created by NvSciEventLoopServiceCreateSafe(). |
[out] | newLocalEvent | NvSciLocalEvent object pointer on success. |
Usage considerations
Definition at line 365 of file nvscievent.h.
void(* NvSciEventService::Delete) (NvSciEventService *thisEventService) |
Releases any resources associated with this event service.
Before this member function is called, the caller must ensure that all other member function calls on thisEventService have completed and the caller must never again invoke any member functions on thisEventService.
If there any NvSciEventNotifier objects created from this event service that have not been deleted yet, the resources allocated for this event service will not necessarily be released until all those NvSciEventNotifier objects are first deleted.
There may also be implementation-specific conditions that result in a delay in the release of resources.
Release resources associated with NvSciEventService and NvSciEventService which is created by NvSciEventLoopServiceCreateSafe().
[in] | thisEventService | NvSciEventService object pointer created by NvSciEventLoopServiceCreateSafe(). |
Usage considerations
Definition at line 426 of file nvscievent.h.