#include <SgStack.h>
Stack does not assume ownership. Memory management of objects on stack is the user's responsibility.
Definition at line 18 of file SgStack.h.
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 |
| T | 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 | |
| SgStack & | operator= (const SgStack &) |
| not implemented | |
Private Attributes | |
| int | m_sp |
| T | m_stack [SIZE] |
not implemented
| void SgStack< T, SIZE >::Clear | ( | ) |
| void SgStack< T, SIZE >::CopyFrom | ( | const SgStack< T, SIZE > & | other | ) |
Make this stack a copy of other.
Definition at line 76 of file SgStack.h.
References SgStack< T, SIZE >::m_sp, SgStack< T, SIZE >::m_stack, and SgStack< T, SIZE >::Size().
Referenced by SgSearch::TryMove().
| bool SgStack< T, SIZE >::IsEmpty | ( | ) | const |
| bool SgStack< T, SIZE >::NonEmpty | ( | ) | const |
| SgStack& SgStack< T, SIZE >::operator= | ( | const SgStack< T, SIZE > & | ) | [private] |
not implemented
| const T & SgStack< T, SIZE >::operator[] | ( | int | index | ) | const |
Definition at line 145 of file SgStack.h.
References SgStack< T, SIZE >::m_sp, SgStack< T, SIZE >::m_stack, and SG_ASSERT.
| T SgStack< T, SIZE >::Pop | ( | ) |
remove and return top element.
Must be NonEmpty.
Definition at line 96 of file SgStack.h.
References SgStack< T, SIZE >::m_sp, SgStack< T, SIZE >::m_stack, and SG_ASSERT.
| void SgStack< T, SIZE >::Push | ( | T | data | ) |
Definition at line 103 of file SgStack.h.
References SgStack< T, SIZE >::m_sp, SgStack< T, SIZE >::m_stack, and SG_ASSERT.
Referenced by SgStack< T, SIZE >::PushAll(), and SgSearch::TryMove().
| void SgStack< T, SIZE >::PushAll | ( | const SgStack< T, SIZE > & | other | ) |
Push all elements from other stack onto this stack.
Definition at line 110 of file SgStack.h.
References SgStack< T, SIZE >::m_stack, SgStack< T, SIZE >::Push(), and SgStack< T, SIZE >::Size().
Referenced by SgProbCut::ProbCut().
| int SgStack< T, SIZE >::Size | ( | ) | const |
Number of elements on stack.
Definition at line 117 of file SgStack.h.
References SgStack< T, SIZE >::m_sp.
Referenced by SgStack< T, SIZE >::CopyFrom(), SgStack< T, SIZE >::PushAll(), and ReverseCopyStack().
| const T & SgStack< T, SIZE >::Top | ( | ) | const |
Definition at line 138 of file SgStack.h.
References SgStack< T, SIZE >::m_sp, SgStack< T, SIZE >::m_stack, and SG_ASSERT.
Definition at line 56 of file SgStack.h.
Referenced by SgStack< T, SIZE >::Clear(), SgStack< T, SIZE >::CopyFrom(), SgStack< T, SIZE >::IsEmpty(), SgStack< T, SIZE >::NonEmpty(), SgStack< T, SIZE >::operator[](), SgStack< T, SIZE >::Pop(), SgStack< T, SIZE >::Push(), SgStack< T, SIZE >::Size(), and SgStack< T, SIZE >::Top().
Definition at line 58 of file SgStack.h.
Referenced by SgStack< T, SIZE >::CopyFrom(), SgStack< T, SIZE >::operator[](), SgStack< T, SIZE >::Pop(), SgStack< T, SIZE >::Push(), SgStack< T, SIZE >::PushAll(), and SgStack< T, SIZE >::Top().