#include <shared_ref.h>
Public Types | |
typedef JniType ThisType::* | UnspecifiedBoolType |
Public Member Functions | |
shared_ref () | |
Construct a default shared_ref with a null raw JNI pointer. | |
shared_ref (AZStd::nullptr_t) | |
Explicit construction of shared_ref with a null raw JNI pointer. | |
shared_ref (JniType javaObject) | |
template<typename Allocator > | |
shared_ref (JniType javaObject, const Allocator &allocator) | |
shared_ref (const shared_ref &rhs) | |
template<typename Y > | |
shared_ref (const shared_ref< Y > &rhs, typename AZStd::enable_if< AZStd::is_convertible< Y, JniType >::value, Y >::type=AZStd::nullptr_t()) | |
shared_ref (shared_ref &&rhs) | |
template<typename Y > | |
shared_ref (shared_ref< Y > &&rhs) | |
shared_ref & | operator= (const shared_ref &rhs) |
template<typename Y > | |
shared_ref & | operator= (const shared_ref< Y > &rhs) |
shared_ref & | operator= (shared_ref &&rhs) |
template<typename Y > | |
shared_ref & | operator= (shared_ref< Y > &&rhs) |
template<typename Y > | |
bool | operator== (const shared_ref< Y > &rhs) const |
template<typename Y > | |
bool | operator!= (const shared_ref< Y > &rhs) const |
bool | operator! () const |
operator UnspecifiedBoolType () const | |
JniType | get () const |
bool | unique () const |
long | use_count () const |
Get the number of reference held on the raw JNI pointer. | |
void | swap (shared_ref &lhs) |
void | reset () |
Default reset of the internal reference to nullptr. | |
void | reset (JniType javaObject) |
A shared_ref works in the same way a AZStd::shared_ptr except it's specificially designed for the opaque pointer JNI types (e.g. jobject, jarray, etc.). Guarantees the java object is released from the JNI environment once the last shared_ref pointing to is released.
|
inlineexplicit |
Only allow explicit construction from the raw pointer to the java object reference. Will use the AZ::SytemAllocator for the shared count allocations
javaObject | Raw pointer to the java object. Currently only supports Local and Global reference types. Weak Global reference are NOT supported. |
|
inline |
Create a shared_ref with a custom allocator. NOTE: The custom allocator is only used for allocating the shared_count
javaObject | Raw pointer to the java object. Currently only supports Local and Global reference types. Weak Global reference are NOT supported. |
allocator | Custom allocator for usage within the shared count. |
|
inlineexplicit |
Make a copy of the shared_ref, increase the reference count
rhs | The shared_ref to copy |
|
inline |
Polymorphic copy of a shared_ref
rhs | The shared_ref of a derived JNI pointer type to be copied |
|
inline |
Move the shared_ref from one shared_ref to another, Ctor
rhs | The shared_ref to be moved |
|
inline |
Polymorphic move the shared_ref from one shared_ref to another, Ctor
rhs | The shared_ref to be moved |
|
inline |
Explicit accessor of the raw pointer to the java reference.
|
inline |
Operator for implicit bool conversions
|
inline |
Compatibilty with the 'not' operator for validity checks. Only checkes for raw pointer validity, NOT if it's pointing to a null reference (weak global ref).
|
inline |
Determine if two shared_refs are not the same
rhs | The shared_ref to compare against, may be of another JNI pointer type |
|
inline |
Make a copy of the shared_ref, increase the reference count
rhs | The shared_ref to copy |
|
inline |
Make a polymorphic copy of the shared_ref, increase the reference count
rhs | The shared_ref to copy |
|
inline |
Move the shared_ref from one shared_ref to another
rhs | The shared_ref to be moved |
|
inline |
Polymorphic move of a shared_ref from one shared_ref to another
rhs | The shared_ref to be moved |
|
inline |
Determine if two shared_refs are the same
rhs | The shared_ref to compare against, may be of another JNI pointer type |
|
inline |
Reset the internal reference with a new pointer
javaObject | Raw pointer to the java object. Must be of same type. |
|
inline |
Swap the internal reference with another shared_ref of the same type
lhs | The shared_ref (of same type) to be swaped with |
|
inline |
Check to see if the shared_ref is the only one holding on to the raw JNI pointer