C++ Actor Framework 0.18
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Related Functions | List of all members
caf::intrusive_cow_ptr< T > Class Template Reference

An intrusive, reference counting smart pointer implementation with copy-on-write optimization. More...

#include <intrusive_cow_ptr.hpp>

Inheritance diagram for caf::intrusive_cow_ptr< T >:
caf::detail::comparable< intrusive_cow_ptr< T > > caf::detail::comparable< intrusive_cow_ptr< T >, T * > caf::detail::comparable< intrusive_cow_ptr< T >, std::nullptr_t > caf::detail::comparable< intrusive_cow_ptr< T >, intrusive_ptr< T > >

Public Types

using pointer = T *
 
using const_pointer = const T *
 
using element_type = T
 
using reference = T &
 
using const_reference = const T &
 
using counting_pointer = intrusive_ptr< T >
 

Public Member Functions

 intrusive_cow_ptr (intrusive_cow_ptr &&) noexcept=default
 
 intrusive_cow_ptr (const intrusive_cow_ptr &) noexcept=default
 
 intrusive_cow_ptr (std::nullptr_t) noexcept
 
template<class Y >
 intrusive_cow_ptr (intrusive_cow_ptr< Y > other) noexcept
 
 intrusive_cow_ptr (counting_pointer p) noexcept
 
 intrusive_cow_ptr (pointer ptr, bool add_ref=true) noexcept
 
intrusive_cow_ptroperator= (intrusive_cow_ptr &&) noexcept=default
 
intrusive_cow_ptroperator= (const intrusive_cow_ptr &) noexcept=default
 
intrusive_cow_ptroperator= (counting_pointer x) noexcept
 
ptrdiff_t compare (std::nullptr_t) const noexcept
 
ptrdiff_t compare (const_pointer ptr) const noexcept
 
ptrdiff_t compare (const counting_pointer &other) const noexcept
 
ptrdiff_t compare (const intrusive_cow_ptr &other) const noexcept
 
void swap (intrusive_cow_ptr &other) noexcept
 Swaps the managed object with other.
 
void reset (pointer p=nullptr, bool add_ref=true) noexcept
 Replaces the managed object.
 
pointer detach () noexcept
 Returns the raw pointer without modifying reference count and sets this to nullptr.
 
pointer release () noexcept
 Returns the raw pointer without modifying reference count and sets this to nullptr.
 
void unshare ()
 Forces a copy of the managed object unless it already has a reference count of exactly 1.
 
pointer unshared_ptr ()
 Returns a mutable pointer to the managed object.
 
reference unshared ()
 Returns a mutable reference to the managed object.
 
const_pointer get () const noexcept
 Returns a read-only pointer to the managed object.
 
const counting_pointercounting_ptr () const noexcept
 Returns the intrusive pointer managing the object.
 
const_pointer operator-> () const noexcept
 Returns a read-only pointer to the managed object.
 
const_reference operator* () const noexcept
 Returns a read-only reference to the managed object.
 
 operator bool () const noexcept
 

Related Functions

(Note that these are not member functions.)

template<class T >
T * default_intrusive_cow_ptr_unshare (T *&ptr)
 Default implementation for unsharing values.
 
template<class T >
T * intrusive_cow_ptr_unshare (T *&ptr)
 Customization point for allowing intrusive_cow_ptr<T> with a forward declared T.
 
template<class T >
std::string to_string (const intrusive_cow_ptr< T > &x)
 

Detailed Description

template<class T>
class caf::intrusive_cow_ptr< T >

An intrusive, reference counting smart pointer implementation with copy-on-write optimization.


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