Top Description Inners Fields Constructors Methods
com.jogamp.opencl

public final Class CLEventList

extends Object
implements CLResource, AutoCloseable, Iterable<CLEvent>
Class Inheritance
All Implemented Interfaces
java.lang.Iterable, com.jogamp.opencl.AutoCloseable, com.jogamp.opencl.CLResource
Imports
com.jogamp.common.nio.CachedBufferFactory, .PointerBuffer, java.util.Iterator

Fixed size list for storing CLEvents.
Author
Michael Bien, et al.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final CLEvent[]
pack-priv final PointerBuffer
IDs

stores event ids for fast access.

pack-priv final PointerBuffer
IDsView

Points always to the first element of the id buffer.

pack-priv int

Constructor Summary

AccessConstructor and Description
public
CLEventList(final int capacity)

public
CLEventList(final CLEvent... events)

public
CLEventList(final CachedBufferFactory factory, final int capacity)

public
CLEventList(final CachedBufferFactory factory, final CLEvent... events)

Method Summary

Modifier and TypeMethod and Description
public int
capacity()

Returns the maximum size of this list.

public final void
close()

Implements com.jogamp.opencl.AutoCloseable.close.

Deprecated use release() instead.
pack-priv void
createEvent(final CLContext context)

public CLEvent
getEvent(final int index)

pack-priv PointerBuffer
getEventBuffer(final int index)

private PointerBuffer
initIDBuffer(final CachedBufferFactory factory, final int size)

public boolean
isReleased()

Implements com.jogamp.opencl.CLResource.isReleased.

Returns true if release() has been called.
public Iterator<CLEvent>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.
public void
release()

Implements com.jogamp.opencl.CLResource.release.

Releases all CLEvents in this list.
public int
size()

Returns the current size of this list.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public void
waitForEvent(final int index)

Waits for the event with the given index in this list to occur.

public void
waitForEvents()

Waits for all events in this list to occur.

public void
waitForEvents(final int start, final int range)

Waits for all events of the specified region in this list to occur.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

eventsback to summary
private final CLEvent[] events
IDsback to summary
pack-priv final PointerBuffer IDs

stores event ids for fast access.

IDsViewback to summary
pack-priv final PointerBuffer IDsView

Points always to the first element of the id buffer.

sizeback to summary
pack-priv int size

Constructor Detail

CLEventListback to summary
public CLEventList(final int capacity)
CLEventListback to summary
public CLEventList(final CLEvent... events)
CLEventListback to summary
public CLEventList(final CachedBufferFactory factory, final int capacity)
CLEventListback to summary
public CLEventList(final CachedBufferFactory factory, final CLEvent... events)

Method Detail

capacityback to summary
public int capacity()

Returns the maximum size of this list.

closeback to summary
public final void close()

Implements com.jogamp.opencl.AutoCloseable.close.

Deprecated

use release() instead.

Annotations
@Deprecated
@Override
createEventback to summary
pack-priv void createEvent(final CLContext context)
getEventback to summary
public CLEvent getEvent(final int index)
getEventBufferback to summary
pack-priv PointerBuffer getEventBuffer(final int index)
initIDBufferback to summary
private PointerBuffer initIDBuffer(final CachedBufferFactory factory, final int size)
isReleasedback to summary
public boolean isReleased()

Implements com.jogamp.opencl.CLResource.isReleased.

Doc from com.jogamp.opencl.CLResource.isReleased.

Returns true if release() has been called.

iteratorback to summary
public Iterator<CLEvent> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<CLEvent>

an Iterator.

Annotations
@Override
releaseback to summary
public void release()

Implements com.jogamp.opencl.CLResource.release.

Releases all CLEvents in this list.

Annotations
@Override
sizeback to summary
public int size()

Returns the current size of this list.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
waitForEventback to summary
public void waitForEvent(final int index)

Waits for the event with the given index in this list to occur.

waitForEventsback to summary
public void waitForEvents()

Waits for all events in this list to occur. If this list is empty this method won't do anything.

waitForEventsback to summary
public void waitForEvents(final int start, final int range)

Waits for all events of the specified region in this list to occur. Will throw IndexOutOfBoundsException if indices are out of bounds.

com.jogamp.opencl back to summary

private Class CLEventList.EventIterator

extends Object
implements Iterator<CLEvent>
Class Inheritance
All Implemented Interfaces
java.util.Iterator

Field Summary

Modifier and TypeField and Description
private final CLEvent[]
private int
private final int

Constructor Summary

AccessConstructor and Description
private
EventIterator(final CLEvent[] events, final int size)

Method Summary

Modifier and TypeMethod and Description
public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.
public CLEvent
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.
public void
remove()

Overrides default java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation).
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

eventsback to summary
private final CLEvent[] events
indexback to summary
private int index
sizeback to summary
private final int size

Constructor Detail

EventIteratorback to summary
private EventIterator(final CLEvent[] events, final int size)

Method Detail

hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:boolean

true if the iteration has more elements

Annotations
@Override
nextback to summary
public CLEvent next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Returns:CLEvent

the next element in the iteration

Annotations
@Override
removeback to summary
public void remove()

Overrides default java.util.Iterator.remove.

Doc from java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation). This method can be called only once per call to next.

The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.

The behavior of an iterator is unspecified if this method is called after a call to the forEachRemaining method.

Annotations
@Override