MPD  0.20.6
Public Member Functions
Java::TrivialRef< T > Class Template Reference

Container for a global reference to a JNI object that gets initialised and deinitialised explicitly. More...

#include <Ref.hxx>

Public Member Functions

constexpr TrivialRef ()
 
 TrivialRef (const TrivialRef &other)=delete
 
TrivialRefoperator= (const TrivialRef &other)=delete
 
bool IsDefined () const
 
void Set (JNIEnv *env, T _value)
 Obtain a global reference on the specified object and store it. More...
 
void Clear (JNIEnv *env)
 Release the global reference and clear this object. More...
 
void ClearOptional (JNIEnv *env)
 Release the global reference and clear this object. More...
 
Get () const
 
 operator T () const
 

Detailed Description

template<typename T>
class Java::TrivialRef< T >

Container for a global reference to a JNI object that gets initialised and deinitialised explicitly.

Since there is no implicit initialisation in the default constructor, this is a trivial C++ class. It should only be used for global variables that are implicitly initialised with zeroes.

Definition at line 128 of file Ref.hxx.

Constructor & Destructor Documentation

template<typename T>
constexpr Java::TrivialRef< T >::TrivialRef ( )
inline

Definition at line 132 of file Ref.hxx.

template<typename T>
Java::TrivialRef< T >::TrivialRef ( const TrivialRef< T > &  other)
delete

Member Function Documentation

template<typename T>
void Java::TrivialRef< T >::Clear ( JNIEnv *  env)
inline

Release the global reference and clear this object.

Definition at line 155 of file Ref.hxx.

template<typename T>
void Java::TrivialRef< T >::ClearOptional ( JNIEnv *  env)
inline

Release the global reference and clear this object.

It is allowed to call this method without ever calling Set().

Definition at line 166 of file Ref.hxx.

template<typename T>
T Java::TrivialRef< T >::Get ( ) const
inline

Definition at line 171 of file Ref.hxx.

template<typename T>
bool Java::TrivialRef< T >::IsDefined ( ) const
inline

Definition at line 137 of file Ref.hxx.

template<typename T>
Java::TrivialRef< T >::operator T ( ) const
inline

Definition at line 175 of file Ref.hxx.

template<typename T>
TrivialRef& Java::TrivialRef< T >::operator= ( const TrivialRef< T > &  other)
delete
template<typename T>
void Java::TrivialRef< T >::Set ( JNIEnv *  env,
_value 
)
inline

Obtain a global reference on the specified object and store it.

This object must not be set already.

Definition at line 145 of file Ref.hxx.


The documentation for this class was generated from the following file: