Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::core::UniquePtr< T, Destroyer > Class Template Reference

Unique ownrship pointer. More...

#include <unique_ptr.h>

Inheritance diagram for roc::core::UniquePtr< T, Destroyer >:
Collaboration diagram for roc::core::UniquePtr< T, Destroyer >:

Public Member Functions

 UniquePtr ()
 Initialize null pointer. More...
 
 UniquePtr (T *ptr, Destroyer &destroyer)
 Initialize from a raw pointer. More...
 
 ~UniquePtr ()
 Destroy object. More...
 
void reset ()
 Reset pointer to null. More...
 
void reset (T *new_ptr, Destroyer &new_destroyer)
 Reset pointer to a new value. More...
 
T * release ()
 Get underlying pointer and pass ownership to the caller. More...
 
T * get () const
 Get underlying pointer. More...
 
T * operator-> () const
 Get underlying pointer. More...
 
T & operator* () const
 Get underlying reference. More...
 
 operator const struct unspecified_bool * () const
 Convert to bool. More...
 

Detailed Description

template<class T, class Destroyer = IAllocator>
class roc::core::UniquePtr< T, Destroyer >

Unique ownrship pointer.

Template Parameters
Tdefines pointee type. It may be const.
Destroyeris used to destroy the object.

Definition at line 27 of file unique_ptr.h.

Constructor & Destructor Documentation

template<class T, class Destroyer = IAllocator>
roc::core::UniquePtr< T, Destroyer >::UniquePtr ( )
inline

Initialize null pointer.

Definition at line 30 of file unique_ptr.h.

template<class T, class Destroyer = IAllocator>
roc::core::UniquePtr< T, Destroyer >::UniquePtr ( T *  ptr,
Destroyer &  destroyer 
)
inline

Initialize from a raw pointer.

Definition at line 36 of file unique_ptr.h.

template<class T, class Destroyer = IAllocator>
roc::core::UniquePtr< T, Destroyer >::~UniquePtr ( )
inline

Destroy object.

Definition at line 42 of file unique_ptr.h.

Member Function Documentation

template<class T, class Destroyer = IAllocator>
T* roc::core::UniquePtr< T, Destroyer >::get ( ) const
inline

Get underlying pointer.

Definition at line 74 of file unique_ptr.h.

template<class T, class Destroyer = IAllocator>
roc::core::UniquePtr< T, Destroyer >::operator const struct unspecified_bool * ( ) const
inline

Convert to bool.

Definition at line 92 of file unique_ptr.h.

template<class T, class Destroyer = IAllocator>
T& roc::core::UniquePtr< T, Destroyer >::operator* ( ) const
inline

Get underlying reference.

Definition at line 84 of file unique_ptr.h.

template<class T, class Destroyer = IAllocator>
T* roc::core::UniquePtr< T, Destroyer >::operator-> ( ) const
inline

Get underlying pointer.

Definition at line 79 of file unique_ptr.h.

template<class T, class Destroyer = IAllocator>
T* roc::core::UniquePtr< T, Destroyer >::release ( )
inline

Get underlying pointer and pass ownership to the caller.

Definition at line 63 of file unique_ptr.h.

template<class T, class Destroyer = IAllocator>
void roc::core::UniquePtr< T, Destroyer >::reset ( )
inline

Reset pointer to null.

Definition at line 47 of file unique_ptr.h.

template<class T, class Destroyer = IAllocator>
void roc::core::UniquePtr< T, Destroyer >::reset ( T *  new_ptr,
Destroyer &  new_destroyer 
)
inline

Reset pointer to a new value.

Definition at line 54 of file unique_ptr.h.


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