Struct ocl::EventList [] [src]

pub struct EventList {
    // some fields omitted
}

A list of events for coordinating enqueued commands.

Events contain status information about the command that created them. Used to coordinate the activity of multiple commands with more fine-grained control than the queue alone.

For access to individual events use get_clone and last_clone then either store or discard the result.

Methods

impl EventList
[src]

fn new() -> EventList

Returns a new, empty, EventList.

fn get_clone(&self, index: usize) -> Option<Event>

Returns a new copy of an event by index.

fn last_clone(&self) -> Option<Event>

Returns a copy of the last event in the list.

unsafe fn set_callback<T>(&self, callback_receiver: Option<EventCallbackFn>, user_data: &mut T) -> OclResult<()>

Sets a callback function, callback_receiver, to trigger upon completion of the last event added to the event list with an optional reference to user data.

Safety

user_data must be guaranteed to still exist if and when callback_receiver is ever called.

TODO: Create a safer type wrapper for callback_receiver. TODO: Move this method to Event.

fn len(&self) -> usize

Returns the number of events in the list.

fn core_as_ref(&self) -> &EventListCore

fn core_as_mut(&mut self) -> &mut EventListCore

fn wait(&self) -> OclResult<()>

Waits for all events in list to complete.

Methods from Deref<Target=EventListCore>

unsafe fn push(&mut self, event: Event)

Pushes a new event onto the list.

Technically, copies events contained pointer (a cl_event) then mem::forgets it. This seems preferrable to incrementing the reference count (with core::retain_event) then letting event drop which just decrements it right back.

fn allot(&mut self) -> &mut cl_event

Appends a new null element to the end of the list and returns a reference to it.

fn len(&self) -> usize

fn count(&self) -> u32

unsafe fn as_ptr_ptr(&self) -> *const cl_event

fn get_clone(&self, index: usize) -> Option<OclResult<Event>>

Clones an event by index.

fn last_clone(&self) -> Option<OclResult<Event>>

Clones the last event.

fn clear_completed(&mut self) -> OclResult<()>

Clears each completed event from the list.

TODO: TEST THIS

Trait Implementations

impl Clone for EventList
[src]

fn clone(&self) -> EventList

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Debug for EventList
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl AsRef<EventListCore> for EventList
[src]

fn as_ref(&self) -> &EventListCore

Performs the conversion.

impl Deref for EventList
[src]

type Target = EventListCore

The resulting type after dereferencing

fn deref(&self) -> &EventListCore

The method called to dereference a value

impl DerefMut for EventList
[src]

fn deref_mut(&mut self) -> &mut EventListCore

The method called to mutably dereference a value

impl ClEventPtrNew for EventList
[src]