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