pianod2
multisource multiuser scriptable networked music player
Public Member Functions | Private Types | Private Attributes | List of all members
Retainer< ptr_type > Class Template Reference

Smart containers to help manage reference counting the MusicThingies. More...

#include <retainer.h>

Public Member Functions

 Retainer ()
 Default constructor. More...
 
 Retainer (value_type *item)
 Direct construction of new item via pointer. More...
 
 Retainer (const this_type &item)
 Copy constructor. More...
 
template<typename OtherType >
 Retainer (const Retainer< OtherType > &item)
 Copy construct from a different retained type. More...
 
 Retainer (this_type &&item)
 Move construction. More...
 
template<typename OtherType >
 Retainer (Retainer< OtherType > &&item)
 Move construction from a different retained type. More...
 
this_typeoperator= (value_type *item)
 Direct assignment of new pointer. More...
 
value_typeoperator= (const this_type &item)
 Copy assignment from another retainer of same type. More...
 
template<typename OtherType >
this_typeoperator= (const Retainer< OtherType > &item)
 Copy assignment from a retainer of a different type. More...
 
this_typeoperator= (this_type &&item)
 Move assignment from another retainer of same type. More...
 
template<typename OtherType >
this_typeoperator= (Retainer< OtherType > &&item)
 Move assignment from another retainer of a different type. More...
 
 ~Retainer ()
 On destruction, release any contained pointer. More...
 
value_typeoperator-> () const
 Allow arrow use of contained pointer. More...
 
value_typeoperator* () const
 Dereference contained pointer via operator *. More...
 
value_typeget () const
 Get the pointer itself. More...
 
 operator bool () const
 Check for null. More...
 

Private Types

using value_type = typename std::remove_pointer< ptr_type >::type
 
using this_type = Retainer< ptr_type >
 

Private Attributes

value_typevalue {nullptr}
 

Detailed Description

template<typename ptr_type>
class Retainer< ptr_type >

Smart containers to help manage reference counting the MusicThingies.

Member Typedef Documentation

◆ this_type

template<typename ptr_type >
using Retainer< ptr_type >::this_type = Retainer <ptr_type>
private

◆ value_type

template<typename ptr_type >
using Retainer< ptr_type >::value_type = typename std::remove_pointer <ptr_type>::type
private

Constructor & Destructor Documentation

◆ Retainer() [1/6]

template<typename ptr_type >
Retainer< ptr_type >::Retainer ( )
inline

Default constructor.

◆ Retainer() [2/6]

template<typename ptr_type >
Retainer< ptr_type >::Retainer ( value_type item)
inline

Direct construction of new item via pointer.

◆ Retainer() [3/6]

template<typename ptr_type >
Retainer< ptr_type >::Retainer ( const this_type item)
inline

Copy constructor.

◆ Retainer() [4/6]

template<typename ptr_type >
template<typename OtherType >
Retainer< ptr_type >::Retainer ( const Retainer< OtherType > &  item)
inline

Copy construct from a different retained type.

◆ Retainer() [5/6]

template<typename ptr_type >
Retainer< ptr_type >::Retainer ( this_type &&  item)
inline

Move construction.

◆ Retainer() [6/6]

template<typename ptr_type >
template<typename OtherType >
Retainer< ptr_type >::Retainer ( Retainer< OtherType > &&  item)
inline

Move construction from a different retained type.

◆ ~Retainer()

template<typename ptr_type >
Retainer< ptr_type >::~Retainer ( )
inline

On destruction, release any contained pointer.

Member Function Documentation

◆ get()

template<typename ptr_type >
value_type* Retainer< ptr_type >::get ( ) const
inline

Get the pointer itself.

Here is the caller graph for this function:

◆ operator bool()

template<typename ptr_type >
Retainer< ptr_type >::operator bool ( ) const
inline

Check for null.

Returns
True if retainer contains non-null pointer.

◆ operator*()

template<typename ptr_type >
value_type& Retainer< ptr_type >::operator* ( void  ) const
inline

Dereference contained pointer via operator *.

◆ operator->()

template<typename ptr_type >
value_type* Retainer< ptr_type >::operator-> ( ) const
inline

Allow arrow use of contained pointer.

◆ operator=() [1/5]

template<typename ptr_type >
template<typename OtherType >
this_type& Retainer< ptr_type >::operator= ( const Retainer< OtherType > &  item)
inline

Copy assignment from a retainer of a different type.

◆ operator=() [2/5]

template<typename ptr_type >
value_type& Retainer< ptr_type >::operator= ( const this_type item)
inline

Copy assignment from another retainer of same type.

◆ operator=() [3/5]

template<typename ptr_type >
template<typename OtherType >
this_type& Retainer< ptr_type >::operator= ( Retainer< OtherType > &&  item)
inline

Move assignment from another retainer of a different type.

◆ operator=() [4/5]

template<typename ptr_type >
this_type& Retainer< ptr_type >::operator= ( this_type &&  item)
inline

Move assignment from another retainer of same type.

◆ operator=() [5/5]

template<typename ptr_type >
this_type& Retainer< ptr_type >::operator= ( value_type item)
inline

Direct assignment of new pointer.

Member Data Documentation

◆ value

template<typename ptr_type >
value_type* Retainer< ptr_type >::value {nullptr}
private

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