Blender V4.3
blender::ImplicitSharingPtrAndData Class Reference

#include <BLI_implicit_sharing_ptr.hh>

Public Member Functions

 ImplicitSharingPtrAndData ()=default
 
 ImplicitSharingPtrAndData (ImplicitSharingPtr<> sharing_info, const void *data)
 
 ImplicitSharingPtrAndData (const ImplicitSharingPtrAndData &other)
 
 ImplicitSharingPtrAndData (ImplicitSharingPtrAndData &&other)
 
ImplicitSharingPtrAndDataoperator= (const ImplicitSharingPtrAndData &other)
 
ImplicitSharingPtrAndDataoperator= (ImplicitSharingPtrAndData &&other)
 
 ~ImplicitSharingPtrAndData ()
 
bool has_value () const
 

Public Attributes

ImplicitSharingPtr sharing_info
 
const void * data = nullptr
 

Detailed Description

Utility struct to allow used #ImplicitSharingPtr when it's necessary to type-erase the backing storage for user-exposed data. For example, blender::Vector, or #std::vector might be used to store an implicitly shared array that is only accessed with #Span or #MutableSpan.

This class handles RAII for the sharing info and the exposed data pointer. Retrieving the data with write access and type safety must be handled elsewhere.

Definition at line 173 of file BLI_implicit_sharing_ptr.hh.

Constructor & Destructor Documentation

◆ ImplicitSharingPtrAndData() [1/4]

blender::ImplicitSharingPtrAndData::ImplicitSharingPtrAndData ( )
default

Referenced by operator=(), and operator=().

◆ ImplicitSharingPtrAndData() [2/4]

blender::ImplicitSharingPtrAndData::ImplicitSharingPtrAndData ( ImplicitSharingPtr<> sharing_info,
const void * data )
inline

Definition at line 179 of file BLI_implicit_sharing_ptr.hh.

◆ ImplicitSharingPtrAndData() [3/4]

blender::ImplicitSharingPtrAndData::ImplicitSharingPtrAndData ( const ImplicitSharingPtrAndData & other)
inline

Definition at line 184 of file BLI_implicit_sharing_ptr.hh.

◆ ImplicitSharingPtrAndData() [4/4]

blender::ImplicitSharingPtrAndData::ImplicitSharingPtrAndData ( ImplicitSharingPtrAndData && other)
inline

Definition at line 189 of file BLI_implicit_sharing_ptr.hh.

◆ ~ImplicitSharingPtrAndData()

blender::ImplicitSharingPtrAndData::~ImplicitSharingPtrAndData ( )
inline

Definition at line 214 of file BLI_implicit_sharing_ptr.hh.

Member Function Documentation

◆ has_value()

◆ operator=() [1/2]

ImplicitSharingPtrAndData & blender::ImplicitSharingPtrAndData::operator= ( const ImplicitSharingPtrAndData & other)
inline

Definition at line 194 of file BLI_implicit_sharing_ptr.hh.

References ImplicitSharingPtrAndData().

◆ operator=() [2/2]

ImplicitSharingPtrAndData & blender::ImplicitSharingPtrAndData::operator= ( ImplicitSharingPtrAndData && other)
inline

Definition at line 204 of file BLI_implicit_sharing_ptr.hh.

References ImplicitSharingPtrAndData().

Member Data Documentation

◆ data

const void* blender::ImplicitSharingPtrAndData::data = nullptr

◆ sharing_info


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