|
Bifrost SDK
Bifrost SDK documentation
|
Helper guard to allow mutation on a pointee for the lifescope of the PtrGuard<T> but then reassigning to the source Ptr upon its destruction. More...
#include <Ptr.h>
Public Member Functions | |
| PtrGuard (Ptr< T > &src) | |
| Constructor. More... | |
| PtrGuard (Ptr< T > &src, PtrGuardUniqueFlag) | |
| Constructor for the guard when the pointer is known to be uniquely owned at compile time. More... | |
| template<class Y , class = if_convertible_from<Y>> | |
| PtrGuard (Ptr< Y > &src) | |
| Conversion constructor. More... | |
| PtrGuard (PtrGuard &&) noexcept=default | |
| Move constructor. More... | |
| PtrGuard (PtrGuard const &) noexcept=delete | |
| PtrGuard are not copy constructible. More... | |
| PtrGuard & | operator= (PtrGuard &&) noexcept=delete |
| PtrGuard are not move assignable. More... | |
| PtrGuard & | operator= (PtrGuard const &) noexcept=delete |
| PtrGuard are not copy assignable. More... | |
| ~PtrGuard () | |
| Destructor. More... | |
| T & | operator* () |
| Returns a reference to the uniquely owned object. More... | |
| T * | operator-> () |
| Returns a pointer to the uniquely owned object. More... | |
| const T & | operator* () const |
| Returns a const reference to the uniquely owned object. More... | |
| const T * | operator-> () const |
| Returns a const pointer to the uniquely owned object. More... | |
Helper guard to allow mutation on a pointee for the lifescope of the PtrGuard<T> but then reassigning to the source Ptr upon its destruction.
This effectively calls Amino::Ptr<T>::toMutable() upon construction and Amino::MutablePtr<T>::toImmutable() upon destruction. It can be more convenient and safer than transferring ownership manually since reassignment in the original Ptr is guaranteed and may therefore avoid programmatic errors (for example forgetting to assign back on an early return).
|
inlineexplicit |
|
inlineexplicit |
Constructor for the guard when the pointer is known to be uniquely owned at compile time.
|
inlineexplicit |
|
defaultnoexcept |
Move constructor.
|
deletenoexcept |
PtrGuard are not copy constructible.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
deletenoexcept |
PtrGuard are not move assignable.
|
deletenoexcept |
PtrGuard are not copy assignable.