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

#include <BLI_implicit_sharing_ptr.hh>

Public Member Functions

 ImplicitSharingPtr ()=default
 
 ImplicitSharingPtr (const T *data)
 
 ImplicitSharingPtr (std::nullptr_t)
 
 ImplicitSharingPtr (const ImplicitSharingPtr &other)
 
 ImplicitSharingPtr (ImplicitSharingPtr &&other)
 
 ~ImplicitSharingPtr ()
 
ImplicitSharingPtroperator= (const ImplicitSharingPtr &other)
 
ImplicitSharingPtroperator= (ImplicitSharingPtr &&other)
 
const Toperator-> () const
 
const Toperator* () const
 
 operator bool () const
 
const Tget () const
 
const Trelease ()
 
void reset ()
 
bool has_value () const
 
uint64_t hash () const
 

Static Public Member Functions

static uint64_t hash_as (const T *data)
 

Friends

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 24 of file BLI_implicit_sharing_ptr.hh.

Constructor & Destructor Documentation

◆ ImplicitSharingPtr() [1/5]

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

◆ ImplicitSharingPtr() [2/5]

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

Definition at line 31 of file BLI_implicit_sharing_ptr.hh.

◆ ImplicitSharingPtr() [3/5]

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

Definition at line 34 of file BLI_implicit_sharing_ptr.hh.

◆ ImplicitSharingPtr() [4/5]

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

Definition at line 36 of file BLI_implicit_sharing_ptr.hh.

◆ ImplicitSharingPtr() [5/5]

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

Definition at line 41 of file BLI_implicit_sharing_ptr.hh.

◆ ~ImplicitSharingPtr()

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

Definition at line 46 of file BLI_implicit_sharing_ptr.hh.

Member Function Documentation

◆ 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 115 of file BLI_implicit_sharing_ptr.hh.

References blender::get_default_hash().

◆ hash_as()

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

Definition at line 120 of file BLI_implicit_sharing_ptr.hh.

References blender::get_default_hash().

◆ operator bool()

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

Definition at line 87 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 81 of file BLI_implicit_sharing_ptr.hh.

References BLI_assert.

◆ operator->()

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

Definition at line 75 of file BLI_implicit_sharing_ptr.hh.

References BLI_assert.

◆ 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 51 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 63 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 97 of file BLI_implicit_sharing_ptr.hh.

References data.

◆ reset()

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

Definition at line 104 of file BLI_implicit_sharing_ptr.hh.

Friends And Related Symbol Documentation

◆ operator== [1/2]

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

Definition at line 132 of file BLI_implicit_sharing_ptr.hh.

◆ operator== [2/2]

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

Definition at line 127 of file BLI_implicit_sharing_ptr.hh.


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