Disk ARchive 2.7.16
Full featured and portable backup and archiving tool
|
smart pointer class to be used to automagically manage multiple time pointed to address More...
#include <smart_pointer.hpp>
Public Member Functions | |
smart_pointer () | |
creates a smart_pointer equivalent to a pointer to NULL More... | |
smart_pointer (T *arg) | |
creates a smart_pointer pointing to an allocated memory More... | |
smart_pointer (const smart_pointer &ref) | |
copy constructor More... | |
smart_pointer (smart_pointer &&ref) noexcept | |
move constructor More... | |
~smart_pointer () | |
destructor More... | |
smart_pointer & | operator= (const smart_pointer &ref) |
assignment operator More... | |
smart_pointer & | operator= (smart_pointer &&ref) |
move assignment operator More... | |
const smart_pointer & | assign (T *arg) |
assignment operator from a base type pointer (not from a smart_pointer) More... | |
T & | operator* () const |
content-of operator More... | |
T * | operator-> () const |
content-of field operator (when the pointed to object is a struct or class More... | |
bool | is_null () const |
return whether the smart_pointer is pointing to nullptr More... | |
Private Attributes | |
smart_node< T > * | ptr |
smart pointer class to be used to automagically manage multiple time pointed to address
this class tend to mimic normal pointer with the additional feature of automatically releasing the pointed to object when no more smart_pointer point to it. In consequence:
Definition at line 78 of file smart_pointer.hpp.
|
inline |
creates a smart_pointer equivalent to a pointer to NULL
Definition at line 82 of file smart_pointer.hpp.
|
inline |
creates a smart_pointer pointing to an allocated memory
[in] | arg | is the address of the allocated memory the smart_pointer must manage, nullptr is allowed and lead to the same behavior as the constructor without argument |
Definition at line 90 of file smart_pointer.hpp.
|
inline |
copy constructor
Definition at line 104 of file smart_pointer.hpp.
|
inlinenoexcept |
move constructor
Definition at line 107 of file smart_pointer.hpp.
|
inline |
destructor
Definition at line 110 of file smart_pointer.hpp.
|
inline |
assignment operator from a base type pointer (not from a smart_pointer)
Definition at line 151 of file smart_pointer.hpp.
|
inline |
return whether the smart_pointer is pointing to nullptr
Definition at line 165 of file smart_pointer.hpp.
Referenced by libdar::cat_entree::get_compressor_layer(), libdar::cat_entree::get_escape_layer(), and libdar::cat_entree::get_pile().
|
inline |
content-of operator
Definition at line 159 of file smart_pointer.hpp.
|
inline |
content-of field operator (when the pointed to object is a struct or class
Definition at line 162 of file smart_pointer.hpp.
|
inline |
assignment operator
Definition at line 113 of file smart_pointer.hpp.
|
inline |
move assignment operator
Definition at line 134 of file smart_pointer.hpp.
|
private |
Definition at line 168 of file smart_pointer.hpp.