Narzędzia użytkownika

Narzędzia witryny


opis_kontenera_hash_multimap

To jest stara wersja strony!


Opis kontenera hash_multmap

Autor: Grzegorz Mroziewicz

hash_multimap<Key, Data, HashFcn, EqualKey, Alloc>

Kontener hash_multimap jest mapą służącą do przechowywania par obiektów klucz-wartość. Wartość klucza Key nie musi być unikalna. Kontener pozwala przechowywać wiele elementów o zadanym kluczu oraz udostępnia metody do wyszukiwania i zliczania elementów o podanym kluczu. Wykorzystaniu funkcji mieszającej HashFcn pozwala osiągnąć lepszą złożoność czasową wyszukiwania elementów w mapie.

Typy :

NazwaOpis
KeyTyp klucza dla pary elementów kontenera.
DataTyp wartości dla pary elementów kontenera.
HashFcnFunkcja mieszająca ( hash<Key> ).
EqualKey Funktor określający czy klucze są sobie równe ( equal_to<Key> ).
Alloc Allokator pamięci.

Kontruktory

  • hash_multimap()
  • hash_multimap(size_type n)
  • hash_multimap(size_type n, const hasher& h)
  • hash_multimap(size_type n, const hasher& h, const key_equal& k)
  • hash_multimap(const hash_multimap&)
  • template <class InputIterator> hash_multimap(InputIterator, InputIterator)
  • template <class InputIterator> hash_multimap(InputIterator, InputIterator, size_type n)
  • template <class InputIterator> hash_multimap(InputIterator, InputIterator, size_type n, const hasher& h)
  • template <class InputIterator> hash_multimap(InputIterator, InputIterator, size_type n, const hasher& h, const key_equal& k)

Dodawanie elementów

  • iterator insert(const value_type& x)
  • template <class InputIterator> void insert(InputIterator, InputIterator);

Usuwanie elementów

  • void erase(iterator pos)
  • size_type erase(const key_type& k)
  • void erase(iterator first, iterator last)
  • void clear()

Wyszukiwanie elementów

  • const_iterator find(const key_type& k) const
  • iterator find(const key_type& k)
  • pair<const_iterator, const_iterator> equal_range(const key_type& k) const
  • pair<iterator, iterator> equal_range(const key_type& k)
  • size_type count(const key_type& k) const

Parametry kontenera

  • size_type size() const
  • size_type max_size() const
  • bool empty() const
  • size_type bucket_count() const
  • void resize(size_type n)

Inne

  • void swap(hash_multimap&)
  • hasher hash_funct() const
  • key_equal key_eq() const
Przykładowy program
opis_kontenera_hash_multimap.1229130490.txt.gz · ostatnio zmienione: 2008/12/13 02:08 przez gmroziew