26 #ifndef ICL_CORE_T_SEARCHABLE_STACK_H_INCLUDED 27 #define ICL_CORE_T_SEARCHABLE_STACK_H_INCLUDED 42 template <
typename T,
typename Compare = std::equal_to<T>,
typename Alloc = std::allocator<T> >
53 typedef typename std::vector<T>::size_type
size_type;
59 void clear() { std::vector<T, Alloc>::clear(); }
61 bool empty()
const {
return std::vector<T, Alloc>::empty(); }
63 size_type
size()
const {
return std::vector<T, Alloc>::size(); }
68 void pop() { std::vector<T, Alloc>::pop_back(); }
75 const_iterator
begin()
const {
return std::vector<T, Alloc>::begin(); }
77 const_iterator
end()
const {
return std::vector<T, Alloc>::end(); }
79 const_reverse_iterator
rbegin()
const {
return std::vector<T, Alloc>::rbegin(); }
81 const_reverse_iterator
rend()
const {
return std::vector<T, Alloc>::rend(); }
86 for (const_iterator it = begin(); it != end(); ++it)
88 if (m_comp(*it, t)) {
return it; }
Helper definitions for template programming.
void pop()
Pops an element off the stack.
void push(typename ConvertToRef< T >::ToConstRef t)
Pushes an element onto the stack.
size_type size() const
Returns the number of elements on the stack.
std::vector< T >::const_reverse_iterator const_reverse_iterator
Const reverse iterator type.
tSearchableStack< tSigned8 > tSigned8SearchableStack
#define ICL_CORE_VC_DEPRECATE
std::vector< T >::const_iterator const_iterator
tSearchableStack< tSigned32 > tSigned32SearchableStack
Contains macros to deprecate classes, types, functions and variables.
tSearchableStack< tUnsigned64 > tUnsigned64SearchableStack
tSearchableStack< tUnsigned32 > tUnsigned32SearchableStack
tSearchableStack< tSigned16 > tSigned16SearchableStack
const_iterator begin() const
Returns an iterator to the bottom element of the stack.
tSearchableStack< tUnsigned8 > tUnsigned8SearchableStack
std::vector< T >::size_type size_type
Size type.
const_iterator find(typename ConvertToRef< T >::ToConstRef t) const
Finds a specific element on the stack by linear search.
void clear()
Clears the stack.
tSearchableStack< tSigned64 > tSigned64SearchableStack
tSearchableStack< tUnsigned16 > tUnsigned16SearchableStack
tSearchableStack()
Constructs an empty stack.
const_reverse_iterator rend() const
Returns a reverse iterator to the bottom end of the stack.
const_reverse_iterator rbegin() const
Returns a reverse iterator to the top element of the stack.
tSearchableStack< tFloat > tFloatSearchableStack
tSearchableStack< tDouble > tDoubleSearchableStack
Contains Interface base classes and base types.
ICL_CORE_VC_DEPRECATE SetRelation tSetRelation ICL_CORE_GCC_DEPRECATE
ConvertToRef< T >::ToRef top()
Returns a reference to the top stack element.
bool empty() const
Returns true if the stack is empty.
ConvertToRef< T >::ToConstRef top() const
Returns a const reference to the top stack element.
const_iterator end() const
Returns an iterator to the top end of the stack.