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< const type_interface, true > cgv::data::ref_ptr< base, true > cgv::data::ref_ptr< const base, true > cgv::data::ref_ptr< console, true > cgv::data::ref_ptr< group, true > cgv::data::ref_ptr< const group, true > cgv::data::ref_ptr< named, true > cgv::data::ref_ptr< const named, true > cgv::data::ref_ptr< node, true > cgv::data::ref_ptr< const node, true > cgv::data::ref_ptr< socket > cgv::data::ref_ptr< socket_client, true > cgv::data::ref_ptr< socket_server, true > cgv::data::ref_ptr< sparse_les, true > cgv::data::ref_ptr< sparse_les_factory, true > cgv::data::ref_ptr< font_face > cgv::data::ref_ptr< font > cgv::data::ref_ptr< font_server > cgv::data::ref_ptr< context_config > cgv::data::ref_ptr< render_config > cgv::data::ref_ptr< shader_config > cgv::data::ref_ptr< animation, true > cgv::data::ref_ptr< base_provider > cgv::data::ref_ptr< button > cgv::data::ref_ptr< abst_control > cgv::data::ref_ptr< gui_driver > cgv::data::ref_ptr< gui_group, true > cgv::data::ref_ptr< const gui_group, true > cgv::data::ref_ptr< layout > cgv::data::ref_ptr< layout_inline > cgv::data::ref_ptr< layout_table > cgv::data::ref_ptr< text_editor > cgv::data::ref_ptr< trigger_server > cgv::data::ref_ptr< abst_view > cgv::data::ref_ptr< window > cgv::data::ref_ptr< const window > cgv::data::ref_ptr< canvas_overlay > cgv::data::ref_ptr< color_scale_legend > cgv::data::ref_ptr< color_selector > cgv::data::ref_ptr< navigator > cgv::data::ref_ptr< overlay > cgv::data::ref_ptr< performance_monitor > cgv::data::ref_ptr< transfer_function_editor > 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_type * counter
 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.

◆ 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.

◆ 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.

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

return current count

Definition at line 99 of file ref_ptr.h.

Referenced by cgv::data::ref_ptr< T, is_ref_counted >::empty(), and cgv::data::ref_ptr< T, is_ref_counted >::unique().

◆ ref()

◆ release()

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

◆ 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

template<typename T, bool is_ref_counted = false>
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.

Referenced by ref_ptr_impl().


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