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