cgv
Loading...
Searching...
No Matches
cgv::data::ref_ptr_impl< T, true > Class Template Reference
Inheritance diagram for cgv::data::ref_ptr_impl< T, true >:
cgv::data::ref_ptr_tag

Public Member Functions

int get_count () const
 return the reference count

Protected Member Functions

void release ()
 if the pointer had been initialized before, decrement reference count and release pointer, if necessary delete instance
T * ref () const
 return the pointer itself
 ref_ptr_impl (T *p)
 construct from pointer and increment reference count
 ref_ptr_impl (const ref_ptr_impl< T, true > &r)
 copy construct from same pointer type and increment count
template<typename S>
 ref_ptr_impl (const ref_ptr_impl< S, true > &s)
 copy construct from pointer of derived type with virtual destructor
Protected Member Functions inherited from cgv::data::ref_ptr_tag
void inc_ref_count (const ref_counted *ptr) const
 increment the count of a ref counted object
bool dec_ref_count (const ref_counted *ptr) const
 decrement the count of a ref counted object and return whether to delete the object

Protected Attributes

counter_type * counter
 store pointer to counter struct

Friends

class ref_ptr_impl< const T, is_ref_counted >

Detailed Description

template<typename T>
class cgv::data::ref_ptr_impl< T, true >

Definition at line 103 of file ref_ptr.h.

Constructor & Destructor Documentation

◆ ref_ptr_impl() [1/3]

template<typename T>
cgv::data::ref_ptr_impl< T, true >::ref_ptr_impl ( T * p)
inlineexplicitprotected

construct from pointer and increment reference count

Definition at line 122 of file ref_ptr.h.

References cgv::data::ref_ptr_tag::inc_ref_count().

Referenced by ref_ptr_impl(), and ref_ptr_impl().

◆ ref_ptr_impl() [2/3]

template<typename T>
cgv::data::ref_ptr_impl< T, true >::ref_ptr_impl ( const ref_ptr_impl< T, true > & r)
inlineprotected

copy construct from same pointer type and increment count

Definition at line 127 of file ref_ptr.h.

References cgv::data::ref_ptr_tag::inc_ref_count(), ref(), and ref_ptr_impl().

◆ ref_ptr_impl() [3/3]

template<typename T>
template<typename S>
cgv::data::ref_ptr_impl< T, true >::ref_ptr_impl ( const ref_ptr_impl< S, true > & s)
inlineprotected

copy construct from pointer of derived type with virtual destructor

Definition at line 134 of file ref_ptr.h.

References cgv::data::ref_ptr_tag::inc_ref_count(), and ref_ptr_impl().

Member Function Documentation

◆ get_count()

template<typename T>
int cgv::data::ref_ptr_impl< T, true >::get_count ( ) const
inline

return the reference count

Definition at line 149 of file ref_ptr.h.

◆ ref()

template<typename T>
T * cgv::data::ref_ptr_impl< T, true >::ref ( ) const
inlineprotected

return the pointer itself

Definition at line 118 of file ref_ptr.h.

Referenced by ref_ptr_impl().

◆ release()

template<typename T>
void cgv::data::ref_ptr_impl< T, true >::release ( )
inlineprotected

if the pointer had been initialized before, decrement reference count and release pointer, if necessary delete instance

Definition at line 108 of file ref_ptr.h.

References cgv::data::ref_ptr_tag::dec_ref_count().

◆ ref_ptr_impl< const T, is_ref_counted >

friend class ref_ptr_impl< const T, is_ref_counted >
friend

Definition at line 31 of file ref_ptr.h.

Member Data Documentation

◆ counter

counter_type* cgv::data::ref_ptr_impl< T, is_ref_counted >::counter
mutableprotected

store pointer to counter struct

Definition at line 57 of file ref_ptr.h.


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