12345678910111213141516171819202122232425262728293031323334353637383940 |
- #include "Matrix3DStack.h"
- #include "StackOverflow.h"
- #include "StackUnderflow.h"
- Matrix3DStack::Matrix3DStack()
- {
- }
- Matrix3DStack::Matrix3DStack(const Matrix3DStack& orig)
- {
- }
- Matrix3DStack::~Matrix3DStack()
- {
- }
- void Matrix3DStack::pop()
- {
- if(index <= 0)
- {
- throw StackUnderflow();
- }
- index--;
- }
- void Matrix3DStack::push()
- {
- if(index >= STACK_SIZE - 1)
- {
- throw StackOverflow();
- }
- index++;
- stack[index].set(stack[index - 1]);
- }
- Matrix3D& Matrix3DStack::get()
- {
- return stack[index];
- }
|