#include <CC_IntStack.h>
Inheritance diagram for CC_IntStack:
int
.
This class was automatically generated by an XSLT program. It models a FIFO container with a fixed size. The items in the container are handled as variables of type: int
. This is a type-safe class that does not perform any type casting. The size of the stack must be set by the user during the initialization phase and cannot be changed afterwards. This class offers the two traditional push and pop operations and a reset operation that empties the stack. Attempts to push a full stack or to pop an empty stack result in no action other than the generation of an event report.
Definition at line 36 of file CC_IntStack.h.
Public Member Functions | |
CC_IntStack () | |
Instantiate a new stack container. | |
void | push (int newItem) |
Push an item onto the stack. | |
int | pop () |
Pop an item from the stack. | |
void | setStackSize (unsigned int size) |
Set the size of the stack. | |
unsigned int | getStackSize () const |
Return the size of the stack. | |
unsigned int | getNumberOfItems () const |
Return the number of items currently on the stack. | |
bool | isEmpty () const |
Check whether the stack is emtpy. | |
bool | isFull () const |
Check whether the stack is full. | |
void | reset () |
Reset the stack. | |
virtual bool | isObjectConfigured () |
Perform a class-specific configuration check on a stack object: verify that the stack size has a legal value. |
|
Instantiate a new stack container. The stack is initially empty. Its size is set to an illegal value to signify that the stack is not yet configured. Definition at line 22 of file CC_IntStack.cpp. |
|
Return the number of items currently on the stack.
Definition at line 43 of file CC_IntStack.cpp. |
|
Return the size of the stack.
Definition at line 39 of file CC_IntStack.cpp. |
|
Check whether the stack is emtpy.
Definition at line 77 of file CC_IntStack.cpp. |
|
Check whether the stack is full.
Definition at line 72 of file CC_IntStack.cpp. |
|
Perform a class-specific configuration check on a stack object: verify that the stack size has a legal value.
Reimplemented from CC_RootObject. Definition at line 87 of file CC_IntStack.cpp. |
|
Pop an item from the stack.
If the stack is empty, the value of NULL is returned and event report EVT_STACK_FULL is generated to report the fact. Users should always check that the stack is not empty (using operation
Definition at line 60 of file CC_IntStack.cpp. |
|
Push an item onto the stack.
If the stack is already full, no action is taken but event report EVT_STACK_FULL is generated to report the fact. Users should always check that the stack is not full (using operation
Definition at line 48 of file CC_IntStack.cpp. |
|
Reset the stack. The stack is brought back to the status it had after it was configured but before it was ever used. Definition at line 82 of file CC_IntStack.cpp. |
|
Set the size of the stack. The size of the stack is the maximum number of items that can be held by the stack. A call to this method causes the internal FIFO data structure where the stack items are stored to be created and initialized. This is an initialization method. It should be called before the stack is used for the first time and it should not be called more than once. Attempts to call it more than once will result in memory leaks. It is not legal to set the repository size to 0.
Definition at line 29 of file CC_IntStack.cpp. |