Stack template (FILO -> First In Last Out)
More...
#include <Stack.h>
List of all members.
Public Member Functions |
| Stack () |
| Constructor.
|
| Stack (const Stack< ValueType > &cSource) |
| Copy constructor.
|
| ~Stack () |
| Destructor.
|
bool | Push (const ValueType &Element) |
| Push an element onto the stack (enqueue)
|
bool | Pop (ValueType *pElement=nullptr) |
| Pops the top element from the stack (dequeue)
|
ValueType | Top () const |
| Returns the top element without removing it.
|
uint32 | GetNumOfElements () const |
| Returns the number of elements on the stack.
|
Stack< ValueType > & | operator= (const Stack< ValueType > &cSource) |
| Copies the data from another stack.
|
void | Clear () |
| Clears the whole stack.
|
Detailed Description
template<class ValueType>
class PLCore::Stack< ValueType >
Stack template (FILO -> First In Last Out)
Constructor & Destructor Documentation
template<class ValueType >
template<class ValueType>
Copy constructor.
- Parameters:
-
[in] | cSource | Source stack to copy from |
template<class ValueType >
Member Function Documentation
template<class ValueType>
Push an element onto the stack (enqueue)
Push an element onto the stack.
- Parameters:
-
- Returns:
- 'true' if all went fine, else 'false'
template<class ValueType>
Pops the top element from the stack (dequeue)
Pops the top element from the stack.
- Parameters:
-
[out] | pElement | If not a null pointer, this will receive the popped element |
- Returns:
- 'true' if all went fine, else 'false'
- Note:
- On error, pElement is NOT touched, so ensure that you take this case into account!
template<class ValueType >
Returns the top element without removing it.
Get the top element without removing it.
- Returns:
- Top stack element
template<class ValueType >
Returns the number of elements on the stack.
Returns the number of element on the stack.
- Returns:
- Number of stack elements
template<class ValueType>
Copies the data from another stack.
- Parameters:
-
[in] | cSource | Stack to copy from |
- Returns:
- Reference to this instance
template<class ValueType >
The documentation for this class was generated from the following files: