home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / iakey.inl < prev    next >
Encoding:
Text File  |  1996-02-22  |  5.8 KB  |  196 lines

  1. /**********************************************************************
  2. *                                                                     *
  3. *  IBM(R) VisualAge(TM) for C++ for Windows(R), Version 3.5           *
  4. *                                                                     *
  5. *  PID: 5622-880                                                      *
  6. *  - Licensed Material - Program-Property of IBM                      *
  7. *  (C) Copyright IBM Corp. 1991, 1995 - All Right Reserved.           *
  8. *                                                                     *
  9. *  US Government Users Restricted Rights - Use, duplication or        *
  10. *  disclosure restricted by GSA ADP Schedule Contract with IBM Corp.  *
  11. *                                                                     *
  12. *  VisualAge, and IBM are trademarks or registered trademarks of      *
  13. *  International Business Machines Corporation.                       *
  14. *  Windows is a registered trademark of Microsoft Corporation.        *
  15. *                                                                     *
  16. **********************************************************************/
  17.  
  18. // ---------------
  19. // IAKeyCollection
  20. // ---------------
  21.  
  22. // public members
  23.  
  24. template <class Element, class Key>
  25. inline
  26. IAKeyCollection <Element, Key>::
  27. IAKeyCollection (INotifier& notifier)
  28. { SetImpl ((Implementation*)¬ifier);
  29. }
  30.  
  31. template <class Element, class Key>
  32. inline
  33. IAKeyCollection <Element, Key>::
  34. ~IAKeyCollection ()
  35. {
  36. }
  37.  
  38. template <class Element, class Key>
  39. inline IBoolean
  40. IAKeyCollection <Element, Key>::
  41. addOrReplaceElementWithKey (Element const& element)
  42. { return ImplOf (*this).AddOrReplaceElementWithKey (&element);
  43. }
  44.  
  45. template <class Element, class Key>
  46. inline IBoolean
  47. IAKeyCollection <Element, Key>::
  48. addOrReplaceElementWithKey
  49.   (Element const& element, ICursor& cursor)
  50. { return ImplOf (*this).
  51.     AddOrReplaceElementWithKey (&element, CrsrImplOf (cursor));
  52. }
  53.  
  54. template <class Element, class Key>
  55. inline IBoolean
  56. IAKeyCollection <Element, Key>::
  57. containsAllKeysFrom (IACollection <Element> const& collection) const
  58. { return ImplOf (*this).
  59.     ContainsAllKeysFrom (IACollection <Element>::ImplOf (collection));
  60. }
  61.  
  62. template <class Element, class Key>
  63. inline IBoolean
  64. IAKeyCollection <Element, Key>::
  65. containsElementWithKey (Key const& key) const
  66. { return ImplOf (*this).ContainsElementWithKey (&key);
  67. }
  68.  
  69. template <class Element, class Key>
  70. inline Element&
  71. IAKeyCollection <Element, Key>::
  72. elementWithKey (Key const& key)
  73. { return *(Element*) ImplOf (*this).ElementWithKey (&key);
  74. }
  75.  
  76. template <class Element, class Key>
  77. inline Element const&
  78. IAKeyCollection <Element, Key>::
  79. elementWithKey (Key const& key) const
  80. { return *(Element*) ImplOf (*this).ElementWithKey (&key);
  81. }
  82.  
  83. template <class Element, class Key>
  84. inline Key const&
  85. IAKeyCollection <Element, Key>::
  86. key (Element const& element) const
  87. { return *(Key*) ImplOf (*this).Key (&element);
  88. }
  89.  
  90. template <class Element, class Key>
  91. inline IBoolean
  92. IAKeyCollection <Element, Key>::
  93. locateElementWithKey (Key const& key, ICursor& cursor) const
  94. { return ImplOf (*this).
  95.     LocateElementWithKey (&key, CrsrImplOf (cursor));
  96. }
  97.  
  98. template <class Element, class Key>
  99. inline IBoolean
  100. IAKeyCollection <Element, Key>::
  101. locateNextElementWithKey (Key const& key, ICursor& cursor) const
  102. { return ImplOf (*this).
  103.     LocateNextElementWithKey (&key, CrsrImplOf (cursor));
  104. }
  105.  
  106. template <class Element, class Key>
  107. inline IBoolean
  108. IAKeyCollection <Element, Key>::
  109. locateOrAddElementWithKey (Element const& element)
  110. { return ImplOf (*this).LocateOrAddElementWithKey (&element); 
  111. }
  112.  
  113. template <class Element, class Key>
  114. inline IBoolean
  115. IAKeyCollection <Element, Key>::
  116. locateOrAddElementWithKey (Element const& element, ICursor& cursor)
  117. { return ImplOf (*this).
  118.     LocateOrAddElementWithKey (&element, CrsrImplOf (cursor));
  119. }
  120.  
  121. template <class Element, class Key>
  122. inline INumber
  123. IAKeyCollection <Element, Key>::
  124. numberOfDifferentKeys () const
  125. { return ImplOf (*this).NumberOfDifferentKeys ();
  126. }
  127.  
  128. template <class Element, class Key>
  129. inline INumber
  130. IAKeyCollection <Element, Key>::
  131. numberOfElementsWithKey (Key const& key) const   
  132. { return ImplOf (*this).NumberOfElementsWithKey (&key);
  133. }
  134.  
  135. template <class Element, class Key>
  136. inline IBoolean
  137. IAKeyCollection <Element, Key>::
  138. removeElementWithKey (Key const& key)
  139. { return ImplOf (*this).RemoveElementWithKey (&key);
  140. }
  141.  
  142. template <class Element, class Key>
  143. inline INumber
  144. IAKeyCollection <Element, Key>::
  145. removeAllElementsWithKey (Key const& key)
  146. { return ImplOf (*this).RemoveAllElementsWithKey (&key);
  147. }
  148.  
  149. template <class Element, class Key>
  150. inline IBoolean
  151. IAKeyCollection <Element, Key>::
  152. replaceElementWithKey (Element const& element)
  153. { return ImplOf (*this).ReplaceElementWithKey (&element);
  154. }
  155.  
  156. template <class Element, class Key>
  157. inline IBoolean
  158. IAKeyCollection <Element, Key>::
  159. replaceElementWithKey (Element const& element, ICursor& cursor)
  160. { return ImplOf (*this).
  161.     ReplaceElementWithKey (&element, CrsrImplOf (cursor));
  162. }
  163.  
  164. template <class Element, class Key>
  165. inline IBoolean
  166. IAKeyCollection <Element, Key>::
  167. setToNextWithDifferentKey (ICursor& cursor) const
  168. { return ImplOf (*this).
  169.     SetToNextWithDifferentKey (CrsrImplOf (cursor));
  170. }
  171.  
  172. // protected members
  173.  
  174. template <class Element, class Key>
  175. inline
  176. IAKeyCollection <Element, Key>::
  177. IAKeyCollection ()
  178. {
  179. }
  180.  
  181. template <class Element, class Key>
  182. inline
  183. IAKeyCollection <Element, Key>::
  184. IAKeyCollection (IAKeyCollection <Element, Key> const&)
  185. {
  186. }
  187.  
  188. // private members
  189.  
  190. template <class Element, class Key>
  191. inline IAKeyCollection <Element, Key>::Implementation&
  192. IAKeyCollection <Element, Key>::
  193. ImplOf (IAKeyCollection <Element, Key> const& collection)
  194. { return *(Implementation*)collection.ivImpl;
  195. }
  196.