MRPT  1.9.9
List of all members | Public Member Functions | Protected Attributes
mrpt::ignored_copy_ptr< T > Struct Template Reference

Detailed Description

template<class T>
struct mrpt::ignored_copy_ptr< T >

A wrapper class for pointers whose copy operations from other objects of the same type are ignored, that is, doing "a=b;" has no effect neiter on "a" or "b".

In turn, assigning a pointer with a direct "=" operation from a plain "T*" type is permited.

See also
safe_ptr, non_copiable_ptr, copiable_NULL_ptr

Definition at line 225 of file safe_pointers.h.

#include <mrpt/core/safe_pointers.h>

Inheritance diagram for mrpt::ignored_copy_ptr< T >:

Public Member Functions

 ignored_copy_ptr ()
 
 ignored_copy_ptr (const ignored_copy_ptr< T > &)
 
 ignored_copy_ptr (const T *p)
 
ignored_copy_ptr< T > & operator= (T *p)
 
ignored_copy_ptr< T > & operator= (const ignored_copy_ptr< T > &)
 
void set (const T *p)
 This method can change the pointer, since the change is made explicitly, not through copy operators transparent to the user. More...
 
virtual ~ignored_copy_ptr ()=default
 
bool operator== (const T *o) const
 
bool operator== (const ignored_copy_ptr< T > &o) const
 
bool operator!= (const T *o) const
 
bool operator!= (const ignored_copy_ptr< T > &o) const
 
T *& get ()
 
const T * get () const
 
T ** getPtrToPtr ()
 
T *& operator-> ()
 
const T * operator-> () const
 

Protected Attributes

T * ptr
 

Constructor & Destructor Documentation

◆ ignored_copy_ptr() [1/3]

template<class T>
mrpt::ignored_copy_ptr< T >::ignored_copy_ptr ( )
inline

Definition at line 231 of file safe_pointers.h.

◆ ignored_copy_ptr() [2/3]

template<class T>
mrpt::ignored_copy_ptr< T >::ignored_copy_ptr ( const ignored_copy_ptr< T > &  )
inline

Definition at line 232 of file safe_pointers.h.

◆ ignored_copy_ptr() [3/3]

template<class T>
mrpt::ignored_copy_ptr< T >::ignored_copy_ptr ( const T *  p)
inline

Definition at line 233 of file safe_pointers.h.

◆ ~ignored_copy_ptr()

template<class T>
virtual mrpt::ignored_copy_ptr< T >::~ignored_copy_ptr ( )
virtualdefault

Member Function Documentation

◆ get() [1/2]

template<class T>
T*& mrpt::ignored_copy_ptr< T >::get ( )
inline

Definition at line 249 of file safe_pointers.h.

◆ get() [2/2]

template<class T>
const T* mrpt::ignored_copy_ptr< T >::get ( ) const
inline

Definition at line 250 of file safe_pointers.h.

◆ getPtrToPtr()

template<class T>
T** mrpt::ignored_copy_ptr< T >::getPtrToPtr ( )
inline

Definition at line 251 of file safe_pointers.h.

◆ operator!=() [1/2]

template<class T>
bool mrpt::ignored_copy_ptr< T >::operator!= ( const T *  o) const
inline

Definition at line 247 of file safe_pointers.h.

◆ operator!=() [2/2]

template<class T>
bool mrpt::ignored_copy_ptr< T >::operator!= ( const ignored_copy_ptr< T > &  o) const
inline

Definition at line 248 of file safe_pointers.h.

◆ operator->() [1/2]

template<class T>
T*& mrpt::ignored_copy_ptr< T >::operator-> ( )
inline

Definition at line 252 of file safe_pointers.h.

◆ operator->() [2/2]

template<class T>
const T* mrpt::ignored_copy_ptr< T >::operator-> ( ) const
inline

Definition at line 257 of file safe_pointers.h.

◆ operator=() [1/2]

template<class T>
ignored_copy_ptr<T>& mrpt::ignored_copy_ptr< T >::operator= ( T *  p)
inline

Definition at line 234 of file safe_pointers.h.

◆ operator=() [2/2]

template<class T>
ignored_copy_ptr<T>& mrpt::ignored_copy_ptr< T >::operator= ( const ignored_copy_ptr< T > &  )
inline

Definition at line 240 of file safe_pointers.h.

◆ operator==() [1/2]

template<class T>
bool mrpt::ignored_copy_ptr< T >::operator== ( const T *  o) const
inline

Definition at line 245 of file safe_pointers.h.

◆ operator==() [2/2]

template<class T>
bool mrpt::ignored_copy_ptr< T >::operator== ( const ignored_copy_ptr< T > &  o) const
inline

Definition at line 246 of file safe_pointers.h.

◆ set()

template<class T>
void mrpt::ignored_copy_ptr< T >::set ( const T *  p)
inline

This method can change the pointer, since the change is made explicitly, not through copy operators transparent to the user.

Definition at line 243 of file safe_pointers.h.

Member Data Documentation

◆ ptr

template<class T>
T* mrpt::ignored_copy_ptr< T >::ptr
protected



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 479715d5b Tue Nov 12 07:26:21 2019 +0100 at mar nov 12 07:30:12 CET 2019