RWTStack man page on IRIX

Man page or keyword search:  
man Server   31559 pages
apropos Keyword Search (all sections)
Output format
IRIX logo
[printable version]



RWTStack(3C++)							RWTStack(3C++)

Name
     RWTStack<T,C> - Rogue Wave library class

Synopsis
	      #include <rw/tstack.h>

	      RWTStack<T, C> stack;

Description
     This class maintains a stack of values.  Not only can the type of object
     inserted onto the stack be parameterized, but also the implementation of
     the stack. Parameter T represents the type of object in the stack, either
     a class or built in type.	The class T must have:
	  well-defined copy semantics (T::T(const T&) or equiv.);

	  well-defined assignment semantics (T::operator=(const T&) or
	  equiv.);

	  any other semantics required by class C.

Persistence
     Parameter C represents the class used for implementation.	Useful choices
     are RWTValOrderedVector<T> or RWTValDlist<T>.  Class RWTValSlist<T> can
     also be used, but note that singly-linked lists are less efficient at
     removing the last item of a list (function pop()), because of the
     necessity of searching the list for the next-to-the-last item.  None

Example
     In this example a stack of ints, implemented as an ordered vector, is
     exercised.

	      #include <rw/tstack.h>
	  #include <rw/tvordvec.h>
	  #include <rw/rstream.h>
	  main() {
	    RWTStack<int, RWTValOrderedVector<int> > stack;
	    stack.push(1);
	    stack.push(5);
	    stack.push(6);
	    while (!stack.isEmpty())
	      cout << stack.pop() << endl;
	    return 0;
	  }

     Program output:

									Page 1

RWTStack(3C++)							RWTStack(3C++)

	      6
	  5

Public Member Functions
     1

	      void
	  clear();

     Removes all items from the stack.

	      size_t
	  entries() const;

     Returns the number of items currently on the stack.

	      RWBoolean
	  isEmpty() const;

     Returns TRUE if there are currently no items on the stack, FALSE
     otherwise.

	      void
	  push(T a);

     Push the item a onto the top of the stack.

	      T
	  pop();

     Pop (remove and return) the item at the top of the stack.	If there are
     no items on the stack then an exception of type TOOL_INDEX will occur.

	      T
	  top() const;

     Returns (but does not remove) the item at the top of the stack.

									Page 2

[top]

List of man pages available for IRIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net