|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
This class represents a mapping structure, using a Red-Black binary tree.
template< typename K, typename V, class KTraits = CElementTraits< K >, class VTraits = CElementTraits< V > > class CRBMap : public CRBTree< K, V, KTraits, VTraits >
The key element type.
The value element type.
The code used to copy or move key elements. See CElementTraits Class for more details.
The code used to copy or move value elements.
CRBMap provides support for a mapping array of any given type, managing an ordered array of key elements and their associated values. Each key can have only one associated value. Elements (consisting of a key and a value) are stored in a binary tree structure, using the CRBMap::SetAt method. Elements can be removed using the CRBMap::RemoveKey method, which deletes the element with the given key value.
The KTraits and VTraits parameters are traits classes that contain any supplemental code needed to copy or move elements.
CRBMap is derived from CRBTree, which implements a binary tree using the Red-Black algorithm. CRBMultiMap is a variation that allows multiple values for each key. It too is derived from CRBTree, and so shares many features with CRBMap.
For a more complete discussion of the various collection classes and their features and performance characteristics, see ATL Collection Classes.