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

  1. //#  @(#) 2.12 src/somuc/tset.idl, somuc, som2.1 12/26/95 15:41:09 [7/30/96 14:50:10]
  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_TSet
  18.  *
  19.  * DESCRIPTION: The somf_TSet class is a subclass of somf_TCollection.  It
  20.  *              represents an unordered collection of objects in which objects
  21.  *              can appear only once.  Objects which are inserted into the
  22.  *              somf_TSet should override the Hash() method and the IsSame() or
  23.  *              IsEqual() method.
  24.  *
  25.  */
  26.  
  27. // This file was generated by the SOM Compiler.
  28. // FileName: TSet.id2.
  29. // Generated using:
  30. //     SOM Precompiler spc: 6.13
  31. //     SOM Emitter emitidl.dll: 6.18
  32. #ifndef TSet_idl
  33. #define TSet_idl
  34.  
  35. #include "tcollect.idl"
  36.  
  37. interface TSAssoc;
  38.  
  39. interface somf_TSet : somf_TCollection
  40. {
  41.  
  42.   enum  ESetClassification { kUnchecked, kNormal, kFast };
  43.  
  44.   //#   friend class TSetIterator;
  45.  
  46.   somf_TSet somfTSetInitFL(in somf_MCollectible::somf_MCollectibleCompareFn testfn,
  47.             in long setSizeHint);
  48.  
  49.   // Initializes the new set.
  50.   //#   TSet(MCollectibleCompareFn testfn, long setSizeHint=kCollectionSizeHint);
  51.  
  52.   somf_TSet somfTSetInitF(in somf_MCollectible::somf_MCollectibleCompareFn testfn);
  53.  
  54.   // Initializes the new set.
  55.   //#   TSet(MCollectibleCompareFn testfn, long setSizeHint=kCollectionSizeHint);
  56.  
  57.   somf_TSet somfTSetInitLF(in long setSizeHint,
  58.             in somf_MCollectible::somf_MCollectibleCompareFn testfn);
  59.  
  60.   // Initializes the new set.
  61.   //#   TSet(MCollectibleCompareFn testfn, long setSizeHint=kCollectionSizeHint);
  62.  
  63.   somf_TSet somfTSetInitL(in long setSizeHint);
  64.  
  65.   // Initializes the new set.
  66.   //#   TSet(MCollectibleCompareFn testfn, long setSizeHint=kCollectionSizeHint);
  67.  
  68.   somf_TSet somfTSetInitS(in somf_TSet s);
  69.  
  70.   // Initializes the new set.
  71.   //#   TSet(const TSet& s);
  72.  
  73.   void somfAssign(in somf_TSet source);
  74.  
  75.   // Assign the instance of this equal to the instance of source.
  76.   //#   const TSet&     operator=(const TSet&);
  77.  
  78.   void somfDifferenceS(in somf_TSet set1);
  79.  
  80.   // Destructively modify this to contain a set of elements of this that do not
  81.   // appear in set1
  82.   //#   virtual void     Difference(const TSet& set1);
  83.  
  84.   void somfDifferenceSS(in somf_TSet set1,
  85.                in somf_TSet resultSet);
  86.  
  87.   // After this function is called, resultSet will contain a set of elements of
  88.   // this that do not appear in set1
  89.   //#   virtual void     Difference(const TSet& set1, TSet& resultSet) const;
  90.  
  91.   void somfIntersectionS(in somf_TSet set1);
  92.  
  93.   // Destructively modify this to contain everything that is an element of set1
  94.   // and this.
  95.   //#   virtual void     Intersection(const TSet& set1);
  96.  
  97.   void somfIntersectionSS(in somf_TSet set1,
  98.              in somf_TSet resultSet);
  99.  
  100.   // After this function is called, resultSet will contain everything that is an
  101.   // element of set1 and this.
  102.   //#   virtual void     Intersection(const TSet& set1, TSet& resultSet) const;
  103.  
  104.   void somfUnionS(in somf_TSet set1);
  105.  
  106.   // Destructively modify this to contain everything that is an element of either
  107.   // set1 or this.
  108.   //#   virtual void     Union(const TSet& set1);
  109.  
  110.   void somfUnionSS(in somf_TSet set1,
  111.           in somf_TSet resultSet);
  112.  
  113.   // After this function is called, resultSet will contain everything that is an
  114.   // element of either set1 or this.
  115.   //#   virtual void     Union(const TSet& set1, TSet& resultSet) const;
  116.  
  117.   void somfXorS(in somf_TSet set1);
  118.  
  119.   // Destructively modify this to contain everything that is an element of either
  120.   // set1 or this, but not both.
  121.   //#   virtual void     Xor(const TSet& set1);
  122.  
  123.   void somfXorSS(in somf_TSet set1,
  124.         in somf_TSet resultSet);
  125.  
  126.   // After this function is called, resultSet will contain everything that is an
  127.   // element of either set1 or this, but not both.
  128.   //#   virtual void     Xor(const TSet&  set1, TSet& resultSet) const;
  129.  
  130.   void somfSetHashFunction(in somf_MCollectible::somf_MCollectibleHashFn fn);
  131.  
  132.   // Set the hash function to fn.
  133.   //#   virtual void      SetHashFunction(MCollectibleHashFn);
  134.  
  135.   somf_MCollectible::somf_MCollectibleHashFn somfGetHashFunction();
  136.  
  137.   // Return the hash function.
  138.   //#   virtual MCollectibleHashFn  GetHashFunction() const;
  139.  
  140.   void somfRehash();
  141.  
  142.   // Rehash the set, cleaning up for any entries marked for deletion.
  143.   //#     void      Rehash();
  144.  
  145.   //#   override StreamOut;
  146.   //# // Stream stuff
  147.   //# //   virtual TStream&   operator>>=(TStream& towhere) const;
  148.   //#
  149.   //#   override StreamIn;
  150.   //# // Stream stuff
  151.   //# //   virtual TStream&   operator<<=(TStream& towhere);
  152.  
  153.  
  154.  
  155.  
  156. #ifdef __SOMIDL__
  157.   implementation {
  158.  
  159.     releaseorder: somfDifferenceS,somfDifferenceSS,
  160.           somfIntersectionS,somfIntersectionSS,somfUnionS,somfUnionSS,
  161.           somfXorS,somfXorSS,somfSetHashFunction,
  162.           somfGetHashFunction,somfRehash,somfFind,somfMakeNewTable,
  163.           somfCopyIn,somfGrow,somfAssign,somfTSetInitFL,somfTSetInitF,
  164.           somfTSetInitLF,somfTSetInitL,somfTSetInitS;
  165.  
  166.     //# Class Modifiers
  167.     majorversion = 2;
  168.     minorversion = 1;
  169.     filestem = tset;
  170.     dllname = "somuc.dll";
  171.  
  172.  
  173.     passthru C_xh_after =  ""
  174. ""
  175. "#include <titeratr.xh>"
  176. "#include <mcollect.xh>";
  177.  
  178.     passthru C_h_after =  ""
  179. ""
  180. "#include <titeratr.h>"
  181. "#include <mcollect.h>";
  182.  
  183.     //# Internal Instance Variables
  184.     long fTableSize;              // Actual size of the table
  185.     long fSize;                   // Number of entries in the table
  186.     long fNextRehash;
  187.     TSAssoc fTable;
  188.     somf_MCollectible::somf_MCollectibleHashFn fHashfn;
  189.     unsigned long fSeed;          // Count of operations on the Set.  Used by Iterator
  190.     ESetClassification fFast;
  191.     somf_MCollectible fCache;       // Single entry, if table not created yet
  192.  
  193.     //# Method Modifiers
  194.     somInit: override;
  195.     somUninit: override;
  196.     somfAdd: override;
  197.     somfRemove: override;
  198.     somfRemoveAll: override;
  199.     somfDeleteAll: override;
  200.     somfCount: override;
  201.     somfIntersectionSS: nomodify;
  202.     somfUnionSS: nomodify;
  203.     somfXorSS: nomodify;
  204.     somfMember: override,nomodify;
  205.     somfCreateIterator: override, nomodify;
  206.     somfGetHashFunction: nomodify;
  207.     somfRehash: nooverride;
  208.     somfTSetInitFL: nooverride;
  209.     somfTSetInitF: nooverride;
  210.     somfTSetInitLF: nooverride;
  211.     somfTSetInitL: nooverride;
  212.     somfTSetInitS: nooverride;
  213.  
  214.  
  215.     //# Data Modifiers
  216.  
  217.  
  218.   };
  219. #endif /* __SOMIDL__ */
  220. };
  221.  
  222. #endif  /* TSet_idl */
  223.