Open
Graph Drawing
Framework

 v.2007.11
 

ogdf::Stack< E > Class Template Reference

The parameterized class Stack<E> implements list-based stacks. More...

#include <Stack.h>

Inheritance diagram for ogdf::Stack< E >:

ogdf::SList< E >

List of all members.

Public Member Functions

 Stack ()
 Constructs an empty stack.
 Stack (const Stack< E > &S)
 Constructs a stack that is a copy of S.
 ~Stack ()
bool empty () const
 Returns true iff the stack is empty.
int size () const
 Returns the number of elements contained in the stack.
const E & top () const
 Returns a reference to the top element.
E & top ()
 Returns a reference to the top element.
Stack< E > & operator= (const Stack< E > &S)
 Assignment operator.
SListIterator< E > push (const E &x)
 Adds element x as top-most element to the stack.
pop ()
 Removes the top-most element from the stack and returns it.
void clear ()
 Makes the stack empty.
const SList< E > & getList () const
void * operator new (size_t nBytes)
void * operator new (size_t, void *p)
void operator delete (void *p, size_t nBytes)


Detailed Description

template<class E>
class ogdf::Stack< E >

The parameterized class Stack<E> implements list-based stacks.

In contrast to StackPure<E>, instances of Stack<E> store the number of elements contained in the stack.

Definition at line 127 of file Stack.h.


Constructor & Destructor Documentation

template<class E>
ogdf::Stack< E >::Stack (  )  [inline]

Constructs an empty stack.

Definition at line 130 of file Stack.h.

template<class E>
ogdf::Stack< E >::Stack ( const Stack< E > &  S  )  [inline]

Constructs a stack that is a copy of S.

Definition at line 133 of file Stack.h.

template<class E>
ogdf::Stack< E >::~Stack (  )  [inline]

Definition at line 136 of file Stack.h.


Member Function Documentation

template<class E>
bool ogdf::Stack< E >::empty (  )  const [inline]

Returns true iff the stack is empty.

Reimplemented from ogdf::SList< E >.

Definition at line 139 of file Stack.h.

template<class E>
int ogdf::Stack< E >::size (  )  const [inline]

Returns the number of elements contained in the stack.

Reimplemented from ogdf::SList< E >.

Definition at line 142 of file Stack.h.

template<class E>
const E& ogdf::Stack< E >::top (  )  const [inline]

Returns a reference to the top element.

Definition at line 145 of file Stack.h.

template<class E>
E& ogdf::Stack< E >::top (  )  [inline]

Returns a reference to the top element.

Definition at line 150 of file Stack.h.

template<class E>
Stack<E>& ogdf::Stack< E >::operator= ( const Stack< E > &  S  )  [inline]

Assignment operator.

Definition at line 155 of file Stack.h.

template<class E>
SListIterator<E> ogdf::Stack< E >::push ( const E &  x  )  [inline]

Adds element x as top-most element to the stack.

Definition at line 161 of file Stack.h.

template<class E>
E ogdf::Stack< E >::pop (  )  [inline]

Removes the top-most element from the stack and returns it.

Definition at line 166 of file Stack.h.

template<class E>
void ogdf::Stack< E >::clear (  )  [inline]

Makes the stack empty.

Reimplemented from ogdf::SList< E >.

Definition at line 173 of file Stack.h.

template<class E>
const SList<E>& ogdf::Stack< E >::getList (  )  const [inline]

Definition at line 175 of file Stack.h.

template<class E>
void* ogdf::Stack< E >::operator new ( size_t  nBytes  )  [inline]

Reimplemented from ogdf::SList< E >.

Definition at line 177 of file Stack.h.

template<class E>
void* ogdf::Stack< E >::operator new ( size_t  ,
void *  p 
) [inline]

Reimplemented from ogdf::SList< E >.

Definition at line 177 of file Stack.h.

template<class E>
void ogdf::Stack< E >::operator delete ( void *  p,
size_t  nBytes 
) [inline]

Reimplemented from ogdf::SList< E >.

Definition at line 177 of file Stack.h.


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

© 1999-2007 by oreas GmbH, © 2005-2007 by University Dortmund and University Cologne.

Generated on Thu Nov 22 19:40:09 2007 by doxygen 1.5.4.