CBMC
small_shared_ptrt< T > Class Template Referencefinal

This class is really similar to boost's intrusive_pointer, but can be a bit simpler seeing as we're only using it one place. More...

#include <small_shared_ptr.h>

Public Member Functions

 small_shared_ptrt ()=default
 
 small_shared_ptrt (T *t)
 
 small_shared_ptrt (const small_shared_ptrt &rhs)
 
small_shared_ptrtoperator= (const small_shared_ptrt &rhs)
 
 small_shared_ptrt (small_shared_ptrt &&rhs)
 
small_shared_ptrtoperator= (small_shared_ptrt &&rhs)
 
 ~small_shared_ptrt ()
 
void swap (small_shared_ptrt &rhs)
 
T * get () const
 
T & operator* () const
 
T * operator-> () const
 
auto use_count () const -> decltype(pointee_use_count(std::declval< T >()))
 
 operator bool () const
 

Private Attributes

T * t_ = nullptr
 

Detailed Description

template<typename T>
class small_shared_ptrt< T >

This class is really similar to boost's intrusive_pointer, but can be a bit simpler seeing as we're only using it one place.

The idea is that the pointed-to object stores its reference-count internally, which is more space-efficient than storing it in a separate control block (which is what shared_ptr does).

Definition at line 24 of file small_shared_ptr.h.

Constructor & Destructor Documentation

◆ small_shared_ptrt() [1/4]

template<typename T >
small_shared_ptrt< T >::small_shared_ptrt ( )
default

◆ small_shared_ptrt() [2/4]

template<typename T >
small_shared_ptrt< T >::small_shared_ptrt ( T *  t)
inlineexplicit

Definition at line 29 of file small_shared_ptr.h.

◆ small_shared_ptrt() [3/4]

template<typename T >
small_shared_ptrt< T >::small_shared_ptrt ( const small_shared_ptrt< T > &  rhs)
inline

Definition at line 37 of file small_shared_ptr.h.

◆ small_shared_ptrt() [4/4]

template<typename T >
small_shared_ptrt< T >::small_shared_ptrt ( small_shared_ptrt< T > &&  rhs)
inline

Definition at line 52 of file small_shared_ptr.h.

◆ ~small_shared_ptrt()

template<typename T >
small_shared_ptrt< T >::~small_shared_ptrt ( )
inline

Definition at line 63 of file small_shared_ptr.h.

Member Function Documentation

◆ get()

template<typename T >
T* small_shared_ptrt< T >::get ( ) const
inline

Definition at line 82 of file small_shared_ptr.h.

◆ operator bool()

template<typename T >
small_shared_ptrt< T >::operator bool ( ) const
inlineexplicit

Definition at line 102 of file small_shared_ptr.h.

◆ operator*()

template<typename T >
T& small_shared_ptrt< T >::operator* ( ) const
inline

Definition at line 87 of file small_shared_ptr.h.

◆ operator->()

template<typename T >
T* small_shared_ptrt< T >::operator-> ( ) const
inline

Definition at line 92 of file small_shared_ptr.h.

◆ operator=() [1/2]

template<typename T >
small_shared_ptrt& small_shared_ptrt< T >::operator= ( const small_shared_ptrt< T > &  rhs)
inline

Definition at line 45 of file small_shared_ptr.h.

◆ operator=() [2/2]

template<typename T >
small_shared_ptrt& small_shared_ptrt< T >::operator= ( small_shared_ptrt< T > &&  rhs)
inline

Definition at line 57 of file small_shared_ptr.h.

◆ swap()

template<typename T >
void small_shared_ptrt< T >::swap ( small_shared_ptrt< T > &  rhs)
inline

Definition at line 77 of file small_shared_ptr.h.

◆ use_count()

template<typename T >
auto small_shared_ptrt< T >::use_count ( ) const -> decltype(pointee_use_count(std::declval<T>()))
inline

Definition at line 97 of file small_shared_ptr.h.

Member Data Documentation

◆ t_

template<typename T >
T* small_shared_ptrt< T >::t_ = nullptr
private

Definition at line 108 of file small_shared_ptr.h.


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