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. | |
| ~JavaScope () | |
| Destructor. | |
| bool | testOnce () throw () |
| For internal use only. | |
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.
| 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.
| bool testOnce | ( | ) | throw () [inline] |
For internal use only.
1.6.3