home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / iicksb.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  9.3 KB  |  342 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. #include <iiexc.h>
  19.  
  20. #pragma info (nocls, nocnd, nocns, nocnv, noext, nognr, novft)
  21. #pragma pack (4)
  22.  
  23. // ---
  24. // ICKeySortedBagImpl
  25. // ---
  26.  
  27. // public members
  28.  
  29. template <class CInherited>
  30. ICKeySortedBagImpl <CInherited>::
  31. ICKeySortedBagImpl (Ops& ops, INumber numberOfElements)
  32. : CInherited (ops, numberOfElements)
  33. {
  34. }
  35.  
  36. template <class CInherited>
  37. ICKeySortedBagImpl <CInherited>::
  38. ICKeySortedBagImpl
  39.   (Ops& ops, ICKeySortedBagImpl <CInherited> const& collection)
  40. : CInherited (ops, collection)
  41. {
  42. }
  43.  
  44. template <class CInherited>
  45. IBoolean
  46. ICKeySortedBagImpl <CInherited>::
  47. Add (void const* element, ICursorImpl& cursor)
  48. { ICHECK_IsFor      (ClassName (), "Add")
  49.  
  50.   IBoolean hasBeenAdded = CInherited::Add (element, cursor);
  51.   return hasBeenAdded;
  52. }
  53.  
  54. template <class CInherited>
  55. void
  56. ICKeySortedBagImpl <CInherited>::
  57. AddAllFrom (IACollectionImpl const& collection)
  58. { ICHECK_Identical (ClassName (), "AddAllFrom")
  59.  
  60.   CInherited::AddAllFrom (collection);
  61. }
  62.  
  63. template <class CInherited>
  64. IBoolean
  65. ICKeySortedBagImpl <CInherited>::
  66. AddOrReplaceElementWithKey (void const* element, ICursorImpl& cursor)
  67. { ICHECK_IsFor (ClassName (), "AddOrReplaceElementWithKey")
  68.  
  69.   return CInherited::AddOrReplaceElementWithKey (element, cursor);
  70. }
  71.  
  72. template <class CInherited>
  73. void*
  74. ICKeySortedBagImpl <CInherited>::
  75. Any () const
  76. { ICHECK_IsEmpty (ClassName (), "Any")
  77.  
  78.   return CInherited::Any ();
  79. }
  80.  
  81. template <class CInherited>
  82. void*
  83. ICKeySortedBagImpl <CInherited>::
  84. ElementAt (ICursorImpl const& cursor) const
  85. { ICHECK_IsFor        (ClassName (), "ElementAt")
  86.   ICHECK_IsValid      (ClassName (), "ElementAt")
  87. #if defined (IALL_CHECKS)
  88.   ICHECK_Cursor       (ClassName (), "ElementAt")
  89. #endif
  90.  
  91.   return CInherited::ElementAt (cursor);
  92. }
  93.  
  94. template <class CInherited>
  95. void*
  96. ICKeySortedBagImpl <CInherited>::
  97. ElementAtPosition (IPosition position) const
  98. { ICHECK_Position (ClassName (), "ElementAtPosition")
  99.  
  100.   return CInherited::ElementAtPosition (position);
  101. }
  102.  
  103. template <class CInherited>
  104. void*
  105. ICKeySortedBagImpl <CInherited>::
  106. ElementWithKey (void const* key) const
  107. { return CInherited::ElementWithKey (key);
  108. }
  109.  
  110. template <class CInherited>
  111. void*
  112. ICKeySortedBagImpl <CInherited>::
  113. First () const
  114. { ICHECK_IsEmpty (ClassName (), "First")
  115.  
  116.   return CInherited::First ();
  117. }
  118.  
  119. template <class CInherited>
  120. IBoolean
  121. ICKeySortedBagImpl <CInherited>::
  122. IsFirstAt (ICursorImpl const& cursor) const
  123. { ICHECK_IsFor        (ClassName (), "IsFirstAt")
  124.   ICHECK_IsValid      (ClassName (), "IsFirstAt")
  125. #if defined (IALL_CHECKS)
  126.   ICHECK_Cursor       (ClassName (), "IsFirstAt")
  127. #endif
  128.  
  129.   return CInherited::IsFirstAt (cursor);
  130. }
  131.  
  132. template <class CInherited>
  133. IBoolean
  134. ICKeySortedBagImpl <CInherited>::
  135. IsLastAt (ICursorImpl const& cursor) const
  136. { ICHECK_IsFor        (ClassName (), "IsLastAt")
  137.   ICHECK_IsValid      (ClassName (), "IsLastAt")
  138. #if defined (IALL_CHECKS)
  139.   ICHECK_Cursor       (ClassName (), "IsLastAt")
  140. #endif
  141.  
  142.   return CInherited::IsLastAt (cursor);
  143. }
  144.  
  145. template <class CInherited>
  146. void*
  147. ICKeySortedBagImpl <CInherited>::
  148. Last () const
  149. { ICHECK_IsEmpty (ClassName (), "Last")
  150.  
  151.   return CInherited::Last ();
  152. }
  153.  
  154. template <class CInherited>
  155. IBoolean
  156. ICKeySortedBagImpl <CInherited>::
  157. LocateElementWithKey (void const* key, ICursorImpl& cursor) const
  158. { ICHECK_IsFor (ClassName (), "LocateElementWithKey")
  159.  
  160.   return CInherited::LocateElementWithKey (key, cursor);
  161. }
  162.  
  163. template <class CInherited>
  164. IBoolean
  165. ICKeySortedBagImpl <CInherited>::
  166. LocateNextElementWithKey (void const* key, ICursorImpl& cursor) const
  167. { ICHECK_IsFor   (ClassName (), "LocateNextElementWithKey")
  168.   ICHECK_IsValid (ClassName (), "LocateNextElementWithKey")
  169. #if defined (IALL_CHECKS)
  170.   ICHECK_Cursor  (ClassName (), "LocateNextElementWithKey")
  171. #endif
  172.  
  173.   return CInherited::LocateNextElementWithKey (key, cursor);
  174. }
  175.  
  176. template <class CInherited>
  177. IBoolean
  178. ICKeySortedBagImpl <CInherited>::
  179. LocateOrAddElementWithKey (void const* key, ICursorImpl& cursor)
  180. { ICHECK_IsFor (ClassName (), "LocateOrAddElementWithKey")
  181.  
  182.   return CInherited::LocateOrAddElementWithKey (key, cursor);
  183. }
  184.  
  185. template <class CInherited>
  186. IPosition
  187. ICKeySortedBagImpl <CInherited>::
  188. PositionAt (ICursorImpl const& cursor) const
  189. { ICHECK_IsFor        (ClassName (), "PositionAt")
  190.   ICHECK_IsValid      (ClassName (), "PositionAt")
  191. #if defined (IALL_CHECKS)
  192.   ICHECK_Cursor       (ClassName (), "PositionAt")
  193. #endif
  194.  
  195.   return CInherited::PositionAt (cursor);
  196. }
  197.  
  198. template <class CInherited>
  199. void
  200. ICKeySortedBagImpl <CInherited>::
  201. RemoveAt (ICursorImpl& cursor)
  202. { ICHECK_IsFor        (ClassName (), "RemoveAt")
  203.   ICHECK_IsValid      (ClassName (), "RemoveAt")
  204. #if defined (IALL_CHECKS)
  205.   ICHECK_Cursor       (ClassName (), "RemoveAt")
  206. #endif
  207.  
  208.   CInherited::RemoveAt (cursor);
  209. }
  210.  
  211. template <class CInherited>
  212. void
  213. ICKeySortedBagImpl <CInherited>::
  214. RemoveAtPosition (IPosition position)
  215. { ICHECK_Position (ClassName (), "RemoveAtPosition")
  216.  
  217.   CInherited::RemoveAtPosition (position);
  218. }
  219.  
  220. template <class CInherited>
  221. void
  222. ICKeySortedBagImpl <CInherited>::
  223. RemoveFirst ()
  224. { ICHECK_IsEmpty (ClassName (), "RemoveFirst")
  225.  
  226.   CInherited::RemoveFirst ();
  227. }
  228.  
  229. template <class CInherited>
  230. void
  231. ICKeySortedBagImpl <CInherited>::
  232. RemoveLast ()
  233. { ICHECK_IsEmpty (ClassName (), "RemoveLast")
  234.  
  235.   CInherited::RemoveLast ();
  236. }
  237.  
  238. template <class CInherited>
  239. void
  240. ICKeySortedBagImpl <CInherited>::
  241. ReplaceAt (ICursorImpl const& cursor, void const* element)
  242. { ICHECK_IsFor        (ClassName (), "ReplaceAt")
  243.   ICHECK_IsValid      (ClassName (), "ReplaceAt")
  244. #if defined (IALL_CHECKS)
  245.   ICHECK_Cursor       (ClassName (), "ReplaceAt")
  246. #endif
  247.   ICHECK_Replacement  (ClassName (), "ReplaceAt")
  248.  
  249.   CInherited::ReplaceAt (cursor, element);
  250. }
  251.  
  252. template <class CInherited>
  253. void
  254. ICKeySortedBagImpl <CInherited>::
  255. ReplaceAtPosition (IPosition position, void const* element)
  256. { ICHECK_Position    (ClassName (), "ReplaceAtPosition")
  257.   ICursorImpl& cursor = CursorOf (*this);
  258.   CInherited::SetToPosition (position, cursor);
  259.   ICHECK_Replacement (ClassName (), "ReplaceAtPosition")
  260.  
  261.   CInherited::ReplaceAtPosition (position, element);
  262. }
  263.  
  264. template <class CInherited>
  265. IBoolean
  266. ICKeySortedBagImpl <CInherited>::
  267. ReplaceElementWithKey (void const* element, ICursorImpl& cursor)
  268. { ICHECK_IsFor (ClassName (), "ReplaceElementWithKey")
  269.  
  270.   return CInherited::ReplaceElementWithKey (element, cursor);
  271. }
  272.  
  273. template <class CInherited>
  274. IBoolean
  275. ICKeySortedBagImpl <CInherited>::
  276. SetToFirst (ICursorImpl& cursor) const
  277. { ICHECK_IsFor (ClassName (), "SetToFirst")
  278.  
  279.   return CInherited::SetToFirst (cursor);
  280. }
  281.  
  282. template <class CInherited>
  283. IBoolean
  284. ICKeySortedBagImpl <CInherited>::
  285. SetToLast (ICursorImpl& cursor) const
  286. { ICHECK_IsFor (ClassName (), "SetToLast")
  287.  
  288.   return CInherited::SetToLast (cursor);
  289. }
  290.  
  291. template <class CInherited>
  292. IBoolean
  293. ICKeySortedBagImpl <CInherited>::
  294. SetToNext (ICursorImpl& cursor) const
  295. { ICHECK_IsFor   (ClassName (), "SetToNext")
  296.   ICHECK_IsValid (ClassName (), "SetToNext")
  297. #if defined (IALL_CHECKS)
  298.   ICHECK_Cursor  (ClassName (), "SetToNext")
  299. #endif
  300.  
  301.   return CInherited::SetToNext (cursor);
  302. }
  303.  
  304. template <class CInherited>
  305. IBoolean
  306. ICKeySortedBagImpl <CInherited>::
  307. SetToNextWithDifferentKey (ICursorImpl& cursor) const
  308. { ICHECK_IsFor        (ClassName (), "SetToNextWithDifferentKey")
  309.   ICHECK_IsValid      (ClassName (), "SetToNextWithDifferentKey")
  310. #if defined (IALL_CHECKS)
  311.   ICHECK_Cursor       (ClassName (), "SetToNextWithDifferentKey")
  312. #endif
  313.  
  314.   return CInherited::SetToNextWithDifferentKey (cursor);
  315. }
  316.  
  317. template <class CInherited>
  318. void
  319. ICKeySortedBagImpl <CInherited>::
  320. SetToPosition (IPosition position, ICursorImpl& cursor) const
  321. { ICHECK_IsFor     (ClassName (), "SetToPosition")
  322.   ICHECK_Position  (ClassName (), "SetToPosition")
  323.  
  324.   CInherited::SetToPosition (position, cursor);
  325. }
  326.  
  327. template <class CInherited>
  328. IBoolean
  329. ICKeySortedBagImpl <CInherited>::
  330. SetToPrevious (ICursorImpl& cursor) const
  331. { ICHECK_IsFor   (ClassName (), "SetToPrevious")
  332.   ICHECK_IsValid (ClassName (), "SetToPrevious")
  333. #if defined (IALL_CHECKS)
  334.   ICHECK_Cursor  (ClassName (), "SetToPrevious")
  335. #endif
  336.  
  337.   return CInherited::SetToPrevious (cursor);
  338. }
  339.  
  340. #pragma info (restore)
  341. #pragma pack ()
  342.