|
UraniumCompute 0.1.0
A GPU accelerated parallel task scheduler
|
Shared smart pointer implementation that uses reference counting. More...
#include <Ptr.h>
Public Types | |
| using | ObjectType = T |
Public Member Functions | |
| Ptr () noexcept | |
| Create a null reference counted pointer. | |
| Ptr (T *pObject) noexcept | |
| Create a pointer that points to the specified object. More... | |
| Ptr (const Ptr &other) noexcept | |
| Copy a pointer (adds a strong reference to underlying object). More... | |
| template<class T1 > | |
| Ptr (const Ptr< T1 > &other) noexcept | |
| Copy a pointer (adds a strong reference to underlying object). More... | |
| Ptr (Ptr &&other) noexcept | |
| Move a pointer (doesn't add a strong reference to underlying object). More... | |
| void | Swap (Ptr &other) |
| Swap raw pointers of two objects without incrementing and decrementing ref-counters. | |
| Ptr & | operator= (const Ptr &other) |
| Copy a pointer (adds a strong reference to underlying object). More... | |
| Ptr & | operator= (Ptr &&other) noexcept |
| Move a pointer (doesn't add a strong reference to underlying object). More... | |
| void | Reset () |
| Set a pointer to null. | |
| T *const * | GetAddressOf () const |
| Get pointer to the underlying pointer. | |
| T ** | GetAddressOf () |
| Get pointer to the underlying pointer. | |
| T ** | ReleaseAndGetAddressOf () |
| Release a strong reference and get pointer to the stored pointer. More... | |
| void | Attach (T *pObject) |
| Attach a pointer and do not add strong reference. | |
| T * | Detach () |
| Forget object and don't free it automatically. More... | |
| T * | Get () const |
| Get underlying raw pointer. | |
| template<class TDest > | |
| std::enable_if_t< std::is_base_of_v< TDest, T >, TDest * > | As () const |
| Get underlying raw pointer and cast it. | |
| template<class TDest > | |
| std::enable_if_t< std::is_base_of_v< T, TDest > &&!std::is_same_v< T, TDest >, TDest * > | As () const |
| Get underlying raw pointer and cast it. | |
| Internal::PtrRef< Ptr< T > > | operator& () |
| T & | operator* () |
| T * | operator-> () |
| const T & | operator* () const |
| const T * | operator-> () const |
| operator bool () const | |
Shared smart pointer implementation that uses reference counting.
See ReferenceCounter for more information.
| T | - Type of object to hold. |
|
inlinenoexcept |
Create a pointer that points to the specified object.
| pObject | - The pointer to object. |
Copy a pointer (adds a strong reference to underlying object).
| other | - Pointer to copy. |
Copy a pointer (adds a strong reference to underlying object).
| other | - Pointer to copy. |
Move a pointer (doesn't add a strong reference to underlying object).
| other | - Pointer to move. |
|
inline |
Forget object and don't free it automatically.
Can be useful to send an object to managed program.
Copy a pointer (adds a strong reference to underlying object).
| other | - Pointer to copy. |
Move a pointer (doesn't add a strong reference to underlying object).
| other | - Pointer to move. |
|
inline |
Release a strong reference and get pointer to the stored pointer.
It is the same as using unary '&' operator.