Disk ARchive
2.7.15
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 | |
smart_pointer (T *arg) | |
creates a smart_pointer pointing to an allocated memory More... | |
smart_pointer (const smart_pointer &ref) | |
copy constructor | |
smart_pointer (smart_pointer &&ref) noexcept | |
move constructor | |
~smart_pointer () | |
destructor | |
smart_pointer & | operator= (const smart_pointer &ref) |
assignment operator | |
smart_pointer & | operator= (smart_pointer &&ref) |
move assignment operator | |
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 | |
T * | operator-> () const |
content-of field operator (when the pointed to object is a struct or class | |
bool | is_null () const |
return whether the smart_pointer is pointing to nullptr | |
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 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 |
assignment operator from a base type pointer (not from a smart_pointer)
Definition at line 151 of file smart_pointer.hpp.