Codemesh Runtime v3 C++ API Reference
3.9.205
|
5 #ifndef xmogRemoteRefMapInc
6 #define xmogRemoteRefMapInc
12 #if (XMOG_IMPLEMENTS_REMOTE_CLIENT==1)
15 #include "ace/Map_Manager.h"
16 #include "ace/Recursive_Thread_Mutex.h"
17 #include "ace/Null_Mutex.h"
28 xmog_remote_ref(
void * data = NULL,
size_t size = (
size_t)-1 ) : refCount_( 1 ), data_( data ), size_( size ) {}
34 void inc() { refCount_++; };
35 jint dec() {
return --refCount_; }
36 size_t size()
const {
return size_; }
37 void * data()
const {
return data_; }
50 typedef ACE_Map_Manager<Key,Value,ACE_Null_Mutex> ObjectFrame;
54 ObjectFrame * globals_;
58 ObjectFrame * weak_globals_;
60 bool bOwnsWeakGlobals_;
62 ObjectFrame * locals_;
80 int get_data( jobject _ref,
void ** pData,
size_t * pLength );
92 jobject
new_global( jobject _ref,
void * data = NULL,
size_t size = 0 );
104 jobject
new_local( jobject _ref,
void * data = NULL,
size_t size = 0 );
116 jobject
new_weakglobal( jobject _ref,
void * data = NULL,
size_t size = 0 );
Definition: xmog_remote_ref_map.h:20
jobject new_global(jobject _ref, void *data=NULL, size_t size=0)
Adds a global reference to the map.
int delete_global(jobject _ref)
Deletes a global reference from the map.
jobject new_weakglobal(jobject _ref, void *data=NULL, size_t size=0)
Adds a weak global reference to the map.
A utility class that tracks remote object references with a reference count.
Definition: xmog_remote_ref_map.h:44
int get_data(jobject _ref, void **pData, size_t *pLength)
Returns the cached data associated with a reference.
xmog_remote_ref_map(xmog_remote_ref_map *parentFrame)
Constructs a reference map.
jobject new_local(jobject _ref, void *data=NULL, size_t size=0)
Adds a local reference to the map.
int delete_local(jobject _ref)
Deletes a local reference from the map.
xmog_remote_ref_map * pop_frame()
Pops a frame from the stack and returns the parent frame.
xmog_remote_ref_map * push_frame()
Pushes a new frame on the stack and returns the new frame.
int delete_weakglobal(jobject _ref)
Deletes a weak global reference from the map.
Copyright (c) 1999-2020 by Codemesh, Inc., ALL RIGHTS RESERVED.