com.jogamp.opencl
Class CLEventList

java.lang.Object
  extended by com.jogamp.opencl.CLEventList
All Implemented Interfaces:
AutoCloseable, CLResource, Iterable<CLEvent>

public final class CLEventList
extends Object
implements CLResource, AutoCloseable, Iterable<CLEvent>

Fixed size list for storing CLEvents.

Author:
Michael Bien, et al.

Constructor Summary
CLEventList(CachedBufferFactory factory, CLEvent... events)
           
CLEventList(CachedBufferFactory factory, int capacity)
           
CLEventList(CLEvent... events)
           
CLEventList(int capacity)
           
 
Method Summary
 int capacity()
          Returns the maximum size of this list.
 void close()
          Deprecated. use release() instead.
 CLEvent getEvent(int index)
           
 boolean isReleased()
          Returns true if CLResource.release() has been called.
 Iterator<CLEvent> iterator()
           
 void release()
          Releases all CLEvents in this list.
 int size()
          Returns the current size of this list.
 String toString()
           
 void waitForEvent(int index)
          Waits for the event with the given index in this list to occur.
 void waitForEvents()
          Waits for all events in this list to occur.
 void waitForEvents(int start, int range)
          Waits for all events of the specified region in this list to occur.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CLEventList

public CLEventList(int capacity)

CLEventList

public CLEventList(CLEvent... events)

CLEventList

public CLEventList(CachedBufferFactory factory,
                   int capacity)

CLEventList

public CLEventList(CachedBufferFactory factory,
                   CLEvent... events)
Method Detail

waitForEvents

public void waitForEvents()
Waits for all events in this list to occur. If this list is empty this method won't do anything.


waitForEvents

public void waitForEvents(int start,
                          int range)
Waits for all events of the specified region in this list to occur. Will throw IndexOutOfBoundsException if indices are out of bounds.


waitForEvent

public void waitForEvent(int index)
Waits for the event with the given index in this list to occur.


release

public void release()
Releases all CLEvents in this list.

Specified by:
release in interface CLResource

close

@Deprecated
public final void close()
                 throws Exception
Deprecated. use release() instead.

Specified by:
close in interface AutoCloseable
Throws:
Exception

getEvent

public CLEvent getEvent(int index)

size

public int size()
Returns the current size of this list.


capacity

public int capacity()
Returns the maximum size of this list.


isReleased

public boolean isReleased()
Description copied from interface: CLResource
Returns true if CLResource.release() has been called.

Specified by:
isReleased in interface CLResource

iterator

public Iterator<CLEvent> iterator()
Specified by:
iterator in interface Iterable<CLEvent>

toString

public String toString()
Overrides:
toString in class Object