-
c_stack(void)
Default constructor. Creates an empty list.
-
c_stack( c_stack& that )
Copy constructor, creates a copy of the that list.
-
~c_stack(void)
Destructor, removes all elements from the list, freeing
resource used by the elements. ~T() is called during
this process for each element in the list.
-
virtual int get_count( void ) cosnt
virtual int add( const T&elm )
virtual int remove_all( void )
virtual c_collection_iter<T>* prepare_iter( const c_collection_sorting_order ord = raw_order ) const
virtual int first( c_collection_iter<T>*, T& ) const
virtual int next( c_collection_iter<T>*, T& ) const
virtual int prev( c_collection_iter<T>*, T& ) const
virtual int last( c_collection_iter<T>*, T& ) const
These functions are the implementation of the c_collection interface. Please
keep in mind that even though last(), and prev() are implemented, they will
be extremely inefficent, as the stack is only traversable in a forward fasion.
If you need efficent traversal in both directions, you should probably be
using a c_list instead.
-
virtual const c_stack<T>& operator=( cosnt c_stack& right )
This is the assingment operator for a c_stack object. It makes the
lvalue a copy of the rvalue. Any existing elements in the lvalue stack
are removed before copying the rvalue.
-
virtual void push( const T& elm )
virtual void pop( T& elm )
These act like the cannonical push and pop stack functions.
-
virtual int get_at( int pos, T& elm ) const
get_at() sets elm to the elemnt at position pos. Please note that
this will be inefficient for the stack object, due to the fact that
the c_stack object can only be traversed in a forward direction.
If you need to perform this type of operatios, you should probably
be using a c_array instead.
-
virtual int find_index( const T& ) const
This function returns the integer index (capable of being used in
a call to get_at() ) for the argument. Please note that this
is inefficent, as the stack object can only be traversed in a forward
direction. Also keep in mind that this function is the reason that
int operator==( const T& ) needs to be implemented for T.
|