Classical shared pointer.
More...
#include </home/travis/build/forGGe/theCore/lib/cpp/export/ecl/memory.hpp>
template<typename T>
class ecl::shared_ptr< T >
Classical shared pointer.
- Todo:
- Mention about manadatory allocator for creating shared pointer
◆ shared_ptr() [1/5]
Constructs default shared pointer with no managed object.
◆ ~shared_ptr()
Destroys shared pointer and if counter.
◆ shared_ptr() [2/5]
Initializes shared pointer with nullpointer.
◆ shared_ptr() [3/5]
Constrcuts from existing pointer and inherit its ownership.
If other pointer manages no object, this manages no object too.
- Parameters
-
[in] | other | Valid shared pointer. |
◆ shared_ptr() [4/5]
Moves other shared pointer and inherit ownership.
This will not increase refernce counter, obviously.
- Parameters
-
[in] | other | Valid shared pointer to move. After moving pointer will no longer hold any reference and will return to the default state. |
◆ shared_ptr() [5/5]
template<typename T >
template<typename U >
Constrcuts from existing pointer and inherit its ownership.
If other pointer manages no object, this manages no object too.
- Parameters
-
[in] | other | Valid shared pointer. |
- Template Parameters
-
◆ operator=() [1/4]
Shares ownership of the object with a pointer provided.
This shared pointer will release ownership of the previously managed object if any. In case other pointer owns an object then new ownership will be applied to this pointer and it will be shared with other pointer.
- Parameters
-
[in] | other | Valid shared pointer. |
- Returns
- This shared object.
◆ operator=() [2/4]
Moves ownership from the pointer provided.
This shared pointer will release ownership of the previously managed object if any. Other pointer will no longer own any object.
- Parameters
-
[in] | other | Valid shared pointer. |
- Returns
- This shared object.
◆ operator bool()
Returns true if this shared pointer manages the object.
◆ operator=() [3/4]
template<typename T>
template<typename U >
Shares ownership with a shared pointer of the derived type.
- Template Parameters
-
◆ unique()
Returns true if this pointer holds the last remaining node.
◆ get()
◆ operator*() [1/2]
Common smart pointer overload.
◆ operator*() [2/2]
Common smart pointer overload.
◆ operator->() [1/2]
Common smart pointer overload.
◆ operator->() [2/2]
Common smart pointer overload.
◆ operator=() [4/4]
template<typename T>
template<typename U >
◆ shared_ptr
template<typename T>
template<typename U >
Related shared pointer type.
- Template Parameters
-
◆ weak_ptr
template<typename T>
template<typename U >
Weak reference.
- Template Parameters
-
U | Is a T or a subclass of T. |
◆ allocate_shared
template<typename T>
template<typename U , class Alloc , class... Args>
shared_ptr< U > allocate_shared |
( |
const Alloc & |
alloc, |
|
|
Args... |
args |
|
) |
| |
|
friend |
Allocates a shared pointer.
- Template Parameters
-
U | Is a T or is a subclass of T. |
The documentation for this class was generated from the following file: