Blender  V3.3
Public Member Functions | Friends | List of all members
blender::UserCounter< T > Class Template Reference

#include <BLI_user_counter.hh>

Public Member Functions

 UserCounter ()=default
 
 UserCounter (T *data)
 
 UserCounter (const UserCounter &other)
 
 UserCounter (UserCounter &&other)
 
 ~UserCounter ()
 
UserCounteroperator= (const UserCounter &other)
 
UserCounteroperator= (UserCounter &&other)
 
Toperator-> ()
 
const Toperator-> () const
 
Toperator* ()
 
const Toperator* () const
 
 operator bool () const
 
Tget ()
 
const Tget () const
 
Trelease ()
 
void reset ()
 
bool has_value () const
 
uint64_t hash () const
 

Friends

bool operator== (const UserCounter &a, const UserCounter &b)
 
std::ostream & operator<< (std::ostream &stream, const UserCounter &value)
 

Detailed Description

template<typename T>
class blender::UserCounter< T >

A simple automatic reference counter. It is similar to std::shared_ptr, but expects that the reference count is inside the object.

Definition at line 17 of file BLI_user_counter.hh.

Constructor & Destructor Documentation

◆ UserCounter() [1/4]

template<typename T >
blender::UserCounter< T >::UserCounter ( )
default

◆ UserCounter() [2/4]

template<typename T >
blender::UserCounter< T >::UserCounter ( T data)
inline

Definition at line 24 of file BLI_user_counter.hh.

References data_.

◆ UserCounter() [3/4]

template<typename T >
blender::UserCounter< T >::UserCounter ( const UserCounter< T > &  other)
inline

Definition at line 28 of file BLI_user_counter.hh.

References data_.

◆ UserCounter() [4/4]

template<typename T >
blender::UserCounter< T >::UserCounter ( UserCounter< T > &&  other)
inline

Definition at line 33 of file BLI_user_counter.hh.

References data_.

◆ ~UserCounter()

template<typename T >
blender::UserCounter< T >::~UserCounter ( )
inline

Definition at line 38 of file BLI_user_counter.hh.

References data_.

Member Function Documentation

◆ get() [1/2]

template<typename T >
T* blender::UserCounter< T >::get ( )
inline

Definition at line 96 of file BLI_user_counter.hh.

References data_.

◆ get() [2/2]

template<typename T >
const T* blender::UserCounter< T >::get ( ) const
inline

Definition at line 101 of file BLI_user_counter.hh.

References data_.

◆ has_value()

template<typename T >
bool blender::UserCounter< T >::has_value ( ) const
inline

Definition at line 119 of file BLI_user_counter.hh.

References data_.

◆ hash()

template<typename T >
uint64_t blender::UserCounter< T >::hash ( ) const
inline

Definition at line 124 of file BLI_user_counter.hh.

References data_, and blender::get_default_hash().

◆ operator bool()

template<typename T >
blender::UserCounter< T >::operator bool ( ) const
inline

Definition at line 91 of file BLI_user_counter.hh.

References data_.

◆ operator*() [1/2]

template<typename T >
T& blender::UserCounter< T >::operator* ( )
inline

Definition at line 79 of file BLI_user_counter.hh.

References BLI_assert, and data_.

◆ operator*() [2/2]

template<typename T >
const T& blender::UserCounter< T >::operator* ( ) const
inline

Definition at line 85 of file BLI_user_counter.hh.

References BLI_assert, and data_.

◆ operator->() [1/2]

template<typename T >
T* blender::UserCounter< T >::operator-> ( )
inline

Definition at line 67 of file BLI_user_counter.hh.

References BLI_assert, and data_.

◆ operator->() [2/2]

template<typename T >
const T* blender::UserCounter< T >::operator-> ( ) const
inline

Definition at line 73 of file BLI_user_counter.hh.

References BLI_assert, and data_.

◆ operator=() [1/2]

template<typename T >
UserCounter& blender::UserCounter< T >::operator= ( const UserCounter< T > &  other)
inline

Definition at line 43 of file BLI_user_counter.hh.

References data_.

◆ operator=() [2/2]

template<typename T >
UserCounter& blender::UserCounter< T >::operator= ( UserCounter< T > &&  other)
inline

Definition at line 55 of file BLI_user_counter.hh.

References data_.

◆ release()

template<typename T >
T* blender::UserCounter< T >::release ( )
inline

Definition at line 106 of file BLI_user_counter.hh.

References data, data_, and T.

◆ reset()

template<typename T >
void blender::UserCounter< T >::reset ( )
inline

Definition at line 113 of file BLI_user_counter.hh.

References data_.

Friends And Related Function Documentation

◆ operator<<

template<typename T >
std::ostream& operator<< ( std::ostream &  stream,
const UserCounter< T > &  value 
)
friend

Definition at line 134 of file BLI_user_counter.hh.

◆ operator==

template<typename T >
bool operator== ( const UserCounter< T > &  a,
const UserCounter< T > &  b 
)
friend

Definition at line 129 of file BLI_user_counter.hh.


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