home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / som / include / tdeq.idl < prev    next >
Text File  |  1999-02-22  |  7KB  |  227 lines

  1. //#  @(#) 2.12 src/somuc/tdeq.idl, somuc, som2.1 12/26/95 15:35:48 [7/30/96 14:50:03]
  2. //
  3. //   COMPONENT_NAME: somuc
  4. //
  5. //   ORIGINS: 82, 81, 27
  6. //
  7. //
  8. //    25H7912  (C)  COPYRIGHT International Business Machines Corp. 1992,1996,1996  
  9. //   All Rights Reserved
  10. //   Licensed Materials - Property of IBM
  11. //   US Government Users Restricted Rights - Use, duplication or
  12. //   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  13. //
  14. //   Copyright ⌐ 1988, 1989 Apple Computer, Inc. All rights reserved.
  15.  
  16. /*
  17.  * CLASS_NAME: somf_TDeque
  18.  *
  19.  * DESCRIPTION: A TDeque is a TSequence.  It is ordered based on the order
  20.  *              elements are added to, or removed from, the collection.
  21.  *              A TDeque can also be used as a queue, or a stack.
  22.  *
  23.  */
  24.  
  25. #ifndef TDeq_idl
  26. #define TDeq_idl
  27.  
  28. #include <tseq.idl>
  29.  
  30. /* interface somf_MCollectible; */
  31. interface somf_TSequenceIterator;
  32. interface somf_TDequeLinkable;
  33. interface somf_TPrimitiveLinkedList;
  34.  
  35. interface somf_TDeque : somf_TSequence
  36. {
  37.   //# friend class TDequeIterator;
  38.   //# friend class TDequeCursor;
  39.  
  40.   somf_TDeque somfTDequeInitF(in somf_MCollectible::somf_MCollectibleCompareFn testfn);
  41.   // Initializes the new deque.
  42.   //# TDeque(MCollectibleCompareFn testfn);
  43.  
  44.  
  45.   somf_TDeque somfTDequeInitD(in somf_TDeque s);
  46.   // Initializes the new deque.
  47.   //# TDeque(const TDeque&);
  48.  
  49.  
  50.   //# The following method is overridden below:
  51.   //# virtual ~TDeque();
  52.  
  53.  
  54.   void somfAssign(in somf_TDeque s);
  55.   // Assign the instance of this equal to the instance of source.
  56.   //# const TDeque& operator=(const TDeque&);
  57.  
  58.  
  59.   //# The following methods are overridden below:
  60.   //# virtual MCollectible* Add(MCollectible* obj);
  61.   //# virtual MCollectible* Remove(const MCollectible& obj);
  62.   //# virtual void DeleteAll();
  63.   //# virtual void RemoveAll();
  64.   //# virtual long Count() const;
  65.   //# virtual MCollectible* After(const MCollectible& obj) const;
  66.   //# virtual MCollectible* Before(const MCollectible& obj) const;
  67.  
  68.  
  69.   void somfAddAfter(in somf_MCollectible existingobj,
  70.            in somf_MCollectible tobeadded);
  71.   // Add the obj object into the List after the existing object.
  72.   //# virtual void AddAfter(const MCollectible& existingobj,
  73.   //#                       MCollectible* tobeadded);
  74.  
  75.  
  76.   void somfAddBefore(in somf_MCollectible existingobj,
  77.             in somf_MCollectible tobeadded);
  78.   // Add the obj object into the List before the existing object.
  79.   //# virtual void AddBefore(const MCollectible& existingobj,
  80.   //#                        MCollectible* tobeadded);
  81.  
  82.  
  83.   void somfAddLast(in somf_MCollectible obj);
  84.   // Add the obj object as the last object in the List.
  85.   //# virtual void AddLast(MCollectible* obj);
  86.  
  87.  
  88.   void somfAddFirst(in somf_MCollectible obj);
  89.   // Add the obj object as the first object in the List.
  90.   //# virtual void AddFirst(MCollectible* obj);
  91.  
  92.  
  93.   //# The following methods are overridden below:
  94.   //# virtual MCollectible* Last() const;
  95.   //# virtual MCollectible* First() const;
  96.  
  97.  
  98.   somf_MCollectible somfRemoveLast();
  99.   // Remove the last object in the List.
  100.   //# virtual MCollectible* RemoveLast();
  101.  
  102.  
  103.   somf_MCollectible somfRemoveFirst();
  104.   // Remove the first object in the deque.
  105.   //# virtual MCollectible* RemoveFirst();
  106.  
  107.  
  108.   //# The following methods are overridden below:
  109.   //# virtual MCollectible* Member(const MCollectible& obj) const;
  110.   //# virtual TIterator* CreateIterator() const;
  111.  
  112.  
  113.   somf_TSequenceIterator somfCreateSequenceIterator();
  114.   // This method returns a new iterator which is suitable for use in iterating
  115.   // over the objects in this collection.
  116.   //# virtual TSequenceIterator* CreateSequenceIterator() const;
  117.  
  118.  
  119.   //# The following operators are not ported until Streaming is ported.
  120.   //# virtual TStream& operator>>=(TStream& towhere) const;
  121.   //# virtual TStream& operator<<=(TStream& towhere);
  122.  
  123.   //#override somfClone;
  124.   //# There is no point in overriding somfClone, the code was fixed so it works
  125.   //# correctly.
  126.   //# MCollectibleDeclarationsMacro(TDeque);
  127.  
  128.  
  129.   somf_MCollectible  somfRemoveQ();
  130.   // Remove the object on the deque/queue
  131.   // (This call can be used to simulate a queue)
  132.   //# MCollectible*   Remove();
  133.  
  134.  
  135.   void somfInsert(in somf_MCollectible obj);
  136.   // Add the object to the deque/queue
  137.   // (This call can be used to simulate a queue)
  138.   //# void Insert(MCollectible* obj);
  139.  
  140.  
  141.   somf_MCollectible somfPop();
  142.   // Remove the object on the top of the deque/stack
  143.   // (This call can be used to simulate a stack)
  144.   //# MCollectible*   Pop();
  145.  
  146.  
  147.   void somfPush(in somf_MCollectible obj);
  148.   // Add the object to the top of the deque/stack
  149.   // (This call can be used to simulate a stack)
  150.   //# void Push(MCollectible* obj);
  151.  
  152.  
  153.   //# The following methods are not ported since I didn't think they
  154.   //# were for public consumption.
  155.   //#  TPrimitiveLinkedList&   AccessImplementation();
  156.   //#  void Sync();
  157.  
  158.  
  159.   somf_TDequeLinkable somfCreateNewLink(in somf_TDequeLinkable p,
  160.                      in somf_TDequeLinkable n,
  161.                      in somf_MCollectible v);
  162.   // Create a new TDeque link, using a TDequeLinkable instance.
  163.   //# protected:
  164.   //#   virtual TDequeLinkable* CreateNewLink(TDequeLinkable*,
  165.   //#                                         TDequeLinkable*,
  166.   //#                                         MCollectible*) const;
  167.  
  168.  
  169. #ifdef __SOMIDL__
  170.   implementation {
  171.  
  172.     releaseorder: somfAddAfter, somfAddBefore, somfAddLast, somfAddFirst,
  173.           somfRemoveLast, somfRemoveFirst, somfCreateSequenceIterator,
  174.           somfRemoveQ, somfInsert, somfPop, somfPush, somfCreateNewLink,
  175.           somfAssign, somfTDequeInitF, somfTDequeInitD;
  176.  
  177.  
  178.     //# Class Modifiers
  179.     majorversion = 2;
  180.     minorversion = 1;
  181.     filestem = tdeq;
  182.     dllname = "somuc.dll";
  183.  
  184.  
  185.     passthru C_xh_after =  ""
  186. "#include <mcollect.xh>"
  187. "#include <tseqitr.xh>"
  188. "#include <tdeqlink.xh>"
  189. "";
  190.  
  191.     passthru C_h_after =  ""
  192. "#include <mcollect.h>"
  193. "#include <tseqitr.h>"
  194. "#include <tdeqlink.h>"
  195. "";
  196.  
  197.     //# Internal Instance Variables
  198.     somf_TPrimitiveLinkedList fImplementation;
  199.     unsigned long fSeed;
  200.  
  201.     //# Method Modifiers
  202.     somInit: override;
  203.     somUninit: override;
  204.     somfAdd: override;
  205.     somfRemove: override;
  206.     somfDeleteAll: override;
  207.     somfRemoveAll: override;
  208.     somfCount: override;
  209.     somfAfter: override;
  210.     somfBefore: override;
  211.     somfLast: override;
  212.     somfFirst: override;
  213.     somfMember: override;
  214.     somfCreateIterator: override;
  215.     somfCreateSequenceIterator: nomodify;
  216.     somfCreateNewLink: nomodify;
  217.     somfTDequeInitF: nooverride;
  218.     somfTDequeInitD: nooverride;
  219.  
  220.     //# Data Modifiers
  221.  
  222.   };
  223. #endif /* __SOMIDL__ */
  224. };
  225.  
  226. #endif  /* TDeq_idl */
  227.