Smart pointer for non-polymorphic classes.
No shared copies, that is, each copy_ptr<T> owns a unique instance of T. Copying a copy_ptr<T> invokes the copy operator for T.
Definition at line 26 of file copy_ptr.h.
#include <mrpt/utils/copy_ptr.h>

Public Types | |
| typedef T | value_type |
| typedef internal::CopyStatic< T > | copier_t |
Public Member Functions | |
| copy_ptr (T *ptr) | |
| Ctor from a pointer; takes ownership. More... | |
| copy_ptr () | |
| Default ctor; init to nullptr. More... | |
| copy_ptr (const copy_ptr< T > &o) | |
copy ctor: makes a copy of the object via clone() More... | |
| copy_ptr< T > & | operator= (const copy_ptr< T > &o) |
| copy operator More... | |
| void | move_from (generic_copier_ptr &o) |
| T * | operator-> () |
| const T * | operator-> () const |
| T & | operator* (void) |
| const T & | operator* (void) const |
| T * | get () |
| const T * | get () const |
| operator bool () const | |
| bool | operator! (void) const |
| T * | release () |
| Releases the pointer (do not destroy the object) More... | |
| void | reset (T *ptr=NULL) |
| void | resetDefaultCtor () |
Protected Attributes | |
| T * | m_ptr |
Private Types | |
| typedef internal::generic_copier_ptr< T, internal::CopyStatic< T > > | ptr_base_t |
|
inherited |
Definition at line 50 of file generic_copier_ptr.h.
|
private |
Definition at line 29 of file copy_ptr.h.
|
inherited |
Definition at line 49 of file generic_copier_ptr.h.
|
inlineexplicit |
Ctor from a pointer; takes ownership.
Definition at line 32 of file copy_ptr.h.
|
inline |
Default ctor; init to nullptr.
Definition at line 34 of file copy_ptr.h.
|
inline |
copy ctor: makes a copy of the object via clone()
Definition at line 36 of file copy_ptr.h.
|
inlineinherited |
Definition at line 96 of file generic_copier_ptr.h.
|
inlineinherited |
Definition at line 97 of file generic_copier_ptr.h.
|
inlineinherited |
Definition at line 59 of file generic_copier_ptr.h.
|
inlineinherited |
Definition at line 99 of file generic_copier_ptr.h.
|
inlineinherited |
Definition at line 100 of file generic_copier_ptr.h.
|
inlineinherited |
Definition at line 87 of file generic_copier_ptr.h.
|
inlineinherited |
Definition at line 91 of file generic_copier_ptr.h.
|
inlineinherited |
Definition at line 78 of file generic_copier_ptr.h.
|
inlineinherited |
Definition at line 82 of file generic_copier_ptr.h.
|
inline |
copy operator
Definition at line 38 of file copy_ptr.h.
References mrpt::utils::internal::generic_copier_ptr< T, internal::CopyStatic< T > >::m_ptr, and mrpt::utils::internal::generic_copier_ptr< T, internal::CopyStatic< T > >::reset().
|
inlineinherited |
Releases the pointer (do not destroy the object)
Definition at line 103 of file generic_copier_ptr.h.
|
inlineinherited |
Definition at line 109 of file generic_copier_ptr.h.
Referenced by mrpt::utils::copy_ptr< T >::operator=(), and TEST().
|
inlineinherited |
Definition at line 114 of file generic_copier_ptr.h.
|
protectedinherited |
Definition at line 117 of file generic_copier_ptr.h.
Referenced by mrpt::utils::copy_ptr< T >::operator=().
| Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019 |