InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
K2::stack< T, _C > Class Template Reference

#include <K2Stack.h>

Public Types

typedef _C::value_type value_type
 
typedef _C::size_type size_type
 
typedef _C container_type
 

Public Member Functions

 stack (const _C &x=_C())
 
bool16 empty () const
 
size_type size () const
 
value_type & top ()
 
const value_type & top () const
 
void push (const value_type &x)
 
void pop ()
 

Protected Attributes

_C c
 

Friends

bool16 operator== (const stack< T, _C > &lhs, const stack< T, _C > &rhs)
 
bool16 operator!= (const stack< T, _C > &lhs, const stack< T, _C > &rhs)
 
bool16 operator< (const stack< T, _C > &lhs, const stack< T, _C > &rhs)
 
bool16 operator<= (const stack< T, _C > &lhs, const stack< T, _C > &rhs)
 
bool16 operator> (const stack< T, _C > &lhs, const stack< T, _C > &rhs)
 
bool16 operator>= (const stack< T, _C > &lhs, const stack< T, _C > &rhs)
 

Detailed Description

template<class T, class _C>
class K2::stack< T, _C >

This is an STL style stack (adaptor) based on K2Vector.

Member Function Documentation

template<class T, class _C>
bool16 K2::stack< T, _C >::empty () const
inline

Tests if the stack is empty.

Returns
kTrue if the stack is empty, kFalse otherwise.
template<class T, class _C>
void K2::stack< T, _C >::pop ()
inline

Extracts an element from the top of the stack.

template<class T, class _C>
void K2::stack< T, _C >::push (const value_type & x)
inline

Adds an element to the top of the stack.

template<class T, class _C>
size_type K2::stack< T, _C >::size () const
inline

Gets the size of the stack (number of elements).

Returns
number of elements in the stack.
template<class T, class _C>
value_type& K2::stack< T, _C >::top ()
inline

Gets the element at the top of the stack without extracting it.

Returns
reference to the top element.
template<class T, class _C>
const value_type& K2::stack< T, _C >::top () const
inline

Gets the element at the top of the stack.

Returns
reference to the top element.