home *** CD-ROM | disk | FTP | other *** search
-
- ΓòÉΓòÉΓòÉ 1. Collection Class SmartGuide Help ΓòÉΓòÉΓòÉ
-
- The Collection Class SmartGuide helps you choose the appropriate Collection
- type for your application.
-
- In this SmartGuide, you select from the following four basic properties:
-
- o Whether the class elements are ordered or unordered
-
- o Whether the class uses keys in accessing elements in the collection
-
- o Whether equality is defined for the element
-
- o Whether any given element or key is unique, or whether multiple occurrences
- of the same element or key are allowed.
-
- You can use this SmartGuide either in Novice or Expert mode. In Novice mode,
- the SmartGuide walks you through the selection of the appropriate Collection
- class. In Expert mode, you are assumed to know the Collection type that you
- want to use and you are simply prompted for the name of the collection,
- element type, and key type. You can also choose the implementation variant
- based on the performance and storage characteristics of your application.
-
- This SmartGuide generates C++ source code that uses the Collection class you
- have selected. It also generates the required functions for the element type
- and key type.
-
- To use this SmartGuide, make the selection by clicking on the appropriate
- radio button, then press the Next push button. You can return to a previous
- SmartGuide page and change your selection by pressing the Back pushbutton.
-
- When you are satisfied with your selections, press the Done push button. The
- source code will be generated in your Edit session, starting at the current
- location of the cursor. Optionally, the usage code can be generated in a
- separate file. screen.
-
-
- ΓòÉΓòÉΓòÉ 1.1. Novice ΓòÉΓòÉΓòÉ
-
- Select this button if you want help in selecting the appropriate Collection
- type. When you select this button, the subsequent SmartGuide pages will walk
- you through the selection of the appropriate Collection type. You will be
- prompted for the class attributes that you want to use in your application,
- like key access and equality. You can also specify if you want the usage code
- to be generated or not, and if you want the usage code to be generated in a
- separate file.
-
-
- ΓòÉΓòÉΓòÉ 1.2. Expert ΓòÉΓòÉΓòÉ
-
- Select this button if you have already made the decision on the appropriate
- Collection class that you want to use in your application. When you select this
- button, the next SmartGuide page will simply prompt for the following
- information about your class and its elements: collection type, collection
- name, element type, and key type.
-
-
- ΓòÉΓòÉΓòÉ 1.3. Ordered Collection ΓòÉΓòÉΓòÉ
-
- Select this button if the elements in the class will have a next or previous
- relationship with each other. Ordered collections can either be sorted or
- sequential. Sorted collections have their elements sorted by an ordering
- relation defined for the element type. Sequential collections have their
- ordering determined by an explicit qualifier.
-
-
- ΓòÉΓòÉΓòÉ 1.4. Unordered Collection ΓòÉΓòÉΓòÉ
-
- Select this button if the elements in the class will not have a next or
- previous relationship with each other, that is, it is unordered .
-
-
- ΓòÉΓòÉΓòÉ 1.5. Key Access ΓòÉΓòÉΓòÉ
-
- Select this button if the collection will have a key defined for its elements.
- Keys allow you to organize the elements in a collection, and access a specific
- element in the collection. If you select this button, the SmartGuide will
- generate the appropriate key type functions .
-
-
- ΓòÉΓòÉΓòÉ 1.6. No Key Access ΓòÉΓòÉΓòÉ
-
- Select this button if the collection will not have a key defined for its
- elements.
-
-
- ΓòÉΓòÉΓòÉ 1.7. Element Equality ΓòÉΓòÉΓòÉ
-
- Select this button if you want to define an equality relation for the elements
- of the collection. When two elements are equal, all data members of both
- elements are equal.
-
-
- ΓòÉΓòÉΓòÉ 1.8. No Element Equality ΓòÉΓòÉΓòÉ
-
- Select this button if you do not want to define an equality relation for the
- elements of the collection.
-
-
- ΓòÉΓòÉΓòÉ 1.9. Unique ΓòÉΓòÉΓòÉ
-
- Select this button if you do not want two keys or two elements to be equal,
- that is, they are unique collections .
-
-
- ΓòÉΓòÉΓòÉ 1.10. Multiple ΓòÉΓòÉΓòÉ
-
- Select this button if you will allow two equal elements, or elements with equal
- keys in the collection, that is, they are multiple collections .
-
-
- ΓòÉΓòÉΓòÉ 1.11. No Restriction ΓòÉΓòÉΓòÉ
-
- Select this button if you do not want restricted access to the collection.
- Collections with restricted access have a restricted set of functions that can
- be applied to them.
-
-
- ΓòÉΓòÉΓòÉ 1.12. Restrict Priority ΓòÉΓòÉΓòÉ
-
- Select this button if you want an element to be placed in the collection
- according to its key value or priority . The highest priority is indicated by
- the lowest key value.
-
-
- ΓòÉΓòÉΓòÉ 1.13. Sorted ΓòÉΓòÉΓòÉ
-
- Select this button if you want the elements of the collection to be arranged by
- an ordering relation defined for the element type. The ordering relation is
- determined by the instantiations of the collection class.
-
-
- ΓòÉΓòÉΓòÉ 1.14. Sequential ΓòÉΓòÉΓòÉ
-
- Select this button if you want the ordering of elements in the collection to be
- determined by an explicit qualifier.
-
-
- ΓòÉΓòÉΓòÉ 1.15. Stack ΓòÉΓòÉΓòÉ
-
- Select this button if you want the elements in the collection to be added or
- removed on a last-in, first-out (LIFO) basis.
-
-
- ΓòÉΓòÉΓòÉ 1.16. Queue ΓòÉΓòÉΓòÉ
-
- Select this button if you want the elements in the collection to be added or
- removed on a first-come, first-served basis.
-
-
- ΓòÉΓòÉΓòÉ 1.17. Double Ended Queue ΓòÉΓòÉΓòÉ
-
- Select this button if you want the elements in the collection to be added or
- removed from the two ends of the queue, that is, from the "fresh" end and the
- "old" end.
-
-
- ΓòÉΓòÉΓòÉ 1.18. Collection Type ΓòÉΓòÉΓòÉ
-
- Enter the name of the Collection class type that you want to use. This can be
- any of the following:
-
- o Bag
-
- o Deque
-
- o Equality Sequence
-
- o Heap
-
- o Key Bag
-
- o Key Set
-
- o Key Sorted Bag
-
- o Key Sorted Set
-
- o Map
-
- o Priority Queue
-
- o Queue
-
- o Relation
-
- o Sequence
-
- o Set
-
- o Sorted Bag
-
- o Sorted Map
-
- o Sorted Relation
-
- o Sorted Set
-
- o Stack
-
-
- ΓòÉΓòÉΓòÉ 1.19. Collection Name ΓòÉΓòÉΓòÉ
-
- Enter the name of the collection class that will be instantiated in the
- generated code.
-
-
- ΓòÉΓòÉΓòÉ 1.20. Element Type ΓòÉΓòÉΓòÉ
-
- Enter the type of the elements that will comprise the collection. This type can
- either be predefined or user-defined.
-
-
- ΓòÉΓòÉΓòÉ 1.21. Key Element Type ΓòÉΓòÉΓòÉ
-
- Enter the key type for the collection. This type can either be predefined or
- user-defined.
-
-
- ΓòÉΓòÉΓòÉ 1.22. Table ΓòÉΓòÉΓòÉ
-
- Select this button if the collection is primarily used for reading data but the
- elements are not frequently added or deleted once the collection is created.
- Use a table implementation if all of the following are true:
-
- o The elements to be stored are small.
-
- o You can predict with some accuracy how many elements your application will
- be handling.
-
- o Few or no elements will need to be added or deleted once the collection is
- first created.
-
-
- ΓòÉΓòÉΓòÉ 1.23. Diluted Table ΓòÉΓòÉΓòÉ
-
- Select this button if some elements of the collection are inserted or deleted
- after the collection is created, and if the collection is primarily read from,
- rather than written to.
-
-
- ΓòÉΓòÉΓòÉ 1.24. List ΓòÉΓòÉΓòÉ
-
- Select this button when you anticipate that many elements will be added or
- deleted, and when you cannot accurately predict the maximum size of the
- collection when it is first created. In a List implementation, storage is
- dynamically allocated and freed.
-
-
- ΓòÉΓòÉΓòÉ 1.25. AVL Tree ΓòÉΓòÉΓòÉ
-
- The AVL Tree is a special form of binary search tree that maintains balance. An
- AVL tree is suitable for a collection that contains a large number of small
- elements. It is also suitable for adding and deleting, because the performance
- overhead for the rebalancing that sometimes occurs when an element is added or
- deleted is still less expensive than searching through the elements of a
- sequence to find the position at which to add or delete an element.
-
-
- ΓòÉΓòÉΓòÉ 1.26. B* Tree ΓòÉΓòÉΓòÉ
-
- A B* Tree implementation variant is suitable when you have many large elements
- that are accessed by key. Because keys and their data are separated, the keys
- in the tree structure are used for quick search and the pointers are used for
- quick access of the data.
-
-
- ΓòÉΓòÉΓòÉ 1.27. Hash Table ΓòÉΓòÉΓòÉ
-
- In this implementation, an index is calculated from the key or other parts of
- an element. This index is used to look for matches in a hash table. A hash
- table implementation is suitable for nearly all applications with a balanced
- mix of operations. Such an implementation is quick for retrieving elements.
- It can also add and delete elements quickly, because unlike an AVL tree, it
- does not need to be rebalanced. The efficiency of a hash table implementation
- is largely dependent on how efficiently you implement the hash function.
-
-
- ΓòÉΓòÉΓòÉ 1.28. Main program ΓòÉΓòÉΓòÉ
-
- If you enable this checkbox, a main program containing usage code will be
- generated for you. If you disable this checkbox, no main program will be
- generated, only the class declarations.
-
-
- ΓòÉΓòÉΓòÉ 1.29. File Stem ΓòÉΓòÉΓòÉ
-
- Enter the base name (or file stem) of the file that will be generated for your
- application. If you enter a name in this field, the main program will be
- generated in the specified file with a .cpp extension. The class declarations
- will be generated in the current Edit session, starting at the current location
- of the cursor. You must save the file containing this generated class
- declarations as a .hpp file using the same file stem.