Smart pointer that can point to any type, and optionally takes ownership of the object pointer.
More...
#include <AnyPtr.hpp>
|
| AnyPtr () |
| Construct empty null pointer.
|
|
template<typename ValueType > |
| AnyPtr (ValueType *value) |
| constructor - ownership of pointer is taken More...
|
|
template<typename ValueType > |
| AnyPtr (const rw::core::Ptr< ValueType > &value) |
| Construct from Ptr - shares ownership. More...
|
|
| AnyPtr (const AnyPtr &other) |
| Copy constructor - ownership is shared. More...
|
|
| ~AnyPtr () |
| Destructor.
|
|
template<class S > |
Ptr< S > | cast () const |
| Cast to a specific smart pointer type. More...
|
|
template<class S > |
S * | get () const |
| The pointer stored in the object. More...
|
|
| operator void * () const |
| Support for implicit conversion to bool.
|
|
template<class A > |
bool | operator== (const Ptr< A > &p) const |
| Equality operator. This only tests if the pointers to the referenced objects are the same and NOT if the smart pointers are the same. More...
|
|
bool | operator== (const AnyPtr &p) const |
| Equality operator. This only tests if the pointers to the referenced objects are the same and NOT if the smart pointers are the same. More...
|
|
bool | operator== (void *p) const |
| Tests if the smart pointer points to the same instance as p. More...
|
|
AnyPtr & | operator= (const AnyPtr &rhs) |
| copy assignemt More...
|
|
bool | isNull () const |
| Check if pointer is null. More...
|
|
const std::type_info & | type () const |
| Get type info for the object pointed to. More...
|
|
|
template<typename ValueType > |
ValueType * | cast (AnyPtr *) |
|
Smart pointer that can point to any type, and optionally takes ownership of the object pointer.
◆ AnyPtr() [1/3]
constructor - ownership of pointer is taken
- Parameters
-
◆ AnyPtr() [2/3]
Construct from Ptr - shares ownership.
- Parameters
-
value | [in] a smart pointer. |
◆ AnyPtr() [3/3]
Copy constructor - ownership is shared.
- Parameters
-
other | [in] other AnyPtr object. |
◆ cast()
Cast to a specific smart pointer type.
- Returns
- a Ptr object pointing to object if cast success, otherwise a NULL Ptr object is returned.
◆ get()
The pointer stored in the object.
- Returns
- raw pointer.
◆ isNull()
Check if pointer is null.
- Returns
- true is the smart pointer is null.
◆ operator=()
copy assignemt
- Parameters
-
◆ operator==() [1/3]
bool operator== |
( |
const AnyPtr & |
p | ) |
const |
|
inline |
Equality operator. This only tests if the pointers to the referenced objects are the same and NOT if the smart pointers are the same.
- Parameters
-
p | [in] any pointer to compare with |
- Returns
- true if the referenced objects are the same
◆ operator==() [2/3]
bool operator== |
( |
const Ptr< A > & |
p | ) |
const |
|
inline |
Equality operator. This only tests if the pointers to the referenced objects are the same and NOT if the smart pointers are the same.
- Parameters
-
p | [in] smart pointer to compare with |
- Returns
- true if the referenced objects are the same
◆ operator==() [3/3]
bool operator== |
( |
void * |
p | ) |
const |
|
inline |
Tests if the smart pointer points to the same instance as p.
- Returns
- true if equal, false otherwise.
◆ type()
const std::type_info& type |
( |
| ) |
const |
|
inline |
Get type info for the object pointed to.
- Returns
- type_info object.
The documentation for this class was generated from the following file: