OpenTTD Source  20240919-master-gdf0233f4c2
multimap.hpp File Reference

Go to the source code of this file.

Data Structures

class  MultiMap< Tkey, Tvalue, Tcompare >
 Hand-rolled multimap as map of lists. More...
 
class  MultiMapIterator< Tmap_iter, Tlist_iter, Tkey, Tvalue, Tcompare >
 STL-style iterator for MultiMap. More...
 
class  MultiMap< Tkey, Tvalue, Tcompare >
 Hand-rolled multimap as map of lists. More...
 

Functions

template<class Tmap_iter1 , class Tlist_iter1 , class Tmap_iter2 , class Tlist_iter2 , class Tkey , class Tvalue1 , class Tvalue2 , class Tcompare >
bool operator== (const MultiMapIterator< Tmap_iter1, Tlist_iter1, Tkey, Tvalue1, Tcompare > &iter1, const MultiMapIterator< Tmap_iter2, Tlist_iter2, Tkey, Tvalue2, Tcompare > &iter2)
 Compare two MultiMap iterators. More...
 
template<class Tmap_iter1 , class Tlist_iter1 , class Tmap_iter2 , class Tlist_iter2 , class Tkey , class Tvalue1 , class Tvalue2 , class Tcompare >
bool operator!= (const MultiMapIterator< Tmap_iter1, Tlist_iter1, Tkey, Tvalue1, Tcompare > &iter1, const MultiMapIterator< Tmap_iter2, Tlist_iter2, Tkey, Tvalue2, Tcompare > &iter2)
 Inverse of operator==(). More...
 
template<class Tmap_iter1 , class Tlist_iter1 , class Tmap_iter2 , class Tkey , class Tvalue , class Tcompare >
bool operator== (const MultiMapIterator< Tmap_iter1, Tlist_iter1, Tkey, Tvalue, Tcompare > &iter1, const Tmap_iter2 &iter2)
 Check if a MultiMap iterator is at the begin of a list pointed to by the given map iterator. More...
 
template<class Tmap_iter1 , class Tlist_iter1 , class Tmap_iter2 , class Tkey , class Tvalue , class Tcompare >
bool operator!= (const MultiMapIterator< Tmap_iter1, Tlist_iter1, Tkey, Tvalue, Tcompare > &iter1, const Tmap_iter2 &iter2)
 Inverse of operator==() with same signature. More...
 
template<class Tmap_iter1 , class Tlist_iter1 , class Tmap_iter2 , class Tkey , class Tvalue , class Tcompare >
bool operator== (const Tmap_iter2 &iter2, const MultiMapIterator< Tmap_iter1, Tlist_iter1, Tkey, Tvalue, Tcompare > &iter1)
 Same as operator==() with reversed order of arguments. More...
 
template<class Tmap_iter1 , class Tlist_iter1 , class Tmap_iter2 , class Tkey , class Tvalue , class Tcompare >
bool operator!= (const Tmap_iter2 &iter2, const MultiMapIterator< Tmap_iter1, Tlist_iter1, Tkey, Tvalue, Tcompare > &iter1)
 Same as operator!=() with reversed order of arguments. More...
 

Detailed Description

Multimap with deterministic ordering of items with equal keys.

Definition in file multimap.hpp.

Function Documentation

◆ operator!=() [1/3]

template<class Tmap_iter1 , class Tlist_iter1 , class Tmap_iter2 , class Tkey , class Tvalue , class Tcompare >
bool operator!= ( const MultiMapIterator< Tmap_iter1, Tlist_iter1, Tkey, Tvalue, Tcompare > &  iter1,
const Tmap_iter2 &  iter2 
)

Inverse of operator==() with same signature.

Parameters
iter1MultiMap iterator.
iter2Map iterator.
Returns
If iter1 doesn't point to the begin of the list pointed to by iter2.

Definition at line 243 of file multimap.hpp.

◆ operator!=() [2/3]

template<class Tmap_iter1 , class Tlist_iter1 , class Tmap_iter2 , class Tlist_iter2 , class Tkey , class Tvalue1 , class Tvalue2 , class Tcompare >
bool operator!= ( const MultiMapIterator< Tmap_iter1, Tlist_iter1, Tkey, Tvalue1, Tcompare > &  iter1,
const MultiMapIterator< Tmap_iter2, Tlist_iter2, Tkey, Tvalue2, Tcompare > &  iter2 
)

Inverse of operator==().

Lots of template parameters to make all possible const and non-const types of MultiMap iterators (on maps with const and non-const values) comparable to each other.

Parameters
iter1First iterator to compare.
iter2Second iterator to compare.
Returns
If iter1 and iter2 are not equal.

Definition at line 217 of file multimap.hpp.

◆ operator!=() [3/3]

template<class Tmap_iter1 , class Tlist_iter1 , class Tmap_iter2 , class Tkey , class Tvalue , class Tcompare >
bool operator!= ( const Tmap_iter2 &  iter2,
const MultiMapIterator< Tmap_iter1, Tlist_iter1, Tkey, Tvalue, Tcompare > &  iter1 
)

Same as operator!=() with reversed order of arguments.

Parameters
iter2Map iterator.
iter1MultiMap iterator.
Returns
If iter1 doesn't point to the begin of the list pointed to by iter2.

Definition at line 267 of file multimap.hpp.

◆ operator==() [1/3]

template<class Tmap_iter1 , class Tlist_iter1 , class Tmap_iter2 , class Tkey , class Tvalue , class Tcompare >
bool operator== ( const MultiMapIterator< Tmap_iter1, Tlist_iter1, Tkey, Tvalue, Tcompare > &  iter1,
const Tmap_iter2 &  iter2 
)

Check if a MultiMap iterator is at the begin of a list pointed to by the given map iterator.

Lots of template parameters to make all possible const and non-const types of MultiMap iterators (on maps with const and non-const values) comparable to all possible types of map iterators.

Parameters
iter1MultiMap iterator.
iter2Map iterator.
Returns
If iter1 points to the begin of the list pointed to by iter2.

Definition at line 231 of file multimap.hpp.

◆ operator==() [2/3]

template<class Tmap_iter1 , class Tlist_iter1 , class Tmap_iter2 , class Tlist_iter2 , class Tkey , class Tvalue1 , class Tvalue2 , class Tcompare >
bool operator== ( const MultiMapIterator< Tmap_iter1, Tlist_iter1, Tkey, Tvalue1, Tcompare > &  iter1,
const MultiMapIterator< Tmap_iter2, Tlist_iter2, Tkey, Tvalue2, Tcompare > &  iter2 
)

Compare two MultiMap iterators.

Iterators are equal if

  1. Their map iterators are equal.
  2. They agree about list_valid.
  3. If list_valid they agree about list_iter. Lots of template parameters to make all possible const and non-const types of MultiMap iterators (on maps with const and non-const values) comparable to each other.
    Parameters
    iter1First iterator to compare.
    iter2Second iterator to compare.
    Returns
    If iter1 and iter2 are equal.

Definition at line 200 of file multimap.hpp.

◆ operator==() [3/3]

template<class Tmap_iter1 , class Tlist_iter1 , class Tmap_iter2 , class Tkey , class Tvalue , class Tcompare >
bool operator== ( const Tmap_iter2 &  iter2,
const MultiMapIterator< Tmap_iter1, Tlist_iter1, Tkey, Tvalue, Tcompare > &  iter1 
)

Same as operator==() with reversed order of arguments.

Parameters
iter2Map iterator.
iter1MultiMap iterator.
Returns
If iter1 points to the begin of the list pointed to by iter2.

Definition at line 255 of file multimap.hpp.