32 #include <com/avpkit/ferry/Ferry.h>
34 namespace com {
namespace avpkit {
namespace ferry {
102 virtual int32_t acquire();
118 virtual int32_t release();
152 virtual int32_t getCurrentRefCount();
165 void setJavaAllocator(
void* allocator);
171 void* getJavaAllocator();
179 virtual void destroy();
196 #define VS_JNIUTILS_REFCOUNTED_MAKE(__class) \
197 static __class* make() { \
198 __class *obj = new __class(); \
200 (void) obj->acquire(); \
202 throw std::bad_alloc(); \
207 __class &operator=(const __class &); \
208 __class(const __class &); \
209 static void * operator new (size_t aSize) { return ::operator new(aSize); }
211 #define VS_JNIUTILS_REFCOUNTED_OBJECT(__class) \
213 VS_JNIUTILS_REFCOUNTED_MAKE(__class) \
216 #define VS_JNIUTILS_REFCOUNTED_OBJECT_PRIVATE_MAKE(__className) \
218 VS_JNIUTILS_REFCOUNTED_MAKE(__className) \
223 #define VS_REF_ACQUIRE(__object) \
226 (__object)->acquire(); \
230 #define VS_REF_RELEASE(__object) \
233 (__object)->release(); \
Parent of all Ferry objects – it mains reference counts in native code.
void * mAllocator
Not part of public API.
AtomicInteger * mRefCount
This is the internal reference count, represented as an AtomicInteger to make sure it is thread safe.
WARNING: Do not use logging in this class, and do not set any static file variables to values other t...