MOS Source Code
Loading...
Searching...
No Matches
__shared_ptr_core< T > Struct Template Reference

#include <shared_ptr.hpp>

+ Inheritance diagram for __shared_ptr_core< T >:
+ Collaboration diagram for __shared_ptr_core< T >:

Public Member Functions

 __shared_ptr_core (T *ptr, size_t own, size_t weak)
 
 ~__shared_ptr_core ()
 
void _dec_weak ()
 
void _inc_weak ()
 
void _inc_use ()
 
void _dec_use ()
 
bool _can_delete () const
 
size_t _use_count () const
 
size_t _weak_count () const
 

Public Attributes

T * _ptr
 

Private Attributes

size_t _n_own
 
size_t _n_weak
 

Friends

bool operator== (const __shared_ptr_core &lhs, const __shared_ptr_core &rhs)
 

Additional Inherited Members

- Static Public Attributes inherited from NamedType<"shared_ptr.core">
static constexpr mos::string_view type_name
 

Detailed Description

template<typename T>
struct mos::__shared_ptr_core< T >

Definition at line 24 of file shared_ptr.hpp.

Constructor & Destructor Documentation

◆ __shared_ptr_core()

template<typename T>
__shared_ptr_core ( T * ptr,
size_t own,
size_t weak )
inlineexplicit

Definition at line 26 of file shared_ptr.hpp.

Referenced by operator==.

◆ ~__shared_ptr_core()

template<typename T>
~__shared_ptr_core ( )
inline

Definition at line 27 of file shared_ptr.hpp.

Member Function Documentation

◆ _dec_weak()

template<typename T>
void _dec_weak ( )
inline

Definition at line 33 of file shared_ptr.hpp.

◆ _inc_weak()

template<typename T>
void _inc_weak ( )
inline

Definition at line 34 of file shared_ptr.hpp.

◆ _inc_use()

template<typename T>
void _inc_use ( )
inline

Definition at line 35 of file shared_ptr.hpp.

◆ _dec_use()

template<typename T>
void _dec_use ( )
inline

Definition at line 36 of file shared_ptr.hpp.

◆ _can_delete()

template<typename T>
bool _can_delete ( ) const
inline

Definition at line 39 of file shared_ptr.hpp.

◆ _use_count()

template<typename T>
size_t _use_count ( ) const
inline

Definition at line 44 of file shared_ptr.hpp.

◆ _weak_count()

template<typename T>
size_t _weak_count ( ) const
inline

Definition at line 49 of file shared_ptr.hpp.

Friends And Related Symbol Documentation

◆ operator==

template<typename T>
bool operator== ( const __shared_ptr_core< T > & lhs,
const __shared_ptr_core< T > & rhs )
friend

Definition at line 54 of file shared_ptr.hpp.

Member Data Documentation

◆ _ptr

template<typename T>
T* _ptr

Definition at line 60 of file shared_ptr.hpp.

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

◆ _n_own

template<typename T>
size_t _n_own
private

Definition at line 63 of file shared_ptr.hpp.

Referenced by __shared_ptr_core(), _can_delete(), _dec_use(), _inc_use(), and _use_count().

◆ _n_weak

template<typename T>
size_t _n_weak
private

Definition at line 64 of file shared_ptr.hpp.

Referenced by __shared_ptr_core(), _dec_weak(), _inc_weak(), and _weak_count().


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