Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  
Public Member Functions | Private Member Functions | Private Attributes

SgStack< T, SIZE > Class Template Reference

Stack with up to size objects of class T. More...

#include <SgStack.h>

List of all members.

Public Member Functions

 SgStack ()
 ~SgStack ()
void Clear ()
 Empty the stack.
void CopyFrom (const SgStack< T, SIZE > &other)
 Make this stack a copy of other.
bool IsEmpty () const
bool NonEmpty () const
Pop ()
 remove and return top element.
void Push (T data)
void PushAll (const SgStack< T, SIZE > &other)
 Push all elements from other stack onto this stack.
int Size () const
 Number of elements on stack.
void SwapWith (SgStack< T, SIZE > &other)
 Exchange contents of this and other stack.
const T & Top () const
const T & operator[] (int index) const

Private Member Functions

 SgStack (const SgStack &)
 not implemented
SgStackoperator= (const SgStack &)
 not implemented

Private Attributes

int m_sp
m_stack [SIZE]

Detailed Description

template<class T, int SIZE>
class SgStack< T, SIZE >

Stack with up to size objects of class T.

Stack does not assume ownership. Memory management of objects on stack is the user's responsibility.

Definition at line 16 of file SgStack.h.


Constructor & Destructor Documentation

template<class T, int SIZE>
SgStack< T, SIZE >::SgStack (  ) 

Definition at line 19 of file SgStack.h.

template<class T, int SIZE>
SgStack< T, SIZE >::~SgStack (  ) 

Definition at line 23 of file SgStack.h.

template<class T, int SIZE>
SgStack< T, SIZE >::SgStack ( const SgStack< T, SIZE > &   )  [private]

not implemented


Member Function Documentation

template<typename T , int SIZE>
void SgStack< T, SIZE >::Clear (  ) 

Empty the stack.

Definition at line 68 of file SgStack.h.

References SgStack< T, SIZE >::m_sp.

Referenced by SgSearch::SearchEngine().

template<typename T , int SIZE>
void SgStack< T, SIZE >::CopyFrom ( const SgStack< T, SIZE > &  other  ) 

Make this stack a copy of other.

Definition at line 74 of file SgStack.h.

References SgStack< T, SIZE >::m_sp, SgStack< T, SIZE >::m_stack, and SgStack< T, SIZE >::Size().

Referenced by SgSearch::TryMove().

template<typename T , int SIZE>
bool SgStack< T, SIZE >::IsEmpty (  )  const

Definition at line 82 of file SgStack.h.

References SgStack< T, SIZE >::m_sp.

Referenced by SgSearch::SearchEngine().

template<typename T , int SIZE>
bool SgStack< T, SIZE >::NonEmpty (  )  const

Definition at line 88 of file SgStack.h.

References SgStack< T, SIZE >::m_sp.

Referenced by SgSearch::SearchEngine().

template<class T, int SIZE>
SgStack& SgStack< T, SIZE >::operator= ( const SgStack< T, SIZE > &   )  [private]

not implemented

template<typename T , int SIZE>
const T & SgStack< T, SIZE >::operator[] ( int  index  )  const

Definition at line 143 of file SgStack.h.

References SgStack< T, SIZE >::m_sp, SgStack< T, SIZE >::m_stack, and SG_ASSERT.

template<typename T , int SIZE>
T SgStack< T, SIZE >::Pop (  ) 

remove and return top element.

Must be NonEmpty.

Definition at line 94 of file SgStack.h.

References SgStack< T, SIZE >::m_sp, SgStack< T, SIZE >::m_stack, and SG_ASSERT.

template<typename T , int SIZE>
void SgStack< T, SIZE >::Push ( data  ) 
template<typename T , int SIZE>
void SgStack< T, SIZE >::PushAll ( const SgStack< T, SIZE > &  other  ) 

Push all elements from other stack onto this stack.

Definition at line 108 of file SgStack.h.

References SgStack< T, SIZE >::m_stack, SgStack< T, SIZE >::Push(), and SgStack< T, SIZE >::Size().

Referenced by SgProbCut::ProbCut().

template<typename T , int SIZE>
int SgStack< T, SIZE >::Size (  )  const

Number of elements on stack.

Definition at line 115 of file SgStack.h.

References SgStack< T, SIZE >::m_sp.

Referenced by SgStack< T, SIZE >::CopyFrom(), SgStack< T, SIZE >::PushAll(), and SgStack< T, SIZE >::SwapWith().

template<typename T , int SIZE>
void SgStack< T, SIZE >::SwapWith ( SgStack< T, SIZE > &  other  ) 

Exchange contents of this and other stack.

Definition at line 121 of file SgStack.h.

References SgStack< T, SIZE >::m_sp, SgStack< T, SIZE >::m_stack, and SgStack< T, SIZE >::Size().

Referenced by SgProbCut::ProbCut().

template<typename T , int SIZE>
const T & SgStack< T, SIZE >::Top (  )  const

Definition at line 136 of file SgStack.h.

References SgStack< T, SIZE >::m_sp, SgStack< T, SIZE >::m_stack, and SG_ASSERT.

Referenced by SgSearch::SearchEngine().


Member Data Documentation

template<class T, int SIZE>
int SgStack< T, SIZE >::m_sp [private]
template<class T, int SIZE>
T SgStack< T, SIZE >::m_stack[SIZE] [private]

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


Sun Mar 13 2011 Doxygen 1.7.1