JavaScope Class Reference

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

#include <JavaScope.h++>

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.

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.


The documentation for this class was generated from the following file:
Generated on Sat Nov 26 16:49:09 2011 for libcommonc++ by  doxygen 1.6.3