MPD: Java::GlobalRef< T > Class Template Reference

MPD 0.20.18

Public Member Functions
Java::GlobalRef< T > Class Template Reference

Hold a global reference on a JNI object. More...

`#include <Ref.hxx>`

## Public Member Functions
| GlobalRef ()=default
| Constructs an uninitialized object. More...
| GlobalRef (JNIEnv *env, T _value)
| ~GlobalRef ()
| GlobalRef (const GlobalRef &other)=delete
GlobalRef & | operator= (const GlobalRef &other)=delete
void | Set (JNIEnv *env, T _value)
| Sets the object, ignoring the previous value. More...
T | Get () const
| operator T () const

## Detailed Description

### template<typename T>
class Java::GlobalRef< T >

Hold a global reference on a JNI object.

Definition at line 77 of file Ref.hxx.

## Constructor & Destructor Documentation

## ◆ GlobalRef() [1/3]

template<typename T>

Java::GlobalRef< T >::GlobalRef | ( |  | ) |
| default

Constructs an uninitialized object.

The method set() must be called before it is destructed.

## ◆ GlobalRef() [2/3]

template<typename T>

Java::GlobalRef< T >::GlobalRef | ( | JNIEnv * | env,
|  | T | _value
| ) |  |
| inline

Definition at line 87 of file Ref.hxx.

## ◆ ~GlobalRef()

template<typename T>

Java::GlobalRef< T >::~GlobalRef | ( |  | ) |
| inline

Definition at line 94 of file Ref.hxx.

## ◆ GlobalRef() [3/3]

template<typename T>

Java::GlobalRef< T >::GlobalRef | ( | const GlobalRef< T > & | other | ) |
| delete

## Member Function Documentation

## ◆ Get()

template<typename T>

T Java::GlobalRef< T >::Get | ( |  | ) | const
| inline

Definition at line 111 of file Ref.hxx.

## ◆ operator T()

template<typename T>

Java::GlobalRef< T >::operator T | ( |  | ) | const
| inline

Definition at line 115 of file Ref.hxx.

## ◆ operator=()

template<typename T>

GlobalRef& Java::GlobalRef< T >::operator= | ( | const GlobalRef< T > & | other | ) |
| delete

## ◆ Set()

template<typename T>

void Java::GlobalRef< T >::Set | ( | JNIEnv * | env,
|  | T | _value
| ) |  |
| inline

Sets the object, ignoring the previous value.

This is only allowed once after the default constructor was used.

Definition at line 105 of file Ref.hxx.

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

- java/Ref.hxx