SObjectizer  5.7
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
so_5::intrusive_ptr_t< T > Class Template Reference

Template class for smart reference wrapper on the atomic_refcounted_t. More...

#include <atomic_refcounted.hpp>

Public Member Functions

 intrusive_ptr_t () noexcept
 Default constructor. More...
 
 intrusive_ptr_t (T *obj) noexcept
 Constructor for a raw pointer. More...
 
 intrusive_ptr_t (const intrusive_ptr_t &o) noexcept
 Copy constructor. More...
 
 intrusive_ptr_t (intrusive_ptr_t &&o) noexcept
 Move constructor. More...
 
template<class Y >
 intrusive_ptr_t (const intrusive_ptr_t< Y > &o) noexcept
 Constructor from another smart reference. More...
 
template<class Y >
 intrusive_ptr_t (std::unique_ptr< Y > o) noexcept
 Constructor from unique_ptr instance. More...
 
 ~intrusive_ptr_t () noexcept
 Destructor. More...
 
intrusive_ptr_toperator= (const intrusive_ptr_t &o) noexcept
 Copy operator. More...
 
intrusive_ptr_toperator= (intrusive_ptr_t &&o) noexcept
 Move operator. More...
 
void swap (intrusive_ptr_t &o) noexcept
 Swap values. More...
 
void reset () noexcept
 Drop controlled object. More...
 
template<class Y >
intrusive_ptr_t< Y > make_reference () const noexcept
 Make reference with casing to different type. More...
 
 operator bool () const noexcept
 Is this a null reference? More...
 
Access to object.
T * get () const noexcept
 
T * operator-> () const noexcept
 
T & operator* () const noexcept
 
Comparision
bool operator== (const intrusive_ptr_t &o) const
 
bool operator< (const intrusive_ptr_t &o) const
 

Private Member Functions

void take_object () noexcept
 Increment reference count to object if it's not null. More...
 
void dismiss_object () noexcept
 Decrement reference count to object and delete it if needed. More...
 

Static Private Member Functions

static void ensure_right_T ()
 

Private Attributes

T * m_obj
 Object controlled by a smart reference. More...
 

Detailed Description

template<class T>
class so_5::intrusive_ptr_t< T >

Template class for smart reference wrapper on the atomic_refcounted_t.

Since
v.5.2.0
Template Parameters
Tclass which must be derived from the atomic_refcounted_t.

Constructor & Destructor Documentation

◆ intrusive_ptr_t() [1/6]

template<class T>
so_5::intrusive_ptr_t< T >::intrusive_ptr_t ( )
inlinenoexcept

Default constructor.

Constructs a null reference.

◆ intrusive_ptr_t() [2/6]

template<class T>
so_5::intrusive_ptr_t< T >::intrusive_ptr_t ( T *  obj)
inlinenoexcept

Constructor for a raw pointer.

◆ intrusive_ptr_t() [3/6]

template<class T>
so_5::intrusive_ptr_t< T >::intrusive_ptr_t ( const intrusive_ptr_t< T > &  o)
inlinenoexcept

Copy constructor.

◆ intrusive_ptr_t() [4/6]

template<class T>
so_5::intrusive_ptr_t< T >::intrusive_ptr_t ( intrusive_ptr_t< T > &&  o)
inlinenoexcept

Move constructor.

◆ intrusive_ptr_t() [5/6]

template<class T>
template<class Y >
so_5::intrusive_ptr_t< T >::intrusive_ptr_t ( const intrusive_ptr_t< Y > &  o)
inlinenoexcept

Constructor from another smart reference.

Since
v.5.2.2

◆ intrusive_ptr_t() [6/6]

template<class T>
template<class Y >
so_5::intrusive_ptr_t< T >::intrusive_ptr_t ( std::unique_ptr< Y >  o)
inlinenoexcept

Constructor from unique_ptr instance.

Since
v.5.5.23

◆ ~intrusive_ptr_t()

template<class T>
so_5::intrusive_ptr_t< T >::~intrusive_ptr_t ( )
inlinenoexcept

Destructor.

Member Function Documentation

◆ dismiss_object()

template<class T>
void so_5::intrusive_ptr_t< T >::dismiss_object ( )
inlineprivatenoexcept

Decrement reference count to object and delete it if needed.

◆ ensure_right_T()

template<class T>
static void so_5::intrusive_ptr_t< T >::ensure_right_T ( )
inlinestaticprivate

◆ get()

template<class T>
T* so_5::intrusive_ptr_t< T >::get ( ) const
inlinenoexcept

◆ make_reference()

template<class T>
template<class Y >
intrusive_ptr_t< Y > so_5::intrusive_ptr_t< T >::make_reference ( ) const
inlinenoexcept

Make reference with casing to different type.

Since
v.5.2.2

◆ operator bool()

template<class T>
so_5::intrusive_ptr_t< T >::operator bool ( ) const
inlinenoexcept

Is this a null reference?

i.e. whether get() != 0.

Return values
trueif *this manages an object.
falseotherwise.

◆ operator*()

template<class T>
T& so_5::intrusive_ptr_t< T >::operator* ( ) const
inlinenoexcept

◆ operator->()

template<class T>
T* so_5::intrusive_ptr_t< T >::operator-> ( ) const
inlinenoexcept

◆ operator<()

template<class T>
bool so_5::intrusive_ptr_t< T >::operator< ( const intrusive_ptr_t< T > &  o) const
inline

◆ operator=() [1/2]

template<class T>
intrusive_ptr_t& so_5::intrusive_ptr_t< T >::operator= ( const intrusive_ptr_t< T > &  o)
inlinenoexcept

Copy operator.

◆ operator=() [2/2]

template<class T>
intrusive_ptr_t& so_5::intrusive_ptr_t< T >::operator= ( intrusive_ptr_t< T > &&  o)
inlinenoexcept

Move operator.

◆ operator==()

template<class T>
bool so_5::intrusive_ptr_t< T >::operator== ( const intrusive_ptr_t< T > &  o) const
inline

◆ reset()

template<class T>
void so_5::intrusive_ptr_t< T >::reset ( )
inlinenoexcept

Drop controlled object.

Since
v.5.2.2

◆ swap()

template<class T>
void so_5::intrusive_ptr_t< T >::swap ( intrusive_ptr_t< T > &  o)
inlinenoexcept

Swap values.

◆ take_object()

template<class T>
void so_5::intrusive_ptr_t< T >::take_object ( )
inlineprivatenoexcept

Increment reference count to object if it's not null.

Member Data Documentation

◆ m_obj

template<class T>
T* so_5::intrusive_ptr_t< T >::m_obj
private

Object controlled by a smart reference.


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