CBMC
small_shared_pointeet< Num > Class Template Reference

A helper class to store use-counts of objects held by small shared pointers. More...

#include <small_shared_ptr.h>

Public Member Functions

 small_shared_pointeet ()=default
 
 small_shared_pointeet (const small_shared_pointeet &)
 
small_shared_pointeetoperator= (const small_shared_pointeet &)
 
 small_shared_pointeet (small_shared_pointeet &&)
 
small_shared_pointeetoperator= (small_shared_pointeet &&)
 
void increment_use_count ()
 
void decrement_use_count ()
 
Num use_count () const
 

Protected Member Functions

 ~small_shared_pointeet ()=default
 

Private Attributes

Num use_count_ = 0
 

Detailed Description

template<typename Num>
class small_shared_pointeet< Num >

A helper class to store use-counts of objects held by small shared pointers.

The suggested usage pattern is to have such objects inherit from this class, and then to access them through a small_shared_ptrt. This approach provides us with shared_ptr-like semantics, but without the space overhead required by shared_ptr. The idea is similar to boost's intrusive_ptr.

Template Parameters
Numsome numeric type, used to store a reference count

Definition at line 182 of file small_shared_ptr.h.

Constructor & Destructor Documentation

◆ small_shared_pointeet() [1/3]

template<typename Num >
small_shared_pointeet< Num >::small_shared_pointeet ( )
default

◆ small_shared_pointeet() [2/3]

template<typename Num >
small_shared_pointeet< Num >::small_shared_pointeet ( const small_shared_pointeet< Num > &  )
inline

Definition at line 188 of file small_shared_ptr.h.

◆ small_shared_pointeet() [3/3]

template<typename Num >
small_shared_pointeet< Num >::small_shared_pointeet ( small_shared_pointeet< Num > &&  )
inline

Definition at line 195 of file small_shared_ptr.h.

◆ ~small_shared_pointeet()

template<typename Num >
small_shared_pointeet< Num >::~small_shared_pointeet ( )
protecteddefault

Member Function Documentation

◆ decrement_use_count()

template<typename Num >
void small_shared_pointeet< Num >::decrement_use_count ( )
inline

Definition at line 207 of file small_shared_ptr.h.

◆ increment_use_count()

template<typename Num >
void small_shared_pointeet< Num >::increment_use_count ( )
inline

Definition at line 203 of file small_shared_ptr.h.

◆ operator=() [1/2]

template<typename Num >
small_shared_pointeet& small_shared_pointeet< Num >::operator= ( const small_shared_pointeet< Num > &  )
inline

Definition at line 191 of file small_shared_ptr.h.

◆ operator=() [2/2]

template<typename Num >
small_shared_pointeet& small_shared_pointeet< Num >::operator= ( small_shared_pointeet< Num > &&  )
inline

Definition at line 198 of file small_shared_ptr.h.

◆ use_count()

template<typename Num >
Num small_shared_pointeet< Num >::use_count ( ) const
inline

Definition at line 211 of file small_shared_ptr.h.

Member Data Documentation

◆ use_count_

template<typename Num >
Num small_shared_pointeet< Num >::use_count_ = 0
private

Definition at line 221 of file small_shared_ptr.h.


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