cgv
Loading...
Searching...
No Matches
cgv::data::ref_ptr_impl< T, is_ref_counted > Class Template Reference
Inheritance diagram for cgv::data::ref_ptr_impl< T, is_ref_counted >:
cgv::data::ref_ptr< base, true > cgv::data::ref_ptr< node, true > cgv::data::ref_ptr< window > cgv::data::ref_ptr< group, true > cgv::data::ref_ptr< gui_group, true > cgv::data::ref_ptr< font_face > cgv::data::ref_ptr< font > cgv::data::ref_ptr< T, is_ref_counted >

Classes

struct  counter_type
 struct to store the pointer with a count More...
 

Public Member Functions

int get_count () const
 return current count
 

Protected Member Functions

void release ()
 decrement the count, delete if it is 0
 
T * ref () const
 return the pointer itself
 
 ref_ptr_impl (T *p=0)
 construct reference counted pointer
 
 ref_ptr_impl (const ref_ptr_impl< T, false > &r)
 copy construct from same pointer type and increment count
 
template<typename S >
 ref_ptr_impl (const ref_ptr_impl< S, false > &s)
 copy construct from pointer of derived type with virtual destructor
 

Protected Attributes

counter_typecounter
 store pointer to counter struct
 

Friends

class ref_ptr_impl< const T, is_ref_counted >
 

Detailed Description

template<typename T, bool is_ref_counted = false>
class cgv::data::ref_ptr_impl< T, is_ref_counted >

Definition at line 45 of file ref_ptr.h.

Constructor & Destructor Documentation

◆ ref_ptr_impl() [1/3]

template<typename T , bool is_ref_counted = false>
cgv::data::ref_ptr_impl< T, is_ref_counted >::ref_ptr_impl ( T *  p = 0)
inlineexplicitprotected

construct reference counted pointer

Definition at line 73 of file ref_ptr.h.

References cgv::data::ref_ptr_impl< T, is_ref_counted >::counter.

◆ ref_ptr_impl() [2/3]

template<typename T , bool is_ref_counted = false>
cgv::data::ref_ptr_impl< T, is_ref_counted >::ref_ptr_impl ( const ref_ptr_impl< T, false > &  r)
inlineprotected

copy construct from same pointer type and increment count

Definition at line 78 of file ref_ptr.h.

References cgv::data::ref_ptr_impl< T, is_ref_counted >::counter.

◆ ref_ptr_impl() [3/3]

template<typename T , bool is_ref_counted = false>
template<typename S >
cgv::data::ref_ptr_impl< T, is_ref_counted >::ref_ptr_impl ( const ref_ptr_impl< S, false > &  s)
inlineprotected

copy construct from pointer of derived type with virtual destructor

Definition at line 85 of file ref_ptr.h.

References cgv::data::ref_ptr_impl< T, is_ref_counted >::counter.

Member Function Documentation

◆ get_count()

template<typename T , bool is_ref_counted = false>
int cgv::data::ref_ptr_impl< T, is_ref_counted >::get_count ( ) const
inline

◆ ref()

◆ release()

template<typename T , bool is_ref_counted = false>
void cgv::data::ref_ptr_impl< T, is_ref_counted >::release ( )
inlineprotected

Friends And Related Symbol Documentation

◆ ref_ptr_impl< const T, is_ref_counted >

template<typename T , bool is_ref_counted = false>
friend class ref_ptr_impl< const T, is_ref_counted >
friend

Definition at line 31 of file ref_ptr.h.

Member Data Documentation

◆ counter


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