Torque2D Reference
|
#include <frameAllocator.h>
Public Member Functions | |
FrameTemp (const U32 count=1) | |
~FrameTemp () | |
Destructor restores the watermark. More... | |
U32 | getObjectCount (void) const |
T * | operator~ () |
NOTE: This will return the memory, NOT perform a ones-complement. More... | |
const T * | operator~ () const |
NOTE: This will return the memory, NOT perform a ones-complement. More... | |
T & | operator+ () |
NOTE: This will dereference the memory, NOT do standard unary plus behavior. More... | |
const T & | operator+ () const |
NOTE: This will dereference the memory, NOT do standard unary plus behavior. More... | |
T & | operator* () |
const T & | operator* () const |
T ** | operator& () |
const T ** | operator& () const |
operator T * () | |
operator const T * () const | |
operator T & () | |
operator const T & () const | |
operator T () | |
operator const T () const | |
T & | operator[] (const U32 idx) |
const T & | operator[] (const U32 idx) const |
T & | operator[] (const S32 idx) |
const T & | operator[] (const S32 idx) const |
Protected Attributes | |
U32 | mWaterMark |
T * | mMemory |
U32 | mNumObjectsInMemory |
Class for temporary variables that you want to allocate easily using the FrameAllocator. For example:
This will automatically handle getting and restoring the watermark of the FrameAllocator when it goes out of scope. You should notice the strange operator infront of tempStr on the printf call. This is normally a unary operator for ones-complement, but in this class it will simply return the memory of the allocation. It's the same as doing (const char *)tempStr in the above case. The reason why it is necessary for the second printf and not the first is because the second one is taking a variable arg list and so it isn't getting the cast so that it's cast operator can properly return the memory instead of the FrameTemp object itself.
|
inline |
Constructor will store the FrameAllocator watermark and allocate the memory off of the FrameAllocator.
count | The number of objects to allocate |
|
inline |
Destructor restores the watermark.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
NOTE: This will dereference the memory, NOT do standard unary plus behavior.
|
inline |
NOTE: This will dereference the memory, NOT do standard unary plus behavior.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
NOTE: This will return the memory, NOT perform a ones-complement.
|
inline |
NOTE: This will return the memory, NOT perform a ones-complement.
|
protected |
|
protected |
|
protected |