Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
#include <AddonClass.h>
Public Member Functions | |
Ref () | |
Ref (const T *_ac) | |
Ref (Ref< T > const &oref) | |
template<class O > | |
Ref (Ref< O > const &oref) | |
Ref< T > & | operator= (Ref< T > const &oref) |
T * | operator-> () const |
operator T* () const | |
T * | get () const |
T & | getRef () const |
~Ref () | |
bool | isNull () const |
bool | isNotNull () const |
bool | isSet () const |
bool | operator! () const |
bool | operator== (const AddonClass::Ref< T > &oref) const |
bool | operator< (const AddonClass::Ref< T > &oref) const |
template<class O > | |
void | reset (Ref< O > const &oref) |
template<class O > | |
void | reset (O *oref) |
void | reset () |
This class is a smart pointer for a Referenced class.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
This operator doubles as the value in a boolean expression.
|
inline |
|
inline |
|
inline |
|
inline |
operator= should work with either another smart pointer or a pointer since it will be able to convert a pointer to a smart pointer using one of the above constructors.
Note: There is a trick here. The temporary variable is necessary because otherwise the following code will fail:
Ref<T> ptr = new T; ptr = ptr;
What happens without the tmp is the dereference is called first so the object ends up deleted and then the reference happens on a deleted object. The order is reversed in the following.
Note: Operator= is ambiguous if you define both an operator=(Ref<T>&) and an operator=(T*). I'm opting for the route the boost took here figuring it has more history behind it.
|
inline |
|
inline |
|
inline |
|
inline |