Open
Graph Drawing
Framework

 v.2010.10
 

Public Member Functions | Private Attributes

ogdf::Stack< E > Class Template Reference

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

#include <ogdf/basic/Stack.h>

Inheritance diagram for ogdf::Stack< E >:
ogdf::StackPure< E >

List of all members.

Public Member Functions

 Stack ()
 The number of elements in the list.
 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.
void 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.
void print (ostream &os, char delim= ' ') const
void * operator new (size_t nBytes)
void * operator new (size_t, void *p)
void operator delete (void *p, size_t nBytes)

Private Attributes

int m_count

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 312 of file Stack.h.


Constructor & Destructor Documentation

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

The number of elements in the list.

Constructs an empty stack.

Definition at line 318 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 321 of file Stack.h.

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

Definition at line 324 of file Stack.h.


Member Function Documentation

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

Makes the stack empty.

Reimplemented from ogdf::StackPure< E >.

Definition at line 362 of file Stack.h.

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

Returns true iff the stack is empty.

Reimplemented from ogdf::StackPure< E >.

Definition at line 327 of file Stack.h.

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

Reimplemented from ogdf::StackPure< E >.

Definition at line 371 of file Stack.h.

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

Reimplemented from ogdf::StackPure< E >.

Definition at line 371 of file Stack.h.

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

Reimplemented from ogdf::StackPure< E >.

Definition at line 371 of file Stack.h.

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

Assignment operator.

Definition at line 343 of file Stack.h.

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

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

Reimplemented from ogdf::StackPure< E >.

Definition at line 356 of file Stack.h.

template<class E>
void ogdf::Stack< E >::print ( ostream &  os,
char  delim = ' ' 
) const [inline]

Reimplemented from ogdf::StackPure< E >.

Definition at line 367 of file Stack.h.

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

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

Reimplemented from ogdf::StackPure< E >.

Definition at line 350 of file Stack.h.

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

Returns the number of elements contained in the stack.

Definition at line 330 of file Stack.h.

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

Returns a reference to the top element.

Reimplemented from ogdf::StackPure< E >.

Definition at line 333 of file Stack.h.

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

Returns a reference to the top element.

Reimplemented from ogdf::StackPure< E >.

Definition at line 338 of file Stack.h.


Member Data Documentation

template<class E>
int ogdf::Stack< E >::m_count [private]

Definition at line 314 of file Stack.h.


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