Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
Stack< T > Class Template Reference

#include </home/casse/Dev/elm/src/concepts.h>

Public Member Functions

bool isEmpty (void) const
 
const T & top (void) const
 
T & top ()
 
pop (void)
 
void push (const T &item)
 
void reset (void)
 

Detailed Description

template<class T>
class elm::concept::Stack< T >

This concepts represents stack of items (First-In First-Out).

Parameters
TType of stacked items.
Implemented by:

Member Function Documentation

◆ isEmpty()

bool isEmpty ( void  ) const

Test if the stack is empty.

Returns
Return true if the stack is empty, false else.

◆ pop()

T pop ( void  )

Pop the top item of the stack.

Returns
Top item.

◆ push()

void push ( const T &  item)

Push a new item in the stack.

Parameters
itemItem to push in the stack.

◆ reset()

void reset ( void  )

Reset the stack to empty.

◆ top() [1/2]

T& top ( )

Get the item at the top of the stack. The returned reference can be assigned.

Returns
Reference to the top item of the stack.

◆ top() [2/2]

const T& top ( void  ) const

Get the item at the top of the stack.

Returns
Top item of the stack.

The documentation for this class was generated from the following file: