libcommonc++
0.7
|
A convenience class for creating lexical Java scopes in native code. More...
#include <JavaScope.h++>
Public Member Functions | |
JavaScope (JavaContext &context, int capacity) | |
Construct a new JavaScope for the given JavaContext and local reference capacity. More... | |
~JavaScope () | |
Destructor. More... | |
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.
|
inline |
Construct a new JavaScope for the given JavaContext and local reference capacity.
A new stack frame is created in the JVM.
|
inline |
Destructor.
Pops the stack frame.