RWTQueue man page on IRIX

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



RWTQueue(3C++)							RWTQueue(3C++)

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

Synopsis
	      #include <rw/tqueue.h>

	      RWTQueue<T, C> queue;

Description
     This class represents a parameterized queue.  Not only can the type of
     object inserted into the queue be parameterized, but also the
     implementation. Parameter T represents the type of object in the queue,
     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.

     Parameter C represents the class used for implementation.	Useful choices
     are RWTValSlist<T> or RWTValDlist<T>. Vectors, such as
     RWTValOrderedVector<T>, can also be used, but tend to be less efficient
     at removing an object from the front of the list.

Persistence
     None

Example
     In this example a queue of RWCStrings, implemented as a singly-linked
     list, is exercised.

	      #include <rw/tqueue.h>
	  #include <rw/cstring.h>
	  #include <rw/tvslist.h>
	  #include <rw/rstream.h>
	  main() {
	    RWTQueue<RWCString, RWTValSlist<RWCString> > queue;
	    queue.insert("one");   // Type conversion occurs
	    queue.insert("two");
	    queue.insert("three");
	    while (!queue.isEmpty())
	      cout << queue.get() << endl;
	    return 0;
	  }

									Page 1

RWTQueue(3C++)							RWTQueue(3C++)

     Program output

	      one
	  two

Public Member Functions
     three

	      void
	  clear();

     Removes all items from the queue.

	      size_t
	  entries() const;

     Returns the number of items in the queue.

	      T
	  first() const;

     Returns, but does not remove, the first item in the queue (the item least
     recently inserted into the queue).

	      T
	  get();

     Returns and removes the first item in the queue (the item least recently
     inserted into the queue).

	      RWBoolean
	  isEmpty() const;

     Returns TRUE if there are no items in the queue, otherwise FALSE.

	      void
	  insert(T a);

     Inserts the item a at the end of the queue.

	      T
	  last() const;

									Page 2

RWTQueue(3C++)							RWTQueue(3C++)

     Returns, but does not remove, the last item in the queue (the item most
     recently inserted into the queue).

									Page 3

[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