Matrix3Stack Class Reference

Matrix3Stack Class Reference

#include <stack3.h>

Class Description

See also
Class Matrix3.

Description:
A stack of Matrix3's (4x3 matrix). All methods of this class are implemented by the system. No error (bounds) checking is performed.
+ Inheritance diagram for Matrix3Stack:

Public Member Functions

 Matrix3Stack ()
 
 Matrix3Stack (int depth)
 
 ~Matrix3Stack ()
 
BOOL replace (const Matrix3 &m)
 
BOOL push (const Matrix3 &m)
 
BOOL dup (void)
 
BOOL concat (const Matrix3 &m)
 
Matrix3get (void)
 
Matrix3pop (void)
 
BOOL remove (void)
 
BOOL reset (void)
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 

Constructor & Destructor Documentation

Remarks
Constructor. Creates a new 32 element stack of Matrix3s.
Matrix3Stack ( int  depth)
Remarks
Constructor. Creates a new depth element stack of Matrix3s.
Remarks
Destructor. Frees the stack.

Member Function Documentation

BOOL replace ( const Matrix3 m)
inline
Remarks
Replaces the item on the top of the stack with the specified matrix.
Parameters:
const Matrix3 &m

The matrix to replace the matrix at the top of the stack.
Returns
Always TRUE.
30  { stk[index] = m; return TRUE; }
BOOL push ( const Matrix3 m)
inline
Remarks
Pushes the specified matrix onto the stack.
Parameters:
const Matrix3 &m

The matrix to push on the top of the stack.
Returns
TRUE if there is still room on the stack; otherwise FALSE.
37  { stk[index++] = m; return index < maxDepth; }
BOOL dup ( void  )
inline
Remarks
Duplicates the matrix on the top of the stack.
Returns
TRUE if there is still room on the stack after the dup; otherwise FALSE.
42  { stk[index+1] = stk[index]; return ++index < maxDepth; }
BOOL concat ( const Matrix3 m)
inline
Remarks
Concatenates the specified matrix with the matrix on the top of the stack (performs matrix multiplication).
Parameters:
const Matrix3 &m

The matrix to multiply (m * stack[top]).
Returns
Always TRUE.
50  { stk[index] = m * stk[index]; return TRUE; }
Matrix3& get ( void  )
inline
Remarks
Returns the matrix on the top of the stack.
53  { return stk[index]; }
Matrix3& pop ( void  )
inline
Remarks
Pops the matrix from the stack.
Returns
The matrix at the top of the stack.
57  { return stk[index--]; }
BOOL remove ( void  )
inline
Remarks
Removes the matrix at the top of the stack.
Returns
TRUE if the number of items on the stack is >= 0 (after removing the matrix); otherwise 0.
62  { return --index >= 0; }
BOOL reset ( void  )
inline
Remarks
Resets the stack to contain zero items.
Returns
Always TRUE.
66  { index = 0; stk[0].IdentityMatrix(); return TRUE; }
void IdentityMatrix()