The C++ platform supports the technology of nested dictionaries — a mechanism for storing and retrieving an arbitrary set of data. A dictionary is a container that provides the ability to work with data as with an array in which each element is associated with a unique key. The key is used for identifying, searching, and manipulating the stored data, and it is usually a string value. The association <key — data> is named as an item. Usually, the dictionary implementation additionally associates an integer number with each item, which is the item ID. A dictionary can contain any number of items and data of any type. The dictionary allows developers to:
Dictionaries are used for classifying various information about the objects of a drawing, their styles, and their formats. Objects of a drawing can refer to objects of a dictionary, which can be attached and used as non-standard objects in a drawing. Dictionaries are also used for accessing available objects of an application.
A program can have multiple dictionaries that store various data. Additionally, one dictionary can be an item of another dictionary, nesting one into another. The nested dictionaries form a tree-shape hierarchical structure where one dictionary is the root. The root dictionary stores information about other dictionaries and associates each dictionary with an unique name that is used as a dictionary identifier. Dictionaries contained in the root dictionary form the first level. Dictionaries of the first level contain data and can contain other dictionaries that form the second level. Dictionaries of the second level usually contain only data, but can also contain other dictionaries that form the third level, and so forth. The number of levels is unlimited.
The hierarchical structure of dictionaries allows a program to attach data dynamically to existing data at run-time and easily modify the existing structures.
Overview of Classes that Implement a Dictionary
Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.
|