libcommonc++  0.7
JavaThreadLocalBuffer Class Reference

Thread-local Java direct buffer. More...

#include <JavaThreadLocalBuffer.h++>

Inheritance diagram for JavaThreadLocalBuffer:
Collaboration diagram for JavaThreadLocalBuffer:

Public Member Functions

 JavaThreadLocalBuffer (JavaVirtualMachine *jvm, size_t size)
 Construct a new ThreadLocalJavaBuffer with the given size. More...
 
 ~JavaThreadLocalBuffer ()
 Destructor. More...
 
JavaBufferoperator* ()
 Pointer-dereference operator. More...
 
JavaBufferoperator-> ()
 Pointer operator. More...
 
void setValue (JavaBuffer *value)
 Set the value of the thread-local object for the calling thread. More...
 
JavaBuffergetValue ()
 Get the value of the thread-local object for the calling thread. More...
 

Static Public Member Functions

static int getSlotCount ()
 Get the maximum number of thread-local storage slots available on this platform. More...
 

Protected Member Functions

JavaBufferinitialValue ()
 Provide the intial value of the thread-local object for the calling thread. More...
 

Detailed Description

Thread-local Java direct buffer.

The buffer exists as a separate instance for each calling thread.

Author
Mark Lindner

Constructor & Destructor Documentation

◆ JavaThreadLocalBuffer()

JavaThreadLocalBuffer ( JavaVirtualMachine jvm,
size_t  size 
)

Construct a new ThreadLocalJavaBuffer with the given size.

Parameters
jvmThe Java Virtual Machine in which to create the buffer.
sizeThe size of the buffer, in bytes.

◆ ~JavaThreadLocalBuffer()

Destructor.

Member Function Documentation

◆ getSlotCount()

static int getSlotCount ( )
staticinherited

Get the maximum number of thread-local storage slots available on this platform.

A return value of -1 indicates that there is no limit.

◆ getValue()

JavaBuffer * getValue ( )
inherited

Get the value of the thread-local object for the calling thread.

Returns
The current (possibly NULL) value.

◆ initialValue()

JavaBuffer * initialValue ( )
protectedvirtual

Provide the intial value of the thread-local object for the calling thread.

The default implementation returns NULL.

Returns
The initial value.

Reimplemented from ThreadLocal< JavaBuffer >.

◆ operator*()

JavaBuffer & operator* ( )
inherited

Pointer-dereference operator.

Returns
A reference to the thread-local object.
Exceptions
NullPointerExceptionIf the value of the object was never initialized for the calling thread.

◆ operator->()

JavaBuffer * operator-> ( )
inherited

Pointer operator.

Returns
A pointer to the thread-local object.
Exceptions
NullPointerExceptionIf the value of the object was never initialized for the calling thread.

◆ setValue()

void setValue ( JavaBuffer value)
inherited

Set the value of the thread-local object for the calling thread.

Parameters
valueThe new value.

The documentation for this class was generated from the following files: