Map<Key, Value, KeyCompare> Class

Template Parameters | Constraint | Member Functions | Type Aliases | Member Variables

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 .

Definition

Line 12 of System.Base/Map.cm

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

Type Aliases

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 RedBlackTreeNodeIterator<Pair<Key, Value>, Pair<Key, Value>&, Pair<Key, Value>*> Begin()

Definition
Line 24 of System.Base/Map.cm


Begin Member Function

public inline 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 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 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 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 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 void Clear()

Definition
Line 56 of System.Base/Map.cm


Count Member Function

public inline long Count()

Definition
Line 48 of System.Base/Map.cm


End Member Function

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

Definition
Line 36 of System.Base/Map.cm


End Member Function

public inline 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 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 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(Pair<Key, Value>&& value)

Constraint
ValueType  is  Movable  and  MappedType  is  Movable
Definition
Line 104 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  and  MappedType  is  Copyable
Definition
Line 99 of System.Base/Map.cm


IsEmpty Member Function

public inline bool IsEmpty()

Definition
Line 52 of System.Base/Map.cm


LowerBound Member Function

public inline 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 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 void Remove(RedBlackTreeNodeIterator<Pair<Key, Value>, Pair<Key, Value>&, Pair<Key, Value>*> pos)

Definition
Line 113 of System.Base/Map.cm


Remove Member Function

public inline bool Remove(const Key& key)

Definition
Line 109 of System.Base/Map.cm


operator[] Member Function

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

Definition
Line 92 of System.Base/Map.cm


operator[] Member Function

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

Definition
Line 84 of System.Base/Map.cm