JavaScope Class Reference

A convenience class for creating lexical Java scopes in native code. More...

#include <JavaScope.h++>

Collaboration diagram for JavaScope:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 JavaScope (JavaContext &context, int capacity)
 Construct a new JavaScope for the given JavaContext and local reference capacity.
 ~JavaScope ()
 Destructor.
bool testOnce () throw ()
 For internal use only.

Detailed Description

A convenience class for creating lexical Java scopes in native code.

JavaScope creates a new JVM stack frame in its constructor and releases it in its destructor.

A block of code can be conveniently wrapped in a new scope by using the java_scoped() macro, as follows:

 JavaContext ctx = ...;
 int capacity = ...;
 java_scoped(ctx, capacity)
 {
   // scoped code here
 }
 

With this approach, any Java local references that are created within the scoped block will be automatically freed when control leaves the block.

Author:
Mark Lindner

Constructor & Destructor Documentation

JavaScope ( JavaContext context,
int  capacity 
) [inline]

Construct a new JavaScope for the given JavaContext and local reference capacity.

A new stack frame is created in the JVM.

~JavaScope (  )  [inline]

Destructor.

Pops the stack frame.


Member Function Documentation

bool testOnce (  )  throw () [inline]

For internal use only.


The documentation for this class was generated from the following file:
Generated on Fri Sep 3 23:49:36 2010 for libcommonc++ by  doxygen 1.6.3