|
inkcpp
|
Pointer wrapper to an object whose lifetime is tied to a story object. More...
#include <story_ptr.h>
Public Member Functions | |
| story_ptr (T *ptr) | |
| pointer constructor. | |
| story_ptr (const story_ptr< T > &oth) | |
| copy constructor | |
| story_ptr< T > & | operator= (const story_ptr< T > &oth) |
| copy assigment operator | |
| template<typename U> | |
| story_ptr< U > | cast () |
| pointer cast while keeping ref count | |
| bool | operator== (const story_ptr< T > &other) |
| implement operator== | |
| bool | is_valid () const |
| checks if optional contains a value | |
| operator bool () const | |
| auto cast to bool with value from is_valid() | |
| T * | get () |
| access value as ptr | |
| const T * | get () const |
| access value as ptr | |
| T * | operator-> () |
| implement operator-> | |
| const T * | operator-> () const |
| implement operator-> | |
| T & | operator* () |
| implement operator* | |
| const T & | operator* () const |
| implement operator* | |
Pointer wrapper to an object whose lifetime is tied to a story object.
A shared pointer whose lifetime is also tied to the lifetime of the parent story object. The referenced object will live until either 1) There are no more story_ptr's pointing to this object 2) The story object which owns this object dies
|
inline |
pointer constructor.
for nullptr only.
| ptr | will be ignored, should be nullptr |
| ink::runtime::story_ptr< T >::story_ptr | ( | const story_ptr< T > & | oth | ) |
copy constructor
| oth |
|
inline |
pointer cast while keeping ref count
| U | new pointer type, valid cast form T to U must be available |
|
inline |
access value as ptr
| nullptr | if value is not valid |
|
inline |
access value as ptr
| nullptr | if value is not valid |
| story_ptr< T > & ink::runtime::story_ptr< T >::operator= | ( | const story_ptr< T > & | oth | ) |
copy assigment operator
| oth |