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

  1. //#  @(#) 2.12 src/somuc/tss.idl, somuc, som2.1 12/26/95 15:41:32 [7/30/96 14:50:11]
  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_TSortedSequence
  18.  *
  19.  * DESCRIPTION: A TSortedSequence is a TSequence.  It is ordered based on
  20.  *              how the elements in the collections relate to each other.
  21.  *              Any element in the TSortedSequence is Less Than or Equal to
  22.  *              the element in front of it, and Greater Than or Equal to
  23.  *              the element behind it.
  24.  *
  25.  */
  26.  
  27. #ifndef TSS_idl
  28. #define TSS_idl
  29.  
  30. #include <tseq.idl>
  31. #include <morder.idl>
  32. /* interface somf_MCollectible; */
  33. interface somf_TSortedSequenceNode;
  34. interface somf_TSequenceIterator;
  35.  
  36. interface somf_TSortedSequence : somf_TSequence
  37. {
  38.  
  39.   //#   friend class TSortedSequenceIterator;
  40.  
  41.   //# The following method is overridden below:
  42.   //#   TSortedSequence();
  43.  
  44.   somf_TSortedSequence somfTSortedSequenceInitF(in somf_MOrderableCollectible::somf_MBetterOrderableCompareFn testfn);
  45.   // Initialize the new TSortedSequence
  46.   //#   TSortedSequence(MBetterOrderableCompareFn testfn);
  47.  
  48.   somf_TSortedSequence somfTSortedSequenceInitS(in somf_TSortedSequence s);
  49.   // Initialize the new TSortedSequence
  50.   //#   TSortedSequence(const TSortedSequence&);
  51.  
  52.   //# The following method is overridden below:
  53.   //#   virtual ~TSortedSequence();
  54.  
  55.   void somfAssign(in somf_TSortedSequence s);
  56.   // Assign the instance of this equal to the instance of source.
  57.   //#   const TSortedSequence&          operator=(const TSortedSequence&);
  58.  
  59.   //# The following methods are overridden below:
  60.   //#   virtual MCollectible*           Add(MCollectible* obj);
  61.   //#   virtual MCollectible*           After(const MCollectible& obj) const;
  62.   //#   virtual MCollectible*           Before(const MCollectible& obj) const;
  63.   //#   virtual MCollectible*           Last() const;
  64.   //#   virtual MCollectible*           First() const;
  65.   //#   virtual long OccurrencesOf(const MCollectible& obj) const;
  66.  
  67.   //# The following methods are overridden below:
  68.   //#   virtual MCollectible*           Remove(const MCollectible& obj);
  69.   //#   virtual void                    RemoveAll();
  70.   //#   virtual void                    DeleteAll();
  71.   //#   virtual long                    Count() const;
  72.   //#   virtual MCollectible*           Member(const MCollectible& obj) const;
  73.   //#   virtual TIterator*              CreateIterator() const;
  74.  
  75.   somf_TSequenceIterator  somfCreateSequenceIterator();
  76.   // This method returns a new iterator which is suitable for use in iterating
  77.   // over the objects in this collection.
  78.   //#   virtual TSequenceIterator*      CreateSequenceIterator() const;
  79.  
  80.   //# The following operators are not ported until Streaming is ported.
  81.   //#   virtual TStream& operator>>=(TStream& towhere) const;
  82.   //#   virtual TStream& operator<<=(TStream& towhere);
  83.  
  84.   //# Temporary stuff which may go away when we have hoops
  85.   //#   virtual void  PrintDebugInfo(Boolean verbose = FALSE) const;
  86.  
  87.   //#override somfClone;
  88.   //# There is no point in overriding somfClone, the code was fixed so it works
  89.   //# correctly.
  90.   //#   MCollectibleDeclarationsMacro(TSortedSequence);
  91.  
  92.   somf_MOrderableCollectible::somf_MBetterOrderableCompareFn  somfGetSequencingFunction();
  93.   // Return a pointer to the function used to compare elements in the
  94.   // collection, and consequently determines the sequence of the collection.
  95.   //#   MBetterOrderableCompareFn       GetSequencingFunction() const;
  96.  
  97.   void somfSetSequencingFunction(in somf_MOrderableCollectible::somf_MBetterOrderableCompareFn fn);
  98.   // Sets the pointer to the function used to compare elements in the
  99.   // collection, and consequently determines the sequence of the collection.
  100.   //#   void SetSequencingFunction(MBetterOrderableCompareFn);
  101.  
  102.   somf_TSortedSequenceNode somfCreateSortedSequenceNode(in somf_TSortedSequenceNode n1,
  103.                        in somf_MOrderableCollectible obj,
  104.                        in somf_TSortedSequenceNode n2);
  105.   // Create a new TSortedSequenceNode in the TSortedSequence.
  106.   //#  protected:
  107.   //#     virtual TSortedSequenceNode* CreateSortedSequenceNode(TSortedSequenceNode* n1 = SOMF_NIL, MOrderableCollectible* obj=SOMF_NIL, TSortedSequenceNode* n2=SOMF_NIL);
  108.  
  109.  
  110.  
  111. #ifdef __SOMIDL__
  112.   implementation {
  113.  
  114.     releaseorder: somfCreateSequenceIterator, somfGetSequencingFunction,
  115.           somfSetSequencingFunction, somfCreateSortedSequenceNode,
  116.           somfRotate, somfSplit, somfBalance,
  117.           somfInternalRemoveAll, somfInternalDeleteAll,
  118.           somfAssign, somfTSortedSequenceInitF,
  119.           somfTSortedSequenceInitS;
  120.  
  121.  
  122.     //# Class Modifiers
  123.     majorversion = 2;
  124.     minorversion = 1;
  125.     filestem = tss;
  126.     dllname = "somuc.dll";
  127.  
  128.  
  129.     passthru C_xh_after =  ""
  130. "#include <mcollect.xh>"
  131. "#include <morder.xh>"
  132. "#include <tssnode.xh>";
  133.  
  134.     passthru C_h_after =  ""
  135. "#include <mcollect.h>"
  136. "#include <morder.h>"
  137. "#include <tssnode.h>";
  138.  
  139.     //# Internal Instance Variables
  140.     unsigned long                 fSeed;
  141.     somf_TSortedSequenceNode        fSuperRoot;
  142.     somf_TSortedSequenceNode        fNilNode;
  143.     long                          fCount;
  144.     somf_MOrderableCollectible::somf_MBetterOrderableCompareFn fSequencingFunction;
  145.  
  146.     //# Method Modifiers
  147.     somInit: override;
  148.     somUninit: override;
  149.     somfAdd: override;
  150.     somfRemove: override;
  151.     somfDeleteAll: override;
  152.     somfRemoveAll: override;
  153.     somfCount: override;
  154.     somfAfter: override;
  155.     somfBefore: override;
  156.     somfLast: override;
  157.     somfFirst: override;
  158.     somfMember: override;
  159.     somfCreateIterator: override;
  160.     somfOccurrencesOf: override;
  161.     somfTSortedSequenceInitF : nomodify, nooverride;
  162.     somfTSortedSequenceInitS : nomodify, nooverride;
  163.     somfAssign : nomodify;
  164.     somfGetSequencingFunction : nomodify;
  165.     somfSetSequencingFunction : nomodify;
  166.     somfRotate : nomodify;
  167.     somfSplit : nomodify;
  168.     somfBalance : nomodify;
  169.     somfInternalRemoveAll : nomodify;
  170.     somfInternalDeleteAll : nomodify;
  171.  
  172.     //# Data Modifiers
  173.  
  174.   };
  175. #endif /* __SOMIDL__ */
  176. };
  177.  
  178. #endif  /* TSS_idl */
  179.