Struct ocl::EventList
[−]
[src]
pub struct EventList { /* 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 push(&mut self, event: Event)
Adds an event to the list.
fn pop(&mut self) -> Option<Event>
Removes the last event from the list and returns it.
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<()>
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 is_empty(&self) -> bool
Returns if there is no events.
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>
fn push(&mut self, event: Event)
Pushes a new event onto the list.
Technically, copies event's contained pointer (a cl_event) then
mem::forgets it. This seems preferrable to incrementing the reference
count (with functions::retain_event) then letting event drop which just decrements it right back.
fn pop(&mut self) -> Option<Result<Event, Error>>
Removes the last event from the list and returns it.
fn allot(&mut self) -> &mut *mut c_void
Appends a new null element to the end of the list and returns a reference to it.
fn len(&self) -> usize
fn is_empty(&self) -> bool
fn count(&self) -> u32
unsafe fn as_ptr_ref(&self) -> &*mut c_void
Returns an immutable reference to a pointer, do not deref and store it unless you will manage its associated reference count carefully.
fn get_clone(&self, index: usize) -> Option<Result<Event, Error>>
Clones an event by index.
fn last_clone(&self) -> Option<Result<Event, Error>>
Clones the last event.
fn clear_completed(&mut self) -> Result<(), Error>
Clears each completed event from the list.
TODO: TEST THIS
Trait Implementations
impl Debug for EventList[src]
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 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