OMMap class

The OMMap class contains basic library functions that enable you to create and manipulate OMMaps. An OMMap is a type-safe map, based on a balanced binary tree (log(n) search time).

This class is defined in the header file ommap.h.

Construction summary
OMMap
Constructs an OMMap object
~OMMap
Destroys the OMMap object
Method summary
operator []
Returns the element found for the specified key
find
Looks for the specified element is in the map
getAt
Returns the element for the specified key
getCount
Returns the number of elements in the map
getKey
Gets the element for the specified key
isEmpty
Determines whether the map is empty
lookUp
Looks up the specified element in the map
remove
Deletes the specified element from the map
removeAll
Deletes all the elements from the map
Example

Consider a class, Graph, that has a bfs() operation that performs BFS search on the graph nodes to find a node with the specified data. The following figure shows the OMD of the Graph class.

The following figure shows the browser view of the Graph class.

The bfs() implementation uses OMQueue as the search container and OMMap as a record of the visited elements.

The following figure shows the implementation of Graph::bfs().

The following figure shows the implementation of Graph::Node::addAggregates().


Feedback