|
Orxonox
0.0.5 Codename: Arcturus
|
A strong pointer which wraps a pointer to an object and keeps this object alive as long as the strong pointer exists. More...
#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/core/CorePrereqs.h>
Public Member Functions | |
| StrongPtr () | |
| Constructor: Initializes the strong pointer with a null pointer. More... | |
| StrongPtr (T *pointer) | |
| Constructor: Initializes the strong pointer with a pointer to an object. More... | |
| StrongPtr (const StrongPtr &other) | |
| Copy-constructor. More... | |
| template<class O > | |
| StrongPtr (const StrongPtr< O > &other) | |
| Copy-constructor for strong pointers to objects of another class. More... | |
| template<class O > | |
| StrongPtr (const WeakPtr< O > &other) | |
| Constructor: Initializes the strong pointer with the pointer that is stored in a WeakPtr. More... | |
| StrongPtr (StrongPtr &&other) | |
| Move-constructor. More... | |
| ~StrongPtr () | |
| Destructor: Decrements the reference counter. More... | |
| T * | get () const |
Returns the wrapped pointer as T*. More... | |
| Destroyable * | getBase () const |
Returns the wrapped pointer as Destroyable*. More... | |
| operator bool () const | |
| Returns true if the pointer is not nullptr. More... | |
| operator T * () const | |
Implicitly converts the StrongPtr to a pointer of type T*. More... | |
| T & | operator* () const |
| Overloaded operator, returns a reference to the stored object. More... | |
| T * | operator-> () const |
| Overloaded operator, returns a pointer to the stored object. More... | |
| StrongPtr & | operator= (T *pointer) |
| Assigns a new pointer. More... | |
| StrongPtr & | operator= (StrongPtr other) |
| Assigns the wrapped pointer of another StrongPtr. More... | |
| template<class O > | |
| StrongPtr & | operator= (const StrongPtr< O > &other) |
| Assigns the wrapped pointer of a StrongPtr of another class. More... | |
| template<class O > | |
| StrongPtr & | operator= (const WeakPtr< O > &other) |
| Assigns the wrapped pointer of a WeakPtr. More... | |
| void | reset () |
| Resets the strong pointer (equivalent to assigning a nullptr). More... | |
| void | swap (StrongPtr &other) |
| Swaps the contents of two strong pointers. More... | |
Private Attributes | |
| Destroyable * | base_ |
| The wrapped pointer, casted up to Destroyable (this is needed because with just a T* pointer, StrongPtr couln't be used with forward declarations) More... | |
| T * | pointer_ |
| The wrapped pointer to an object of type T. More... | |
A strong pointer which wraps a pointer to an object and keeps this object alive as long as the strong pointer exists.
|
inline |
Constructor: Initializes the strong pointer with a null pointer.
|
inline |
Constructor: Initializes the strong pointer with a pointer to an object.
| pointer | The pointer |
|
inline |
Copy-constructor.
|
inline |
Copy-constructor for strong pointers to objects of another class.
|
inline |
Constructor: Initializes the strong pointer with the pointer that is stored in a WeakPtr.
|
inline |
Move-constructor.
|
inline |
Destructor: Decrements the reference counter.
|
inline |
Returns the wrapped pointer as T*.
|
inline |
Returns the wrapped pointer as Destroyable*.
|
inlineexplicit |
Returns true if the pointer is not nullptr.
|
inline |
Implicitly converts the StrongPtr to a pointer of type T*.
|
inline |
Overloaded operator, returns a reference to the stored object.
|
inline |
Overloaded operator, returns a pointer to the stored object.
|
inline |
Assigns a new pointer.
|
inline |
Assigns the wrapped pointer of another StrongPtr.
|
inline |
Assigns the wrapped pointer of a StrongPtr of another class.
|
inline |
Assigns the wrapped pointer of a WeakPtr.
|
inline |
Resets the strong pointer (equivalent to assigning a nullptr).
|
inline |
Swaps the contents of two strong pointers.
|
private |
The wrapped pointer, casted up to Destroyable (this is needed because with just a T* pointer, StrongPtr couln't be used with forward declarations)
|
private |
The wrapped pointer to an object of type T.
1.8.11