|
constexpr | refPtr () noexcept |
| Construct with no managed pointer. More...
|
|
constexpr | refPtr (std::nullptr_t) noexcept |
| Implicit construct from literal nullptr: no managed pointer. More...
|
|
constexpr | refPtr (T *p) noexcept |
| Construct, taking ownership of the pointer. More...
|
|
constexpr | refPtr (const T &obj) noexcept |
| Implicit construct for a const reference to an object. More...
|
|
| refPtr (refPtr< T > &&rhs) noexcept |
| Move construct, transferring ownership. More...
|
|
| refPtr (const refPtr< T > &rhs) |
| Copy construct (shallow copy) More...
|
|
| refPtr (const refPtr< T > &rhs, bool reuse) |
| Copy/move construct. Optionally reusing pointer. More...
|
|
| refPtr (std::unique_ptr< T > &&rhs) noexcept |
| Move construct from unique_ptr, transferring ownership. More...
|
|
| refPtr (const autoPtr< T > &)=delete |
| No copy construct from autoPtr, also avoids implicit cast to object or pointer. More...
|
|
| refPtr (autoPtr< T > &&rhs) noexcept |
| Move construct from autoPtr, transferring ownership. More...
|
|
| refPtr (const tmp< T > &rhs, bool reuse) |
| Reference tmp contents or transfer ownership if requested/possible. More...
|
|
| refPtr (const tmp< T > &rhs) |
| Reference the tmp contents. More...
|
|
| refPtr (tmp< T > &&rhs) |
| Move construct from tmp, transfer ownership if possible. More...
|
|
| ~refPtr () noexcept |
| Destructor: deletes managed pointer. More...
|
|
bool | good () const noexcept |
| True if pointer/reference is non-null. More...
|
|
bool | is_const () const noexcept |
| If the stored/referenced content is const. More...
|
|
bool | is_pointer () const noexcept |
| True if this is a managed pointer (not a reference) More...
|
|
bool | is_reference () const noexcept |
| True if this is a reference (not a pointer) More...
|
|
bool | movable () const noexcept |
| True if this is a non-null managed pointer. More...
|
|
T * | get () noexcept |
| Return pointer without nullptr checking. More...
|
|
const T * | get () const noexcept |
| Return const pointer without nullptr checking. More...
|
|
const T & | cref () const |
| Return const reference to the object or to the contents of a (non-null) managed pointer. More...
|
|
T & | ref () const |
| Return non-const reference to the contents of a non-null managed pointer. More...
|
|
T & | constCast () const |
| Return non-const reference to the object or to the contents of a (non-null) managed pointer, with an additional const_cast. More...
|
|
refPtr< T > | shallowClone () const noexcept |
| Return a shallow copy as a wrapped reference, preserving the const/non-const status. More...
|
|
T * | release () noexcept |
| Release ownership and return the pointer. A no-op for reference objects (returns nullptr). More...
|
|
T * | ptr () const |
| Return managed pointer for reuse, or clone() the object reference. More...
|
|
void | clear () const noexcept |
| If object pointer points to valid object: delete object and set pointer to nullptr. More...
|
|
void | reset (T *p=nullptr) noexcept |
| Delete managed pointer and set to new given pointer. More...
|
|
void | reset (refPtr< T > &&other) noexcept |
| Clear existing and transfer ownership. More...
|
|
void | reset (const autoPtr< T > &)=delete |
| No reset from autoPtr reference (potentially confusing) More...
|
|
void | reset (autoPtr< T > &&other) noexcept |
| Clear existing and transfer ownership from autoPtr. More...
|
|
void | reset (std::unique_ptr< T > &&other) |
| Clear existing and transfer ownership from unique_ptr. More...
|
|
void | reset (tmp< T > &rhs, bool reuse) |
| Reference tmp contents or transfer pointer ownership if possible. More...
|
|
void | cref (const refPtr< T > &other) noexcept |
| Clear existing and set (const) reference from other. More...
|
|
void | cref (const T &obj) noexcept |
| Clear existing and set (const) reference. More...
|
|
void | cref (const T *p) noexcept |
| Clear existing and set (const) reference to pointer content. More...
|
|
void | cref (const autoPtr< T > &)=delete |
| Avoid inadvertent casting (to object or pointer) More...
|
|
void | cref (const tmp< T > &)=delete |
| Avoid inadvertent casting (to object) More...
|
|
void | ref (T &obj) noexcept |
| Clear existing and set (non-const) reference. More...
|
|
void | ref (T *p) noexcept |
| Clear existing and set (non-const) reference to pointer content. More...
|
|
void | ref (const autoPtr< T > &)=delete |
| Avoid inadvertent casting (to object or pointer) More...
|
|
void | ref (const tmp< T > &)=delete |
| Avoid inadvertent casting (object) More...
|
|
void | swap (refPtr< T > &other) noexcept |
| Swaps the managed object with other. More...
|
|
const T & | operator* () const |
| Return const reference to the object. More...
|
|
T & | operator* () |
| Return reference to the managed object. More...
|
|
const T * | operator-> () const |
| Dereferences (const) pointer to the managed object. More...
|
|
T * | operator-> () |
| Dereferences (non-const) pointer to the managed object. More...
|
|
const T & | operator() () const |
| Return const reference to the object - same as cref() method. More...
|
|
| operator bool () const noexcept |
| True if pointer/reference is non-null. Same as good() More...
|
|
| operator const T & () const |
| Cast to underlying data type, using the cref() method. More...
|
|
void | operator= (const refPtr< T > &other) |
| Transfer ownership of managed pointer. More...
|
|
void | operator= (refPtr< T > &&other) noexcept |
| Clear existing and transfer ownership. More...
|
|
void | operator= (T *p)=delete |
| No copy assignment from plain pointer (uncontrolled access) More...
|
|
void | operator= (std::nullptr_t) noexcept |
| Reset via assignment from literal nullptr. More...
|
|
void | operator= (const autoPtr< T > &)=delete |
| No copy assignment from autoPtr (can have unintended behaviour) More...
|
|
void | operator= (autoPtr< T > &&other) noexcept |
| Transfer ownership by move assignment from autoPtr. More...
|
|
void | operator= (std::unique_ptr< T > &&other) |
| Transfer ownership by move assignment from unique_ptr. More...
|
|
void | operator= (const tmp< T > &)=delete |
| No copy assignment from tmp. More...
|
|
void | operator= (tmp< T > &&other) |
| Move construct, transferring pointer ownership if possible. More...
|
|
| operator tmp< T > () |
| Conversion to tmp, releases pointer or shallow-copies reference. More...
|
|
bool | valid () const noexcept |
| Identical to good(), or bool operator. More...
|
|
bool | empty () const noexcept |
| Deprecated(2020-07) True if a null managed pointer. More...
|
|
template<class T>
class Foam::refPtr< T >
A class for managing references or pointers (no reference counting)
- Source files
-
- See also
- Foam::autoPtr Foam::tmp
Definition at line 49 of file HashPtrTable.H.