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