home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / iacllct.inl < prev    next >
Encoding:
Text File  |  1996-02-22  |  7.4 KB  |  311 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. // IElementCursor
  20. // --------------
  21.  
  22. // public members
  23.  
  24. template <class Element>
  25. inline Element const&
  26. IElementCursor <Element>::
  27. element () const
  28. { return *(Element const*) ImplOf (*this).Element ();
  29. }
  30.  
  31. // protected members
  32.  
  33. template <class Element>
  34. inline
  35. IElementCursor <Element>::
  36. IElementCursor (Implementation* impl)
  37. : ICursor (impl)
  38. {
  39. }
  40.  
  41. // ------------
  42. // IACollection
  43. // ------------
  44.  
  45. // public members
  46.  
  47. template <class Element>
  48. inline
  49. IACollection <Element>::
  50. IACollection (INotifier& notifier)
  51. { SetImpl ((Implementation*)¬ifier);
  52. }
  53.  
  54. template <class Element>
  55. inline
  56. IACollection <Element>::
  57. ~IACollection ()
  58. {  
  59. }
  60.  
  61. template <class Element>
  62. inline IBoolean
  63. IACollection <Element>::
  64. add (Element const& element)
  65. { return ImplOf (*this).Add (&element);
  66. }
  67.  
  68. template <class Element>
  69. inline IBoolean
  70. IACollection <Element>::
  71. add (Element const& element, ICursor& cursor)
  72. { return ImplOf (*this).Add (&element, CrsrImplOf (cursor));
  73. }
  74.  
  75. template <class Element>
  76. inline void
  77. IACollection <Element>::
  78. addAllFrom (IACollection <Element> const& collection)
  79. { ImplOf (*this).AddAllFrom (ImplOf (collection));
  80. }
  81.  
  82. template <class Element>
  83. inline IBoolean
  84. IACollection <Element>::
  85. allElementsDo (IBoolean (*applFunc) (Element&, void*), void* addArg)
  86. { return ImplOf (*this).AllElementsDo ((IApplFunc)applFunc, addArg);
  87. }
  88.  
  89. template <class Element>
  90. inline IBoolean
  91. IACollection <Element>::
  92. allElementsDo (IBoolean (*applFunc) (Element const&, void*),
  93.                void* addArg) const
  94. { return ImplOf (*this).AllElementsDo ((IApplFunc)applFunc, addArg);
  95. }
  96.  
  97. template <class Element>
  98. inline IBoolean
  99. IACollection <Element>::
  100. allElementsDo (IApplicator <Element>& applicator)
  101. { return ImplOf (*this).AllElementsDo (__applFunc, &applicator);
  102. }
  103.  
  104. template <class Element>
  105. inline IBoolean
  106. IACollection <Element>::
  107. allElementsDo (IConstantApplicator <Element>& applicator) const
  108. { return ImplOf (*this).AllElementsDo (__applFunc, &applicator);
  109. }
  110.  
  111. template <class Element>
  112. inline Element const&
  113. IACollection <Element>::
  114. any () const
  115. { return *(Element const*) ImplOf (*this).Any ();
  116. }
  117.  
  118. template <class Element>
  119. inline Element const&
  120. IACollection <Element>::
  121. anyElement () const
  122. { return *(Element const*) ImplOf (*this).Any ();
  123. }
  124.  
  125. template <class Element>
  126. inline void
  127. IACollection <Element>::
  128. copy (IACollection <Element> const& collection)
  129. { ImplOf (*this).Copy (ImplOf (collection));
  130. }
  131.  
  132. template <class Element>
  133. inline INotifier&
  134. IACollection <Element>::
  135. disableNotification ()
  136. { return ImplOf (*this).DisableNotification ();
  137. }
  138.  
  139. template <class Element>
  140. inline Element&
  141. IACollection <Element>::
  142. elementAt (ICursor const& cursor)
  143. { return *(Element*) ImplOf (*this).ElementAt (CrsrImplOf (cursor));
  144. }
  145.  
  146. template <class Element>
  147. inline Element const&
  148. IACollection <Element>::
  149. elementAt (ICursor const& cursor) const
  150. { return *(Element const*) ImplOf (*this).
  151.     ElementAt (CrsrImplOf (cursor));
  152. }
  153.  
  154. template <class Element>
  155. inline INotifier&
  156. IACollection <Element>::
  157. enableNotification (IBoolean enable)
  158. { return ImplOf (*this).EnableNotification (enable);
  159. }
  160.  
  161. template <class Element>
  162. inline IBoolean
  163. IACollection <Element>::
  164. isBounded () const
  165. { return ImplOf (*this).IsBounded ();
  166. }
  167.  
  168. template <class Element>
  169. inline IBoolean
  170. IACollection <Element>::
  171. isConsistent () const
  172. { return ImplOf (*this).IsConsistent ();
  173. }
  174.  
  175. template <class Element>
  176. inline IBoolean
  177. IACollection <Element>::
  178. isEmpty () const
  179. { return ImplOf (*this).IsEmpty ();
  180. }
  181.  
  182. template <class Element>
  183. inline IBoolean
  184. IACollection <Element>::
  185. isEnabledForNotification () const
  186. { return ImplOf (*this).IsEnabledForNotification ();
  187. }
  188.  
  189. template <class Element>
  190. inline IBoolean
  191. IACollection <Element>::
  192. isFull () const
  193. { return ImplOf (*this).IsFull ();
  194. }
  195.  
  196. template <class Element>
  197. inline INumber
  198. IACollection <Element>::
  199. maxNumberOfElements () const
  200. { return ImplOf (*this).MaxNumberOfElements ();
  201. }
  202.  
  203. template <class Element>
  204. inline ICursor*
  205. IACollection <Element>::
  206. newCursor () const
  207. { return InterfaceFor (ImplOf (*this).CreateCursor ());
  208. }
  209.  
  210. template <class Element>
  211. inline INotifier&
  212. IACollection <Element>::
  213. notifier ()
  214. { return ImplOf (*this);
  215. }
  216.  
  217. template <class Element>
  218. inline INotifier const&
  219. IACollection <Element>::
  220. notifier () const
  221. { return ImplOf (*this);
  222. }
  223.  
  224. template <class Element>
  225. inline INotifier&
  226. IACollection <Element>::
  227. notifyObservers (INotificationEvent const& event)
  228. { return ImplOf (*this).notifyObservers (event);
  229. }
  230.  
  231. template <class Element>
  232. inline INumber
  233. IACollection <Element>::
  234. numberOfElements () const
  235. { return ImplOf (*this).NumberOfElements ();
  236. }
  237.  
  238. template <class Element>
  239. inline INumber
  240. IACollection <Element>::
  241. removeAll ()
  242. { return ImplOf (*this).RemoveAll ();
  243. }
  244.  
  245. template <class Element>
  246. inline INumber
  247. IACollection <Element>::
  248. removeAll (IBoolean (*predFunc) (Element const&, void*), void* addArg)
  249. { return ImplOf (*this).RemoveAll ((IPredFunc)predFunc, addArg);
  250. }
  251.  
  252. template <class Element>
  253. inline void
  254. IACollection <Element>::
  255. removeAt (ICursor& cursor)
  256. { ImplOf (*this).RemoveAt (CrsrImplOf (cursor));
  257. }
  258.  
  259. template <class Element>
  260. inline void
  261. IACollection <Element>::
  262. replaceAt (ICursor const& cursor, Element const& element)
  263. { ImplOf (*this).ReplaceAt (CrsrImplOf (cursor), &element);
  264. }
  265.  
  266. template <class Element>
  267. inline IBoolean
  268. IACollection <Element>::
  269. setToFirst (ICursor& cursor) const
  270. { return ImplOf (*this).SetToFirst (CrsrImplOf (cursor));
  271. }
  272.  
  273. template <class Element>
  274. inline IBoolean
  275. IACollection <Element>::
  276. setToNext (ICursor& cursor) const
  277. { return ImplOf (*this).SetToNext (CrsrImplOf (cursor));
  278. }
  279.  
  280. template <class Element>
  281. inline
  282. IACollection <Element>::
  283. operator INotifier& () const
  284. { return ImplOf (*this);
  285. }
  286.  
  287. // protected members
  288.  
  289. template <class Element>
  290. inline
  291. IACollection <Element>::
  292. IACollection ()
  293. : IACollectionBase ()
  294. {
  295. }
  296.  
  297. template <class Element>
  298. inline
  299. IACollection <Element>::
  300. IACollection (IACollection <Element> const& collection)
  301. : IACollectionBase (collection)
  302. {
  303. }
  304.  
  305. template <class Element>
  306. inline IACollection <Element>::Implementation&
  307. IACollection <Element>::
  308. ImplOf (IACollection <Element> const& collection)
  309. { return *(Implementation*)collection.ivImpl;
  310. }
  311.