PCL
|
A smart pointer able to generate dynamically allocated copies of the objects pointed to by other smart pointers. More...
#include <AutoPointer.h>
Public Types | |
using | const_pointer = typename base_type::const_pointer |
using | deleter = typename base_type::deleter |
using | pointer = typename base_type::pointer |
using | value_type = typename base_type::value_type |
Public Types inherited from pcl::AutoPointer< T, StandardDeleter< T > > | |
using | const_pointer = const T * |
using | deleter = StandardDeleter< T > |
using | pointer = T * |
using | value_type = T |
AutoPointerCloner is like AutoPointer, from which it derives publicly, with the only and substantial difference that it makes a dynamically allocated copy (or clone) of the object pointed to by another smart pointer upon copy construction or copy assignment. This is useful in cases where a dynamically allocated data member object must be duplicated automatically by the copy constructors and copy assignment operator of its base class.
Definition at line 695 of file AutoPointer.h.
using pcl::AutoPointerCloner< T, D >::const_pointer = typename base_type::const_pointer |
Represents a pointer to an immutable object stored in this smart pointer.
Definition at line 714 of file AutoPointer.h.
using pcl::AutoPointerCloner< T, D >::deleter = typename base_type::deleter |
Represents the type of the object responsible for object deletion.
Definition at line 719 of file AutoPointer.h.
using pcl::AutoPointerCloner< T, D >::pointer = typename base_type::pointer |
Represents a pointer stored in this smart pointer.
Definition at line 709 of file AutoPointer.h.
using pcl::AutoPointerCloner< T, D >::value_type = typename base_type::value_type |
Represents the type of the object pointed to by this smart pointer.
Definition at line 704 of file AutoPointer.h.
|
inline |
Constructs a null smart pointer cloner.
autoDelete | Initial state of the automatic deletion feature. The default value is true, so auto deletion is always enabled by default for newly created AutoPointer objects. |
d | Deleter object, responsible for object destruction when the automatic deletion feature is enabled. |
A null smart pointer stores a null pointer, so it does not point to a valid object.
A copy of the specified deleter d will be used. If no deleter is specified, this object will use a default-constructed instance of the deleter template argument class.
Definition at line 739 of file AutoPointer.h.
|
inline |
Constructs a smart pointer cloner to store a given pointer.
p | The pointer to store in this AutoPointer instance. |
autoDelete | Initial state of the automatic deletion feature. The default value is true, so auto deletion is always enabled by default for newly created AutoPointer objects. |
d | Deleter object, responsible for object destruction when the automatic deletion feature is enabled. |
A copy of the specified deleter d will be used. If no deleter is specified, this object will use a default-constructed instance of the deleter template argument class.
Definition at line 762 of file AutoPointer.h.
|
inline |
Non-trivial copy constructor. Constructs a smart pointer cloner by making a dynamically allocated copy (or clone) of the object pointed to by the pointer stored in another smart pointer x.
The automatic deletion feature will be enabled for this object if a clone object is generated; otherwise it will be in the same state as it is currently set for the source object x.
Contrarily to the copy constructor of AutoPointer, the source smart pointer x will not be modified in any way by this constructor.
Definition at line 780 of file AutoPointer.h.
|
inline |
Copy constructor. Constructs a smart pointer cloner by making a dynamically allocated copy (or clone) of the object pointed to by the pointer stored in another smart pointer cloner x.
The automatic deletion feature will be enabled for this object if a clone object is generated; otherwise it will be in the same state as it is currently set for the source object x.
Contrarily to the copy constructor of AutoPointer, the source smart pointer x will not be modified in any way by this constructor.
Definition at line 801 of file AutoPointer.h.
|
inline |
Move constructor.
Definition at line 813 of file AutoPointer.h.
|
inline |
Move assignment operator. This function simply calls the base class version of the same operator and returns a reference to this object.
Definition at line 880 of file AutoPointer.h.
|
inline |
Copy assignment operator.
This assignment operator performs the following actions:
(1) If this smart pointer stores a valid (non-null) pointer, and the automatic deletion feature is enabled, the pointed object is destroyed by the deleter object. This behavior is the same as for AutoPointer.
(2) If the other smart pointer x stores a valid (non-null) pointer, a dynamically allocated copy (or clone) of the pointed object will be generated, and a pointer to the newly constructed object will be stored in this instance. In such case, the automatic deletion feature will be enabled for this object; otherwise, it will have the same state as in the source object x, and this object will store a null pointer.
(3) Returns a reference to this object.
In contrast to AutoPointer's copy assignment operator, this operator does not modify the specified source object x in any way.
Definition at line 868 of file AutoPointer.h.
|
inline |
Copy assignment from base class operator.
This assignment operator performs the following actions:
(1) If this smart pointer stores a valid (non-null) pointer, and the automatic deletion feature is enabled, the pointed object is destroyed by the deleter object. This behavior is the same as for AutoPointer.
(2) If the other smart pointer x stores a valid (non-null) pointer, a dynamically allocated copy (or clone) of the pointed object will be generated, and a pointer to the newly constructed object will be stored in this instance. In such case, the automatic deletion feature will be enabled for this object; otherwise, it will have the same state as in the source object x, and this object will store a null pointer.
(3) Returns a reference to this object.
In contrast to AutoPointer's copy assignment operator, this operator does not modify the specified source object x in any way.
Definition at line 839 of file AutoPointer.h.
|
inline |
Causes this smart pointer cloner to store the specified pointer p. Returns a reference to this object.
This member function is identical to its base class counterpart AutoPointer::operator =( pointer ). It is equivalent to:
Definition at line 895 of file AutoPointer.h.