Base Framework
|
Automation pointer for direct values. More...
#include <base/mem/Indirect.h>
Public Member Functions | |
Indirect () noexcept | |
Indirect (const TYPE &_value) | |
Indirect (const Indirect ©) | |
template<class POLY > | |
Indirect< POLY > | cast () |
Indirect & | operator= (const Indirect &assign) |
template<class POLY > | |
Indirect & | operator= (const Indirect< POLY > &assign) noexcept |
bool | isValid () const noexcept |
bool | operator== (const Indirect &compare) const noexcept |
bool | operator!= (const Indirect &compare) const noexcept |
template<class POLY > | |
bool | isType () const noexcept |
const TYPE & | getValue () const |
template<class POLY > | |
POLY | getValue () const |
TYPE * | operator-> () |
const TYPE * | operator-> () const |
operator bool () const noexcept | |
unsigned long | getHash () const noexcept |
~Indirect () | |
Automation pointer for direct values.
Automation pointer which provides polymorphic behavior for non-polymorphic objects (direct objects). This is accomplished by copying the object to the heap using the default copy constructor and referencing the object through a pointer. This automation pointer is intended for objects such as Socket which use internal reference counting and thus normally are accessed through their value and not through some pointer. The Indirect automation pointer is relocateable. Accessing the object through this automation object results in an overhead because an additional pointer must be dereferenced. However, the overhead can be avoided by doing a dynamic cast and then copying the "new" object onto the stack. This automation pointer only makes sense if the type in question is itself some pointer.
Initializes an automation pointer as invalid (i.e. nullptr).
Initializes reference with the specified pointer value. The automation pointer may be implicitly initialized.
value | The desired pointer value. |
Initialization of automation pointer by automation pointer.
Dynamic cast to the specified type.
|
inlinenoexcept |
Returns the hash value of the pointer.
|
inline |
Returns the value.
Casts the object to the specified object type. Raises CastException if the cast failed.
Returns true if the object may be cast to the specified type.
|
inlinenoexcept |
Returns true if the automation pointer is valid (i.e. it is pointing to an object).
|
inlinenoexcept |
Returns true if the automation pointer is valid.
|
inlinenoexcept |
Returns true if the references are non-equal.
|
inline |
Dereferences the automation pointer.
|
inline |
Dereferences the automation pointer.
|
inline |
Initialization of automation pointer from other automation pointer using compile time polymorphism. Assignment of automation pointer by automation pointer.
|
inlinenoexcept |
Assignment of automation pointer by automation pointer using compile time polymorphism.