Blender V5.3
blender::ImplicitSharingPtr< T, IsStrong > Class Template Reference

#include <BLI_implicit_sharing_ptr.hh>

Public Types

using element_type = T

Public Member Functions

 ImplicitSharingPtr ()=default
 ImplicitSharingPtr (const T *data)
 ImplicitSharingPtr (std::nullptr_t)
 ImplicitSharingPtr (const ImplicitSharingPtr &other)
 ImplicitSharingPtr (ImplicitSharingPtr &&other)
template<typename U>
requires std::is_base_of_v<T, U>
 ImplicitSharingPtr (const ImplicitSharingPtr< U, IsStrong > &other)
template<typename U>
requires std::is_base_of_v<T, U>
 ImplicitSharingPtr (ImplicitSharingPtr< U, IsStrong > &&other)
 ~ImplicitSharingPtr ()
ImplicitSharingPtr & operator= (const ImplicitSharingPtr &other)
ImplicitSharingPtr & operator= (ImplicitSharingPtr &&other)
const T * operator-> () const
const T & operator* () const
 operator bool () const
const T * get () const
const T * release ()
void reset ()
bool has_value () const
uint64_t hash () const
T & ensure_mutable_inplace ()

Static Public Member Functions

static uint64_t hash_as (const T *data)

Friends

template<typename U, bool OtherIsStrong>
class ImplicitSharingPtr
bool operator== (const ImplicitSharingPtr &a, const ImplicitSharingPtr &b)=default
bool operator== (const T *a, const ImplicitSharingPtr &b)
bool operator== (const ImplicitSharingPtr &a, const T *b)

Detailed Description

template<typename T = ImplicitSharingInfo, bool IsStrong = true>
class blender::ImplicitSharingPtr< T, IsStrong >

ImplicitSharingPtr is a smart pointer that manages implicit sharing. It's designed to work with types that derive from ImplicitSharingMixin. It is fairly similar to #std::shared_ptr but requires the reference count to be embedded in the data.

Definition at line 23 of file BLI_implicit_sharing_ptr.hh.

Member Typedef Documentation

◆ element_type

template<typename T = ImplicitSharingInfo, bool IsStrong = true>
using blender::ImplicitSharingPtr< T, IsStrong >::element_type = T

Definition at line 30 of file BLI_implicit_sharing_ptr.hh.

Constructor & Destructor Documentation

◆ ImplicitSharingPtr() [1/7]

template<typename T = ImplicitSharingInfo, bool IsStrong = true>
blender::ImplicitSharingPtr< T, IsStrong >::ImplicitSharingPtr ( )
default

◆ ImplicitSharingPtr() [2/7]

template<typename T = ImplicitSharingInfo, bool IsStrong = true>
blender::ImplicitSharingPtr< T, IsStrong >::ImplicitSharingPtr ( const T * data)
inlineexplicit

Definition at line 34 of file BLI_implicit_sharing_ptr.hh.

◆ ImplicitSharingPtr() [3/7]

template<typename T = ImplicitSharingInfo, bool IsStrong = true>
blender::ImplicitSharingPtr< T, IsStrong >::ImplicitSharingPtr ( std::nullptr_t )
inline

Definition at line 37 of file BLI_implicit_sharing_ptr.hh.

◆ ImplicitSharingPtr() [4/7]

template<typename T = ImplicitSharingInfo, bool IsStrong = true>
blender::ImplicitSharingPtr< T, IsStrong >::ImplicitSharingPtr ( const ImplicitSharingPtr< T, IsStrong > & other)
inline

Definition at line 39 of file BLI_implicit_sharing_ptr.hh.

◆ ImplicitSharingPtr() [5/7]

template<typename T = ImplicitSharingInfo, bool IsStrong = true>
blender::ImplicitSharingPtr< T, IsStrong >::ImplicitSharingPtr ( ImplicitSharingPtr< T, IsStrong > && other)
inline

Definition at line 44 of file BLI_implicit_sharing_ptr.hh.

◆ ImplicitSharingPtr() [6/7]

template<typename T = ImplicitSharingInfo, bool IsStrong = true>
template<typename U>
requires std::is_base_of_v<T, U>
blender::ImplicitSharingPtr< T, IsStrong >::ImplicitSharingPtr ( const ImplicitSharingPtr< U, IsStrong > & other)
inline

Definition at line 50 of file BLI_implicit_sharing_ptr.hh.

◆ ImplicitSharingPtr() [7/7]

template<typename T = ImplicitSharingInfo, bool IsStrong = true>
template<typename U>
requires std::is_base_of_v<T, U>
blender::ImplicitSharingPtr< T, IsStrong >::ImplicitSharingPtr ( ImplicitSharingPtr< U, IsStrong > && other)
inline

Definition at line 58 of file BLI_implicit_sharing_ptr.hh.

◆ ~ImplicitSharingPtr()

template<typename T = ImplicitSharingInfo, bool IsStrong = true>
blender::ImplicitSharingPtr< T, IsStrong >::~ImplicitSharingPtr ( )
inline

Definition at line 65 of file BLI_implicit_sharing_ptr.hh.

Member Function Documentation

◆ ensure_mutable_inplace()

template<typename T = ImplicitSharingInfo, bool IsStrong = true>
T & blender::ImplicitSharingPtr< T, IsStrong >::ensure_mutable_inplace ( )
inline

◆ get()

◆ has_value()

template<typename T = ImplicitSharingInfo, bool IsStrong = true>
bool blender::ImplicitSharingPtr< T, IsStrong >::has_value ( ) const
inline

◆ hash()

template<typename T = ImplicitSharingInfo, bool IsStrong = true>
uint64_t blender::ImplicitSharingPtr< T, IsStrong >::hash ( ) const
inline

Definition at line 134 of file BLI_implicit_sharing_ptr.hh.

◆ hash_as()

template<typename T = ImplicitSharingInfo, bool IsStrong = true>
uint64_t blender::ImplicitSharingPtr< T, IsStrong >::hash_as ( const T * data)
inlinestatic

Definition at line 156 of file BLI_implicit_sharing_ptr.hh.

◆ operator bool()

template<typename T = ImplicitSharingInfo, bool IsStrong = true>
blender::ImplicitSharingPtr< T, IsStrong >::operator bool ( ) const
inline

Definition at line 106 of file BLI_implicit_sharing_ptr.hh.

◆ operator*()

template<typename T = ImplicitSharingInfo, bool IsStrong = true>
const T & blender::ImplicitSharingPtr< T, IsStrong >::operator* ( ) const
inline

Definition at line 100 of file BLI_implicit_sharing_ptr.hh.

◆ operator->()

template<typename T = ImplicitSharingInfo, bool IsStrong = true>
const T * blender::ImplicitSharingPtr< T, IsStrong >::operator-> ( ) const
inline

Definition at line 94 of file BLI_implicit_sharing_ptr.hh.

◆ operator=() [1/2]

template<typename T = ImplicitSharingInfo, bool IsStrong = true>
ImplicitSharingPtr & blender::ImplicitSharingPtr< T, IsStrong >::operator= ( const ImplicitSharingPtr< T, IsStrong > & other)
inline

Definition at line 70 of file BLI_implicit_sharing_ptr.hh.

◆ operator=() [2/2]

template<typename T = ImplicitSharingInfo, bool IsStrong = true>
ImplicitSharingPtr & blender::ImplicitSharingPtr< T, IsStrong >::operator= ( ImplicitSharingPtr< T, IsStrong > && other)
inline

Definition at line 82 of file BLI_implicit_sharing_ptr.hh.

◆ release()

template<typename T = ImplicitSharingInfo, bool IsStrong = true>
const T * blender::ImplicitSharingPtr< T, IsStrong >::release ( )
inline

Definition at line 116 of file BLI_implicit_sharing_ptr.hh.

◆ reset()

template<typename T = ImplicitSharingInfo, bool IsStrong = true>
void blender::ImplicitSharingPtr< T, IsStrong >::reset ( )
inline

◆ ImplicitSharingPtr

◆ operator== [1/3]

template<typename T = ImplicitSharingInfo, bool IsStrong = true>
bool operator== ( const ImplicitSharingPtr< T, IsStrong > & a,
const ImplicitSharingPtr< T, IsStrong > & b )
friend

◆ operator== [2/3]

template<typename T = ImplicitSharingInfo, bool IsStrong = true>
bool operator== ( const ImplicitSharingPtr< T, IsStrong > & a,
const T * b )
friend

Definition at line 168 of file BLI_implicit_sharing_ptr.hh.

◆ operator== [3/3]

template<typename T = ImplicitSharingInfo, bool IsStrong = true>
bool operator== ( const T * a,
const ImplicitSharingPtr< T, IsStrong > & b )
friend

Definition at line 163 of file BLI_implicit_sharing_ptr.hh.


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