|
tenno 0.1.0
|
A shared pointer. More...
#include <memory.hpp>
Data Structures | |
| struct | control_block |
Public Types | |
| using | element_type = T |
| The type of the object to point to. | |
Public Member Functions | |
| shared_ptr () noexcept | |
| Default constructor. | |
| shared_ptr (T *ptr) | |
| Construct a new shared pointer object. | |
| shared_ptr (T *ptr, Deleter deleter) | |
| Construct a new shared pointer object. | |
| shared_ptr (T *ptr, Deleter deleter, Alloc alloc) | |
| Construct a new shared pointer object. | |
| shared_ptr (const shared_ptr &other) noexcept | |
| Copy constructor. | |
| shared_ptr (shared_ptr &&other) noexcept | |
| Move constructor. | |
| ~shared_ptr () | |
| Destructor. | |
| shared_ptr & | operator= (shared_ptr &&other) noexcept |
| Move assignment operator. | |
| shared_ptr & | operator= (const shared_ptr &other) noexcept |
| Copy assignment operator. | |
| void | reset () noexcept |
| Reset the shared pointer. | |
| void | reset (T *ptr) noexcept |
| Reset the shared pointer to point to the object managed by the control block cb. | |
| void | reset (T *ptr, Deleter deleter) noexcept |
| Reset the shared pointer to point to the object managed by the control block cb. | |
| void | reset (T *ptr, Deleter deleter, Alloc alloc) noexcept |
| Reset the shared pointer to point to the object managed by the control block cb. | |
| void | swap (shared_ptr &other) noexcept |
| Swap the shared pointer with another shared pointer. | |
| T * | get () const noexcept |
| Get the object pointed to by the shared pointer. | |
| T & | operator* () const noexcept |
| Dereference operator. | |
| T * | operator-> () const noexcept |
| Member access operator. | |
| auto & | operator[] (tenno::size index) const noexcept |
| Array access operator. | |
| long | use_count () const noexcept |
| Get the number of shared pointers pointing to the object. | |
| operator bool () const noexcept | |
| Check if the shared pointer is empty. | |
| bool | owner_before (const shared_ptr &other) const noexcept |
| Stored value ordering. | |
| bool | owner_equal (const shared_ptr &other) const noexcept |
| Stored value equality. | |
Data Fields | |
| friend | control_block |
Friends | |
| class | tenno::weak_ptr< T > |
| template<class Y , class... Args> | |
| std::enable_if<!std::is_array< Y >::value, shared_ptr< Y > >::type | make_shared (Args &&... args) |
| Create a shared pointer with the given arguments. | |
| template<class Y > | |
| shared_ptr< Y > | make_shared () |
| Default initialize a shared pointer. | |
| template<class Y > | |
| std::enable_if< std::is_array< Y >::value, shared_ptr< Y > >::type | make_shared (tenno::size n) |
A shared pointer.
| T | The type of the object to point to |
Definition at line 88 of file memory.hpp.
| using tenno::shared_ptr< T, Deleter, Alloc >::element_type = T |
The type of the object to point to.
Definition at line 94 of file memory.hpp.
|
inlinenoexcept |
Default constructor.
Definition at line 128 of file memory.hpp.
|
inline |
Construct a new shared pointer object.
| ptr | The object to point to |
Definition at line 137 of file memory.hpp.
|
inline |
Construct a new shared pointer object.
| ptr | The object to point to |
| deleter | The deleter to use to delete the object |
Definition at line 158 of file memory.hpp.
|
inline |
Construct a new shared pointer object.
| ptr | The object to point to |
| deleter | The deleter to use to delete the object |
| allocator | The allocator to use to allocate the control block |
Definition at line 180 of file memory.hpp.
|
inlinenoexcept |
Copy constructor.
| other | The shared pointer to copy |
Definition at line 200 of file memory.hpp.
|
inlinenoexcept |
Move constructor.
| other | The shared pointer to move |
Definition at line 212 of file memory.hpp.
|
inline |
Destructor.
Definition at line 222 of file memory.hpp.
|
inlinenoexcept |
Get the object pointed to by the shared pointer.
Definition at line 427 of file memory.hpp.
|
inlineexplicitnoexcept |
Check if the shared pointer is empty.
Definition at line 481 of file memory.hpp.
|
inlinenoexcept |
Dereference operator.
Definition at line 437 of file memory.hpp.
|
inlinenoexcept |
Member access operator.
Definition at line 447 of file memory.hpp.
|
inlinenoexcept |
Copy assignment operator.
| other | The shared pointer to copy |
Definition at line 259 of file memory.hpp.
|
inlinenoexcept |
Move assignment operator.
| other | The shared pointer to move |
Definition at line 243 of file memory.hpp.
|
inlinenoexcept |
Array access operator.
| index | The index of the element to access |
Definition at line 458 of file memory.hpp.
|
inlinenoexcept |
Stored value ordering.
| other | The shared pointer to compare with |
Definition at line 493 of file memory.hpp.
|
inlinenoexcept |
Stored value equality.
| other | The shared pointer to compare with |
Definition at line 506 of file memory.hpp.
|
inlinenoexcept |
Reset the shared pointer.
Definition at line 285 of file memory.hpp.
|
inlinenoexcept |
Reset the shared pointer to point to the object managed by the control block cb.
| cb | The control block to manage the object |
Definition at line 309 of file memory.hpp.
|
inlinenoexcept |
Reset the shared pointer to point to the object managed by the control block cb.
| cb | The control block to manage the object |
| deleter | The deleter to use to delete the object |
Definition at line 343 of file memory.hpp.
|
inlinenoexcept |
Reset the shared pointer to point to the object managed by the control block cb.
| cb | The control block to manage the object |
| deleter | The deleter to use to delete the object |
| allocator | The allocator to use to allocate the object |
Definition at line 378 of file memory.hpp.
|
inlinenoexcept |
Swap the shared pointer with another shared pointer.
| other | The shared pointer to swap with |
Definition at line 410 of file memory.hpp.
|
inlinenoexcept |
Get the number of shared pointers pointing to the object.
Definition at line 468 of file memory.hpp.
|
friend |
Default initialize a shared pointer.
| T | The type of the object to create |
Definition at line 1061 of file memory.hpp.
|
friend |
Create a shared pointer with the given arguments.
| T | The type of the object to create |
| Args | The type of the arguments to pass to the constructor |
| args | The arguments to pass to the constructor |
Definition at line 1017 of file memory.hpp.
|
friend |
Definition at line 1037 of file memory.hpp.
|
friend |
Definition at line 115 of file memory.hpp.
| friend tenno::shared_ptr< T, Deleter, Alloc >::control_block |
Definition at line 115 of file memory.hpp.