home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / help / lxsghelp.hlp (.txt) < prev    next >
Encoding:
OS/2 Help File  |  1996-02-22  |  12.1 KB  |  294 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Collection Class SmartGuide Help ΓòÉΓòÉΓòÉ
  3.  
  4. The Collection Class SmartGuide helps you choose the appropriate Collection 
  5. type for your application. 
  6.  
  7. In this SmartGuide, you select from the following four basic properties: 
  8.  
  9.  o Whether the class elements are ordered or unordered 
  10.  
  11.  o Whether the class uses keys in accessing elements in the collection 
  12.  
  13.  o Whether equality is defined for the element 
  14.  
  15.  o Whether any given element or key is unique, or whether multiple occurrences 
  16.    of the same element or key are allowed. 
  17.  
  18.  You can use this SmartGuide either in Novice or Expert mode.  In Novice mode, 
  19.  the SmartGuide walks you through the selection of the appropriate Collection 
  20.  class.  In Expert mode, you are assumed to know the Collection type that you 
  21.  want to use and you are simply prompted for the name of the collection, 
  22.  element type, and key type. You can also choose the implementation variant 
  23.  based on the performance and storage characteristics of your application. 
  24.  
  25.  This SmartGuide generates C++ source code that uses the Collection class you 
  26.  have selected.  It also generates the required functions for the element type 
  27.  and key type. 
  28.  
  29.  To use this SmartGuide, make the selection by clicking on the appropriate 
  30.  radio button, then press the Next push button. You can return to a previous 
  31.  SmartGuide page and change your selection by pressing the Back pushbutton. 
  32.  
  33.  When you are satisfied with your selections, press the Done push button.  The 
  34.  source code will be generated in your Edit session, starting at the current 
  35.  location of the cursor.  Optionally, the usage code can be generated in a 
  36.  separate file. screen. 
  37.  
  38.  
  39. ΓòÉΓòÉΓòÉ 1.1. Novice ΓòÉΓòÉΓòÉ
  40.  
  41. Select this button if you want help in selecting the appropriate Collection 
  42. type.  When you select this button, the subsequent SmartGuide pages will walk 
  43. you through the selection of the appropriate Collection type. You will be 
  44. prompted for the class attributes that you want to use in your application, 
  45. like key access and equality. You can also specify if you want the usage code 
  46. to be generated or not, and if you want the usage code to be generated in a 
  47. separate file. 
  48.  
  49.  
  50. ΓòÉΓòÉΓòÉ 1.2. Expert ΓòÉΓòÉΓòÉ
  51.  
  52. Select this button if you have already made the decision on the appropriate 
  53. Collection class that you want to use in your application. When you select this 
  54. button, the next SmartGuide page will simply prompt for the following 
  55. information about your class and its elements: collection type, collection 
  56. name, element type, and key type. 
  57.  
  58.  
  59. ΓòÉΓòÉΓòÉ 1.3. Ordered Collection ΓòÉΓòÉΓòÉ
  60.  
  61. Select this button if the elements in the class will have a next or previous 
  62. relationship with each other. Ordered collections can either be sorted or 
  63. sequential.  Sorted collections have their elements sorted by an ordering 
  64. relation defined for the element type. Sequential collections have their 
  65. ordering determined by an explicit qualifier. 
  66.  
  67.  
  68. ΓòÉΓòÉΓòÉ 1.4. Unordered Collection ΓòÉΓòÉΓòÉ
  69.  
  70. Select this button if the elements in the class will not have a next or 
  71. previous relationship with each other, that is, it is unordered . 
  72.  
  73.  
  74. ΓòÉΓòÉΓòÉ 1.5. Key Access ΓòÉΓòÉΓòÉ
  75.  
  76. Select this button if the collection will have a key defined for its elements. 
  77. Keys allow you to organize the elements in a collection, and access a specific 
  78. element in the collection. If you select this button, the SmartGuide will 
  79. generate the appropriate key type functions . 
  80.  
  81.  
  82. ΓòÉΓòÉΓòÉ 1.6. No Key Access ΓòÉΓòÉΓòÉ
  83.  
  84. Select this button if the collection will not have a key defined for its 
  85. elements. 
  86.  
  87.  
  88. ΓòÉΓòÉΓòÉ 1.7. Element Equality ΓòÉΓòÉΓòÉ
  89.  
  90. Select this button if you want to define an equality relation for the elements 
  91. of the collection.  When two elements are equal, all data members of both 
  92. elements are equal. 
  93.  
  94.  
  95. ΓòÉΓòÉΓòÉ 1.8. No Element Equality ΓòÉΓòÉΓòÉ
  96.  
  97. Select this button if you do not want to define an equality relation for the 
  98. elements of the collection. 
  99.  
  100.  
  101. ΓòÉΓòÉΓòÉ 1.9. Unique ΓòÉΓòÉΓòÉ
  102.  
  103. Select this button if you do not want two keys or two elements to be equal, 
  104. that is, they are unique collections . 
  105.  
  106.  
  107. ΓòÉΓòÉΓòÉ 1.10. Multiple ΓòÉΓòÉΓòÉ
  108.  
  109. Select this button if you will allow two equal elements, or elements with equal 
  110. keys in the collection, that is, they are multiple collections . 
  111.  
  112.  
  113. ΓòÉΓòÉΓòÉ 1.11. No Restriction ΓòÉΓòÉΓòÉ
  114.  
  115. Select this button if you do not want restricted access to the collection. 
  116. Collections with restricted access have a restricted set of functions that can 
  117. be applied to them. 
  118.  
  119.  
  120. ΓòÉΓòÉΓòÉ 1.12. Restrict Priority ΓòÉΓòÉΓòÉ
  121.  
  122. Select this button if you want an element to be placed in the collection 
  123. according to its key value or priority . The highest priority is indicated by 
  124. the lowest key value. 
  125.  
  126.  
  127. ΓòÉΓòÉΓòÉ 1.13. Sorted ΓòÉΓòÉΓòÉ
  128.  
  129. Select this button if you want the elements of the collection to be arranged by 
  130. an ordering relation defined for the element type. The ordering relation is 
  131. determined by the instantiations of the collection class. 
  132.  
  133.  
  134. ΓòÉΓòÉΓòÉ 1.14. Sequential ΓòÉΓòÉΓòÉ
  135.  
  136. Select this button if you want the ordering of elements in the collection to be 
  137. determined by an explicit qualifier. 
  138.  
  139.  
  140. ΓòÉΓòÉΓòÉ 1.15. Stack ΓòÉΓòÉΓòÉ
  141.  
  142. Select this button if you want the elements in the collection to be added or 
  143. removed on a last-in, first-out (LIFO) basis. 
  144.  
  145.  
  146. ΓòÉΓòÉΓòÉ 1.16. Queue ΓòÉΓòÉΓòÉ
  147.  
  148. Select this button if you want the elements in the collection to be added or 
  149. removed on a first-come, first-served basis. 
  150.  
  151.  
  152. ΓòÉΓòÉΓòÉ 1.17. Double Ended Queue ΓòÉΓòÉΓòÉ
  153.  
  154. Select this button if you want the elements in the collection to be added or 
  155. removed from the two ends of the queue, that is, from the "fresh" end and the 
  156. "old" end. 
  157.  
  158.  
  159. ΓòÉΓòÉΓòÉ 1.18. Collection Type ΓòÉΓòÉΓòÉ
  160.  
  161. Enter the name of the Collection class type that you want to use. This can be 
  162. any of the following: 
  163.  
  164.  o Bag 
  165.  
  166.  o Deque 
  167.  
  168.  o Equality Sequence 
  169.  
  170.  o Heap 
  171.  
  172.  o Key Bag 
  173.  
  174.  o Key Set 
  175.  
  176.  o Key Sorted Bag 
  177.  
  178.  o Key Sorted Set 
  179.  
  180.  o Map 
  181.  
  182.  o Priority Queue 
  183.  
  184.  o Queue 
  185.  
  186.  o Relation 
  187.  
  188.  o Sequence 
  189.  
  190.  o Set 
  191.  
  192.  o Sorted Bag 
  193.  
  194.  o Sorted Map 
  195.  
  196.  o Sorted Relation 
  197.  
  198.  o Sorted Set 
  199.  
  200.  o Stack 
  201.  
  202.  
  203. ΓòÉΓòÉΓòÉ 1.19. Collection Name ΓòÉΓòÉΓòÉ
  204.  
  205. Enter the name of the collection class that will be instantiated in the 
  206. generated code. 
  207.  
  208.  
  209. ΓòÉΓòÉΓòÉ 1.20. Element Type ΓòÉΓòÉΓòÉ
  210.  
  211. Enter the type of the elements that will comprise the collection. This type can 
  212. either be predefined or user-defined. 
  213.  
  214.  
  215. ΓòÉΓòÉΓòÉ 1.21. Key Element Type ΓòÉΓòÉΓòÉ
  216.  
  217. Enter the key type for the collection.  This type can either be predefined or 
  218. user-defined. 
  219.  
  220.  
  221. ΓòÉΓòÉΓòÉ 1.22. Table ΓòÉΓòÉΓòÉ
  222.  
  223. Select this button if the collection is primarily used for reading data but the 
  224. elements are not frequently added or deleted once the collection is created. 
  225. Use a table implementation if all of the following are true: 
  226.  
  227.  o The elements to be stored are small. 
  228.  
  229.  o You can predict with some accuracy how many elements your application will 
  230.    be handling. 
  231.  
  232.  o Few or no elements will need to be added or deleted once the collection is 
  233.    first created. 
  234.  
  235.  
  236. ΓòÉΓòÉΓòÉ 1.23. Diluted Table ΓòÉΓòÉΓòÉ
  237.  
  238. Select this button if some elements of the collection are inserted or deleted 
  239. after the collection is created, and if the collection is primarily read from, 
  240. rather than written to. 
  241.  
  242.  
  243. ΓòÉΓòÉΓòÉ 1.24. List ΓòÉΓòÉΓòÉ
  244.  
  245. Select this button when you anticipate that many elements will be added or 
  246. deleted, and when you cannot accurately predict the maximum size of the 
  247. collection when it is first created. In a List implementation, storage is 
  248. dynamically allocated and freed. 
  249.  
  250.  
  251. ΓòÉΓòÉΓòÉ 1.25. AVL Tree ΓòÉΓòÉΓòÉ
  252.  
  253. The AVL Tree is a special form of binary search tree that maintains balance. An 
  254. AVL tree is suitable for a collection that contains a large number of small 
  255. elements.  It is also suitable for adding and deleting, because the performance 
  256. overhead for the rebalancing that sometimes occurs when an element is added or 
  257. deleted is still less expensive than searching through the elements of a 
  258. sequence to find the position at which to add or delete an element. 
  259.  
  260.  
  261. ΓòÉΓòÉΓòÉ 1.26. B* Tree ΓòÉΓòÉΓòÉ
  262.  
  263. A B* Tree implementation variant is suitable when you have many large elements 
  264. that are accessed by key. Because keys and their data are separated, the keys 
  265. in the tree structure are used for quick search and the pointers are used for 
  266. quick access of the data. 
  267.  
  268.  
  269. ΓòÉΓòÉΓòÉ 1.27. Hash Table ΓòÉΓòÉΓòÉ
  270.  
  271. In this implementation, an index is calculated from the key or other parts of 
  272. an element.  This index is used to look for matches in a hash table. A hash 
  273. table implementation is suitable for nearly all applications with a balanced 
  274. mix of operations.  Such an implementation is quick for retrieving elements. 
  275. It can also add and delete elements quickly, because unlike an AVL tree, it 
  276. does not need to be rebalanced.  The efficiency of a hash table implementation 
  277. is largely dependent on how efficiently you implement the hash function. 
  278.  
  279.  
  280. ΓòÉΓòÉΓòÉ 1.28. Main program ΓòÉΓòÉΓòÉ
  281.  
  282. If you enable this checkbox, a main program containing usage code will be 
  283. generated for you. If you disable this checkbox, no main program will be 
  284. generated, only the class declarations. 
  285.  
  286.  
  287. ΓòÉΓòÉΓòÉ 1.29. File Stem ΓòÉΓòÉΓòÉ
  288.  
  289. Enter the base name (or file stem) of the file that will be generated for your 
  290. application.  If you enter a name in this field, the main program will be 
  291. generated in the specified file with a .cpp extension.  The class declarations 
  292. will be generated in the current Edit session, starting at the current location 
  293. of the cursor.  You must save the file containing this generated class 
  294. declarations as a .hpp file using the same file stem.