|
TowerOfHanoi
|
Rod is a class to maintains state about disk positions. More...
#include <hanoi.h>

Public Member Functions | |
| Rod (std::string name, int capacity) | |
| Initializes a Rod with a name and a capacity. More... | |
| void | push (int diskValue) |
| int | pop () |
| If the stack is not empty we will pop off the top disk. More... | |
| bool | isAtCapacity () |
| Checks if we have met the capacity limit. More... | |
| bool | isEmpty () |
Friends | |
| class | Hanoi |
Rod is a class to maintains state about disk positions.
This class essentially is a wrapper around stack, to enforce a capacity. and enforce inputs. Its use is to maintain state when we are moving disks.
| Rod::Rod | ( | std::string | name, |
| int | capacity | ||
| ) |
Initializes a Rod with a name and a capacity.
| [in] | name | - the name of the rod. |
| [in] | capacity | - the maximum amount of disks allowed on this rod. |
| bool Rod::isAtCapacity | ( | ) |
Checks if we have met the capacity limit.
| bool Rod::isEmpty | ( | ) |
| int Rod::pop | ( | ) |
If the stack is not empty we will pop off the top disk.
This function will assert if the stack is empty.
| void Rod::push | ( | int | diskValue | ) |
|
friend |