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