UCommon
|
Manage temporary object stored on the heap. More...
#include <temporary.h>
Public Member Functions | |
operator bool () const | |
operator T& () const | |
bool | operator! () const |
T * | operator() (size_t index) const |
void | operator() (size_t index, const T value) |
T & | operator* () const |
Access heap object through our temporary directly. | |
T * | operator-> () const |
Access members of our heap object through our temporary. | |
temporary & | operator= (const T initial) |
T & | operator[] (size_t index) const |
size_t | read (FILE *fp) |
void | release () |
size_t | seek (FILE *fp, long pos) |
temporary (const T initial) | |
temporary (size_t size, const T initial) | |
temporary (size_t size=1) | |
Construct a temporary object, create our stack frame reference. | |
T & | value (size_t index) const |
void | value (size_t index, const T value) |
size_t | write (FILE *fp) |
Protected Attributes | |
T * | array |
size_t | used |
Manage temporary object stored on the heap.
This is used to create a object on the heap who's scope is controlled by the scope of a member function call. Sometimes we have data types and structures which cannot themselves appear as auto variables. We may also have a limited stack frame size in a thread context, and yet have a dynamic object that we only want to exist during the life of the method call. Using temporary allows any type to be created from the heap but have a lifespan of a method's stack frame.
Definition at line 80 of file temporary.h.
|
inline |
Construct a temporary object, create our stack frame reference.
Definition at line 93 of file temporary.h.
|
inline |
Definition at line 98 of file temporary.h.
|
inlineexplicit |
Definition at line 105 of file temporary.h.
|
inline |
Definition at line 111 of file temporary.h.
|
inline |
Definition at line 138 of file temporary.h.
|
inline |
Definition at line 118 of file temporary.h.
|
inline |
Definition at line 142 of file temporary.h.
|
inline |
Definition at line 163 of file temporary.h.
|
inline |
Definition at line 168 of file temporary.h.
|
inline |
Access heap object through our temporary directly.
Definition at line 126 of file temporary.h.
|
inline |
Access members of our heap object through our temporary.
Definition at line 134 of file temporary.h.
|
inline |
Definition at line 146 of file temporary.h.
|
inline |
Definition at line 158 of file temporary.h.
|
inline |
Definition at line 183 of file temporary.h.
|
inline |
Definition at line 151 of file temporary.h.
|
inline |
Definition at line 193 of file temporary.h.
|
inline |
Definition at line 173 of file temporary.h.
|
inline |
Definition at line 178 of file temporary.h.
|
inline |
Definition at line 188 of file temporary.h.
|
protected |
Definition at line 86 of file temporary.h.
|
protected |
Definition at line 87 of file temporary.h.