com.jogamp.common.nio
Class PointerBuffer

java.lang.Object
  extended by com.jogamp.common.nio.AbstractBuffer<B>
      extended by com.jogamp.common.nio.AbstractLongBuffer<PointerBuffer>
          extended by com.jogamp.common.nio.PointerBuffer
All Implemented Interfaces:
NativeBuffer<PointerBuffer>

public abstract class PointerBuffer
extends AbstractLongBuffer<PointerBuffer>

Hardware independent container for native pointer arrays. The native values (NIO direct ByteBuffer) might be 32bit or 64bit wide, depending of the CPU pointer width.

Author:
Michael Bien, Sven Gothel

Field Summary
protected  HashMap<Long,Buffer> dataMap
           
 
Fields inherited from class com.jogamp.common.nio.AbstractLongBuffer
backup
 
Fields inherited from class com.jogamp.common.nio.AbstractBuffer
bb, capacity, position
 
Constructor Summary
protected PointerBuffer(ByteBuffer bb)
           
 
Method Summary
static PointerBuffer allocate(int size)
           
static PointerBuffer allocateDirect(int size)
           
static int elementSize()
           
 Buffer getReferencedBuffer()
           
 Buffer getReferencedBuffer(int index)
           
 PointerBuffer put(PointerBuffer src)
          Relative bulk get method.
 PointerBuffer referenceBuffer(Buffer bb)
          Put the address of the given direct Buffer at the end of this pointer array.
 PointerBuffer referenceBuffer(int index, Buffer bb)
          Put the address of the given direct Buffer at the given position of this pointer array.
 String toString()
           
static PointerBuffer wrap(ByteBuffer src)
           
 
Methods inherited from class com.jogamp.common.nio.AbstractLongBuffer
array, get, get, get, hasArray, put, put, put
 
Methods inherited from class com.jogamp.common.nio.AbstractBuffer
arrayOffset, capacity, getBuffer, hasRemaining, isDirect, limit, position, position, remaining, rewind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dataMap

protected HashMap<Long,Buffer> dataMap
Constructor Detail

PointerBuffer

protected PointerBuffer(ByteBuffer bb)
Method Detail

allocate

public static PointerBuffer allocate(int size)

allocateDirect

public static PointerBuffer allocateDirect(int size)

wrap

public static PointerBuffer wrap(ByteBuffer src)

elementSize

public static int elementSize()

put

public final PointerBuffer put(PointerBuffer src)
Description copied from class: AbstractLongBuffer
Relative bulk get method. Copy the source values src[position .. capacity] [ to this buffer and increment the position by capacity-position.

Specified by:
put in interface NativeBuffer<PointerBuffer>
Overrides:
put in class AbstractLongBuffer<PointerBuffer>

referenceBuffer

public final PointerBuffer referenceBuffer(int index,
                                           Buffer bb)
Put the address of the given direct Buffer at the given position of this pointer array. Adding a reference of the given direct Buffer to this object.


referenceBuffer

public final PointerBuffer referenceBuffer(Buffer bb)
Put the address of the given direct Buffer at the end of this pointer array. Adding a reference of the given direct Buffer to this object.


getReferencedBuffer

public final Buffer getReferencedBuffer(int index)

getReferencedBuffer

public final Buffer getReferencedBuffer()

toString

public String toString()
Overrides:
toString in class AbstractBuffer<PointerBuffer>