rw_hashmultimap man page on IRIX

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



rw_hashmultimap(3C++)					 rw_hashmultimap(3C++)

Name
     rw_hashmultimap - Rogue Wave library class

Synopsis
	      #include <rw/rwstl/hashmmap.h>
	  rw_hashmultimap<K,V,Hash,EQ> mmap;

Description
     Class rw_hashmultimap<K,V,Hash,EQ> maintains a collection of mappings
     between K and V, implemented as a hash table of pair<const K,V> in which
     there may be many pairs with the same K instance.	Since this is a value
     based collection, objects are copied into and out of the collection.  As
     with all classes that meet the ANSI associative container specification,
     rw_hashmap provides for iterators that reference its elements.
     Operations that alter the contents of rw_hashmap may invalidate other
     iterators that reference the container.  Since the contents of rw_hashmap
     are in pseudo-random order, the only iterator ranges that will usually
     make sense are the results of calling equal_range(key), and the entire
     range from begin() to end().

Persistence
     None

Public Typedefs
	      typedef K			  key_type;
	  typedef Hash		      key_hash;
	  typedef EQ		      key_equal;
	  typedef pair<K,V>	      value_type; // or ... "const K"
	  typedef (unsigned)	      size_type; //from rw_slist
	  typedef (int)		      difference_type; // from rw_slist
	  typedef (value_type&)	      reference;
	  typedef (const value_type&) const_reference; //from rw_slist

     Iterators over rw_hashmultimap<K,V,Hash,EQ> are forward iterators.

	      typedef (scoped Iterator)	     iterator;
	  typedef (scoped ConsIterator)	 const_iterator;

Public Constructors
	      rw_hashmultimap<K,V,Hash,EQ>(size_type sz = 1024,
				       const Hash& h = Hash(),
				       const EQ& eq = EQ());

     Construct an empty rw_hashmultimap<K,V,Hash,EQ> with sz slots, using h as
     the hash object, and eq as the equality comparator.

									Page 1

rw_hashmultimap(3C++)					 rw_hashmultimap(3C++)

	      rw_hashmultimap<K,V,Hash,EQ>(const
				   rw_hashmultimap<K,V,Hash,EQ>& mmap);

     Construct an rw_hashmultimap<K,V,Hash,EQ> which is a copy of mmap.	 Each
     element from mmap will be copied into self.

	      rw_hashmultimap<K,V,Hash,EQ>(const_iterator first,
				       const_iterator bound
				       size_type sz=1024,
				       const Hash& h = Hash(),
				       const EQ& eq = EQ());

     Construct an rw_hashmultimap<K,V,Hash,EQ> with sz slots, using h as the
     hash object, and eq as the equality comparator, containing a copy of each
     pair referenced by the range starting with first and bounded by bound.

	      rw_hashmultimap<K,V,Hash,EQ>(const value_type* first,
				       const value_type* bound
				       size_type sz=1024,
				       const Hash& h = Hash(),
				       const EQ& eq = EQ());

     Construct an rw_hashmultimap<K,V,Hash,EQ> with sz slots, using h as the
     hash object, and eq as the equality comparator, containing a copy of each
     pair referenced by the range starting with first and bounded by bound.

Public Destructor
	      ~rw_hashmultimap<K,V,Hash,EQ>();

     The destructor releases the memory used by the container's
     implementation.

Public Operators
	      rw_hashmultimap<K,V,Hash,EQ>&
	  operator=(const rw_hashmultimap<K,V,Hash,EQ>& rhs);

     Sets self to have the same capacity, Hash and EQ as rhs, removes all
     self's current contents, and replaces them with copies of the elements in
     rhs.

	      bool
	  operator==(const rw_hashmultimap<K,V,Hash,EQ> & rhs) const;

     Returns true if self and rhs have the same number of elements, and for
     each value_type in self, there is exactly one corresponding value_type in
     rhs that has a first part for which the EQ object in self returns true,

									Page 2

rw_hashmultimap(3C++)					 rw_hashmultimap(3C++)

     and a second part for which operator==() returns true.  The need to test
     both parts, and ensure that the matches are one-to-one means that this
     operator may be significantly slower than the method equal_by_keys()
     described below.

Accessors
	      iterator
	  begin();

     The iterator returned references the first item in self.  If self is
     empty, the iterator is equal to end().  Note that because items are
     stored in pseudo-random order, this iterator might reference any item
     that has been stored in self.

	      const_iterator
	  begin() const;

     The iterator returned references the first item in self.  If self is
     empty, the iterator is equal to end().  Note that because items are
     stored in pseudo-random order, this iterator might reference any item
     that has been stored in self.

	      iterator
	  end();

     The iterator returned marks the location "off the end" of self.  It may
     not be dereferenced.

	      const_iterator
	  end() const;

     The iterator returned marks the location "off the end" of self.  It may
     not be dereferenced.

	      pair<const_iterator, const_iterator>
	  equal_range(const key_type key) const;

     Returns pair<const_iterator,const_iterator>(lower_bound(key),
     upper_bound(key)).	 Upper and lower bound have special meaning for hash-
     based collections.	 See discussion elsewhere.

	      pair<iterator, iterator>
	  equal_range(const key_type key);

     Returns pair<iterator,iterator>(lower_bound(key), upper_bound(key)).
     Upper and lower bound have special meaning for hash-based collections.

									Page 3

rw_hashmultimap(3C++)					 rw_hashmultimap(3C++)

     See discussion elsewhere.

	      const_iterator
	  lower_bound(const key_type& key) const;

     Returns the lower bound of key in self.  This has a special meaning for
     hash-based collections.  See discussion elsewhere.

	      iterator
	  lower_bound(const key_type& key);

     Returns the lower bound of key in self.  This has a special meaning for
     hash-based collections.  See discussion elsewhere.

	      const_iterator
	  upper_bound(const key_type& key) const;

     Returns the upper bound of key in self.  This has a special meaning for
     hash-based collections.  See discussion elsewhere.

	      iterator
	  upper_bound(const key_type& key);

     Returns the upper bound of key in self.  This has a special meaning for
     hash-based collections.  See discussion elsewhere.

Const Public Member Functions
	      size_type
	  capacity() const;

     Returns the number of slots in the hash table that self uses.

	      bool
	  empty() const;

     Returns true if self is empty.

	      float
	  fill_ratio() const;

     Returns the result of calculating size()/capacity().

	      size_type
	  size() const;

									Page 4

rw_hashmultimap(3C++)					 rw_hashmultimap(3C++)

     Returns the number of items currently held in self.

Mutators
	      void
	  clear();

     A synonym for erase(begin(),end());

	      size_type
	  erase(const key_type& key);

     Removes all pairs in self for which the first part is EQ to key, and
     returns the number of removed elements.

	      iterator
	  erase(iterator iter);

     Removes the element referenced by iter and returns an iterator
     referencing the "next" element.  If iter does not reference an item in
     self, the result is undefined.

	      iterator
	  erase(iterator first, iterator bound);

     Removes each element in the range which begins with first and is bound by
     bound.  Returns an iterator referencing bound.  If first does not
     reference an item in self (and if first and bound are not equal), the
     effect is undefined.

	      pair<iterator,bool>
	  insert(const value_type& val);

     Inserts the pair, val, and returns a pair with an iterator referencing
     the new element and true.

	      size_type
	  insert(iterator ignore, const value_type& val);

     Inserts the pair, val, returning 1.  Note that the first argument is
     provided only for conformance with the ANSI associative container
     specification, and is ignored by the method, since hash table look up can
     be done in constant time.

	      size_type
	  insert(const value_type* first, const value_type* bound);

									Page 5

rw_hashmultimap(3C++)					 rw_hashmultimap(3C++)

     For each element in the range beginning with first and bounded by bound,
     the element is copied into self.  Returns the number of elements
     inserted.

	      size_type
	  insert(const_iterator first, const_iterator bound);

     For each element in the range beginning with first and bounded by bound,
     the element is copied into self.  Returns the number of elements
     inserted.

	      void
	  swap(rw_hashmultimap<K,V,Hash,EQ>& other);

     Exchanges the contents of self with other including the Hash and EQ
     objects.  This method does not copy or destroy any of the items exchanged
     but exchanges the underlying hash tables.

Special Methods for Multimaps
	      size_type
	  count(const key_type& key) const;

     Returns the number of pairs in self which have key EQ to their first
     element.

	      bool
	  equal_by_keys(const rw_hashmultimap<K,V,Hash,EQ>& rhs) const;

     Returns true if self and rhs have the same size, and if for each distinct
     key_type in self, self and rhs have the same number of pairs with first
     parts that test EQ to that instance.  Note that this method does not
     compare the V (second) part of the pair of the items, so it will run
     slightly faster than operator==().

	      const_iterator
	  find(const key_type& key) const;

     Returns a const_iterator referencing some pair with key as its first
     element, if such a pair is contained in self, else returns end().

	      iterator
	  find(const key_type& key);

     Returns an iterator referencing some pair with key as its first element,
     if such a pair is contained in self, else returns end().

									Page 6

rw_hashmultimap(3C++)					 rw_hashmultimap(3C++)

	      void
	  resize(size_type sz);

     Resizes self's hash table to have sz slots; and re-hashes all self's
     elements into the new table.  Can be very expensive if self holds many
     elements.

									Page 7

[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