|
cgv
|
reference counted pointer, which can work together with types that are derived from ref_counted, in which case the reference count of ref_counted is used. More...
#include <ref_ptr.h>
Public Types | |
| typedef ref_ptr< T, is_ref_counted > | this_type |
| type of the reference counted pointer | |
| typedef ref_ptr_impl< T, is_ref_counted > | base_type |
| type of base class that implements the reference count specific methods | |
Public Member Functions | |
| ref_ptr (T *p=0) | |
| construction from pointer or empty if pointer is not given | |
| ref_ptr (const this_type &r) | |
| copy constructor for reference pointers of the same type | |
| ~ref_ptr () | |
| destruct reference counted pointer | |
| template<typename S > | |
| ref_ptr (const ref_ptr< S, is_ref_counted > &s) | |
| allow to copy ref_ptr | |
| template<typename S > | |
| ref_ptr< S, is_ref_counted > | down_cast () const |
| use static cast to convert from T to S if T is a base class of S and has a virtual destructor | |
| this_type & | operator= (const this_type &r) |
| assignment to pointer of same type | |
| template<typename S > | |
| this_type & | operator= (const ref_ptr< S, is_ref_counted > &r) |
| assignment to pointer of derived type with virtual destructor | |
| T & | operator* () const |
| access to element | |
| T * | operator-> () const |
| access to element pointer | |
| bool | operator== (const this_type &r) const |
| compare by pointer | |
| bool | operator< (const this_type &r) const |
| compare by pointer | |
| bool | operator!= (const this_type &r) const |
| compare by pointer | |
| bool | unique () const |
| check if this is the only reference | |
| bool | empty () const |
| check if pointer is not yet set | |
| operator bool () const | |
| conversion to bool results in false if the stored pointer is a null pointer | |
| void | clear () |
| set to null pointer | |
Public Member Functions inherited from cgv::data::ref_ptr_impl< T, is_ref_counted > | |
| int | get_count () const |
| return current count | |
Additional Inherited Members | |
Protected Member Functions inherited from cgv::data::ref_ptr_impl< T, is_ref_counted > | |
| 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 inherited from cgv::data::ref_ptr_impl< T, is_ref_counted > | |
| counter_type * | counter |
| store pointer to counter struct | |
reference counted pointer, which can work together with types that are derived from ref_counted, in which case the reference count of ref_counted is used.
Otherwise a reference count is allocated and access to the stored instance needs to follow two pointers.
| typedef ref_ptr_impl<T,is_ref_counted> cgv::data::ref_ptr< T, is_ref_counted >::base_type |
| typedef ref_ptr<T,is_ref_counted> cgv::data::ref_ptr< T, is_ref_counted >::this_type |
|
inline |
|
inline |
|
inline |
destruct reference counted pointer
Definition at line 172 of file ref_ptr.h.
References cgv::data::ref_ptr_impl< T, is_ref_counted >::release().
|
inline |
|
inline |
set to null pointer
Definition at line 238 of file ref_ptr.h.
References cgv::data::ref_ptr_impl< T, is_ref_counted >::release().
Referenced by cgv::gui::gui_group::release_all_managed_objects(), and cgv::base::factory::release_singleton().
|
inline |
use static cast to convert from T to S if T is a base class of S and has a virtual destructor
Definition at line 180 of file ref_ptr.h.
Referenced by cgv::gui::gui_group::add_control(), cgv::gui::gui_group::add_control(), cgv::gui::gui_group::add_view(), cgv::gui::gui_group::find_control(), and cgv::gui::gui_group::find_view().
|
inline |
check if pointer is not yet set
Definition at line 230 of file ref_ptr.h.
References cgv::data::ref_ptr_impl< T, is_ref_counted >::get_count().
Referenced by cgv::gui::provider::add_button(), cgv::gui::provider::add_control(), cgv::gui::provider::add_control(), cgv::gui::provider::add_control_void(), cgv::gui::provider::add_decorator(), cgv::gui::provider::add_group(), cgv::gui::event_handler::add_key_control(), cgv::gui::provider::add_view(), cgv::gui::provider::add_view_void(), cgv::gui::provider::align(), cgv::render::shader_program::collect_dir(), cgv::gui::connect_gamepad_server(), cgv::gui::connect_vr_server(), cgv::gui::application::copy_to_clipboard(), cgv::gui::create_text_editor(), cgv::gui::directory_open_dialog(), cgv::gui::directory_save_dialog(), cgv::render::context::draw_text(), cgv::gui::file_open_dialog(), cgv::gui::file_save_dialog(), cgv::gui::files_open_dialog(), cgv::gui::provider::find_control(), cgv::gui::provider::find_control_void(), cgv::gui::provider::find_element(), cgv::render::shader_code::find_file(), cgv::gui::provider::find_view(), cgv::gui::provider::find_view_void(), cgv::render::gl::gl_context::get_current_font_face(), cgv::render::gl::gl_context::get_info_font_face(), cgv::gui::application::get_nr_windows(), cgv::base::grab_focus(), cgv::base::group::link(), cgv::gui::message(), cgv::data::ref_ptr< T, is_ref_counted >::operator bool(), cgv::gui::application::paste_from_clipboard(), cgv::gui::query(), cgv::gui::question(), cgv::gui::question(), cgv::gui::application::quit(), cgv::render::shader_code::read_code_file(), cgv::gui::provider::remove_all_elements(), cgv::gui::provider::remove_element(), cgv::gui::application::run(), cgv::gui::application::set_focus(), cgv::base::traverser::traverse_tmp_1(), and cgv::base::group::unlink().
|
inline |
conversion to bool results in false if the stored pointer is a null pointer
Definition at line 234 of file ref_ptr.h.
References cgv::data::ref_ptr< T, is_ref_counted >::empty().
|
inline |
compare by pointer
Definition at line 222 of file ref_ptr.h.
References cgv::data::ref_ptr_impl< T, is_ref_counted >::ref().
|
inline |
access to element
Definition at line 206 of file ref_ptr.h.
References cgv::data::ref_ptr_impl< T, is_ref_counted >::ref().
|
inline |
access to element pointer
Definition at line 210 of file ref_ptr.h.
References cgv::data::ref_ptr_impl< T, is_ref_counted >::ref().
|
inline |
compare by pointer
Definition at line 218 of file ref_ptr.h.
References cgv::data::ref_ptr_impl< T, is_ref_counted >::ref().
|
inline |
|
inline |
assignment to pointer of same type
Definition at line 191 of file ref_ptr.h.
References cgv::data::ref_ptr_impl< T, is_ref_counted >::release().
|
inline |
compare by pointer
Definition at line 214 of file ref_ptr.h.
References cgv::data::ref_ptr_impl< T, is_ref_counted >::ref().
|
inline |
check if this is the only reference
Definition at line 226 of file ref_ptr.h.
References cgv::data::ref_ptr_impl< T, is_ref_counted >::get_count().