Map<Key, Value, KeyCompare> Class

An associative array of key-value pairs that are kept sorted in a RedBlackTree .

Searching for an element in the map and inserting an element to the map are Olog(n) operations.

Model of BidirectionalContainer .

Template Parameters

Key
Value
KeyCompare Less<Key>

Constraint

Key  is  Semiregular  and  Value  is  Semiregular  and  KeyCompare  is  Relation  and  KeyCompare .Domain is  Key

Member Functions

public inline nothrow RedBlackTreeNodeIterator<Pair<Key, Value>, Pair<Key, Value>&, Pair<Key, Value>*> Begin()
public inline nothrow RedBlackTreeNodeIterator<Pair<Key, Value>, const Pair<Key, Value>&, const Pair<Key, Value>*> Begin() const
public inline nothrow RedBlackTreeNodeIterator<Pair<Key, Value>, const Pair<Key, Value>&, const Pair<Key, Value>*> CBegin() const
public inline nothrow RedBlackTreeNodeIterator<Pair<Key, Value>, const Pair<Key, Value>&, const Pair<Key, Value>*> CEnd() const
public inline nothrow RedBlackTreeNodeIterator<Pair<Key, Value>, const Pair<Key, Value>&, const Pair<Key, Value>*> CFind(const Key& key) const
public inline nothrow RedBlackTreeNodeIterator<Pair<Key, Value>, const Pair<Key, Value>&, const Pair<Key, Value>*> CLowerBound(const Key& key) const
public inline nothrow void Clear()
public inline nothrow long Count() const
public inline nothrow RedBlackTreeNodeIterator<Pair<Key, Value>, Pair<Key, Value>&, Pair<Key, Value>*> End()
public inline nothrow RedBlackTreeNodeIterator<Pair<Key, Value>, const Pair<Key, Value>&, const Pair<Key, Value>*> End() const
public inline nothrow RedBlackTreeNodeIterator<Pair<Key, Value>, Pair<Key, Value>&, Pair<Key, Value>*> Find(const Key& key)
public inline nothrow RedBlackTreeNodeIterator<Pair<Key, Value>, const Pair<Key, Value>&, const Pair<Key, Value>*> Find(const Key& key) const
public inline Pair<RedBlackTreeNodeIterator<Pair<Key, Value>, Pair<Key, Value>&, Pair<Key, Value>*>, bool> Insert(const Pair<Key, Value>& value)
public inline nothrow bool IsEmpty() const
public inline nothrow RedBlackTreeNodeIterator<Pair<Key, Value>, Pair<Key, Value>&, Pair<Key, Value>*> LowerBound(const Key& key)
public inline nothrow RedBlackTreeNodeIterator<Pair<Key, Value>, const Pair<Key, Value>&, const Pair<Key, Value>*> LowerBound(const Key& key) const
public inline nothrow void Remove(RedBlackTreeNodeIterator<Pair<Key, Value>, Pair<Key, Value>&, Pair<Key, Value>*> pos)
public inline nothrow bool Remove(const Key& key)
public inline Value& operator[](const Key& key)

Typedefs

public typedef Compare KeyCompare
public typedef ConstIterator RedBlackTreeNodeIterator<Pair<Key, Value>, const Pair<Key, Value>&, const Pair<Key, Value>*>
public typedef Iterator RedBlackTreeNodeIterator<Pair<Key, Value>, Pair<Key, Value>&, Pair<Key, Value>*>
public typedef KeyType Key
public typedef MappedType Value
private typedef Self Map
private typedef TreeType RedBlackTree<Key, Pair<Key, Value>, SelectFirst<Key, Value>, KeyCompare>
public typedef ValueType Pair<Key, Value>

Member Variables

private RedBlackTree<Key, Pair<Key, Value>, SelectFirst<Key, Value>, KeyCompare> tree

Member Function Details

Begin Member Function

public inline nothrow RedBlackTreeNodeIterator<Pair<Key, Value>, Pair<Key, Value>&, Pair<Key, Value>*> Begin()

Definition
Line 24 of System.Base/Map.cm


Begin Member Function

public inline nothrow RedBlackTreeNodeIterator<Pair<Key, Value>, const Pair<Key, Value>&, const Pair<Key, Value>*> Begin()

Definition
Line 28 of System.Base/Map.cm


CBegin Member Function

public inline nothrow RedBlackTreeNodeIterator<Pair<Key, Value>, const Pair<Key, Value>&, const Pair<Key, Value>*> CBegin()

Definition
Line 32 of System.Base/Map.cm


CEnd Member Function

public inline nothrow RedBlackTreeNodeIterator<Pair<Key, Value>, const Pair<Key, Value>&, const Pair<Key, Value>*> CEnd()

Definition
Line 44 of System.Base/Map.cm


CFind Member Function

public inline nothrow RedBlackTreeNodeIterator<Pair<Key, Value>, const Pair<Key, Value>&, const Pair<Key, Value>*> CFind(const Key& key)

Definition
Line 68 of System.Base/Map.cm


CLowerBound Member Function

public inline nothrow RedBlackTreeNodeIterator<Pair<Key, Value>, const Pair<Key, Value>&, const Pair<Key, Value>*> CLowerBound(const Key& key)

Definition
Line 80 of System.Base/Map.cm


Clear Member Function

public inline nothrow void Clear()

Definition
Line 56 of System.Base/Map.cm


Count Member Function

public inline nothrow long Count()

Definition
Line 48 of System.Base/Map.cm


End Member Function

public inline nothrow RedBlackTreeNodeIterator<Pair<Key, Value>, Pair<Key, Value>&, Pair<Key, Value>*> End()

Definition
Line 36 of System.Base/Map.cm


End Member Function

public inline nothrow RedBlackTreeNodeIterator<Pair<Key, Value>, const Pair<Key, Value>&, const Pair<Key, Value>*> End()

Definition
Line 40 of System.Base/Map.cm


Find Member Function

public inline nothrow RedBlackTreeNodeIterator<Pair<Key, Value>, Pair<Key, Value>&, Pair<Key, Value>*> Find(const Key& key)

Definition
Line 60 of System.Base/Map.cm


Find Member Function

public inline nothrow RedBlackTreeNodeIterator<Pair<Key, Value>, const Pair<Key, Value>&, const Pair<Key, Value>*> Find(const Key& key)

Definition
Line 64 of System.Base/Map.cm


Insert Member Function

public inline Pair<RedBlackTreeNodeIterator<Pair<Key, Value>, Pair<Key, Value>&, Pair<Key, Value>*>, bool> Insert(const Pair<Key, Value>& value)

Constraint
ValueType  is  Copyable
Definition
Line 91 of System.Base/Map.cm


IsEmpty Member Function

public inline nothrow bool IsEmpty()

Definition
Line 52 of System.Base/Map.cm


LowerBound Member Function

public inline nothrow RedBlackTreeNodeIterator<Pair<Key, Value>, Pair<Key, Value>&, Pair<Key, Value>*> LowerBound(const Key& key)

Definition
Line 72 of System.Base/Map.cm


LowerBound Member Function

public inline nothrow RedBlackTreeNodeIterator<Pair<Key, Value>, const Pair<Key, Value>&, const Pair<Key, Value>*> LowerBound(const Key& key)

Definition
Line 76 of System.Base/Map.cm


Remove Member Function

public inline nothrow void Remove(RedBlackTreeNodeIterator<Pair<Key, Value>, Pair<Key, Value>&, Pair<Key, Value>*> pos)

Definition
Line 100 of System.Base/Map.cm


Remove Member Function

public inline nothrow bool Remove(const Key& key)

Definition
Line 96 of System.Base/Map.cm


operator[] Member Function

public inline Value& operator[](const Key& key)

Definition
Line 84 of System.Base/Map.cm