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

  1. //#  @(#) 2.10 src/somuc/tcollect.idl, somuc, som2.1 12/26/95 15:34:03 [7/30/96 14:50:00]
  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_TCollection
  18.  *
  19.  * DESCRIPTION: This class represents a group of objects.  It is implemented
  20.  *              as an abstract class from which all collection classes inherit
  21.  *              methods.
  22.  *
  23.  */
  24.  
  25. // This file was generated by the SOM Compiler.
  26. // FileName: TCollect.id2.
  27. // Generated using:
  28. //     SOM Precompiler spc: 6.13
  29. //     SOM Emitter emitidl.dll: 6.18
  30. #ifndef TCollect_idl
  31. #define TCollect_idl
  32.  
  33. #include "mcollect.idl"
  34.  
  35. interface somf_TIterator;
  36.  
  37. interface somf_TCollection : somf_MCollectible
  38. {
  39.  
  40.   const long kCollectionSizeHint = 8;
  41.  
  42.   //# since TCollection has no code in it's destructor, the
  43.   //# following destructor has been commented out.
  44.   //#
  45.   //#   virtual ~TCollection();
  46.  
  47.   somf_MCollectible somfAdd(in somf_MCollectible obj);
  48.  
  49.   // Add obj to this.
  50.   //#   virtual MCollectible* Add(MCollectible* obj) = 0;
  51.  
  52.   void somfAddAll(in somf_TCollection col);
  53.  
  54.   // Add all of the objects in collection to this.  Essentially this is
  55.   // equivalent to getting an iterator for the collection passed in and adding
  56.   // each element in the collection to this.
  57.   //#   virtual void     AddAll(const TCollection* col);
  58.  
  59.   somf_MCollectible somfRemove(in somf_MCollectible obj);
  60.  
  61.   // Remove obj from this.  Return the object which was actually removed
  62.   // (which if you are using an IsEqual test function may not be the same as the
  63.   // object passed in only "equal")
  64.   //#   virtual MCollectible* Remove(const MCollectible& obj) = 0;
  65.  
  66.   void somfRemoveAll();
  67.  
  68.   // Remove all of the objects from this.
  69.   //#   virtual void    RemoveAll() = 0;
  70.  
  71.   void somfDeleteAll();
  72.  
  73.   // Remove all of the objects from this and deallocate the storage that these
  74.   // objects might have owned (that is, the destructor function is called
  75.   // for each object in the collection).
  76.   //#   virtual void    DeleteAll() = 0;
  77.  
  78.   long somfCount();
  79.  
  80.   // Return the number of objects in this.
  81.   //#   virtual long    Count() const = 0;
  82.  
  83.   somf_MCollectible somfMember(in somf_MCollectible obj);
  84.  
  85.   // Each object in this is compared to obj using the function testFn.  Return the
  86.   // object for which testFn returned TRUE.  Return SOMF_NIL if not object was found.
  87.   //#   virtual MCollectible* Member(const MCollectible& obj) const;
  88.  
  89.   somf_TIterator somfCreateIterator();
  90.  
  91.   // This method returns a new iterator which is suitable for use in iterating
  92.   // over the objects in this collection.
  93.   //#   virtual TIterator*  CreateIterator() const = 0;
  94.  
  95.   //#   override StreamOut;
  96.   //# // Stream stuff
  97.   //# //   virtual TStream&   operator>>=(TStream& towhere) const;
  98.   //#
  99.   //#   override StreamIn;
  100.   //# // Stream stuff
  101.   //# //   virtual TStream&   operator<<=(TStream& towhere);
  102.  
  103.   somf_MCollectible::somf_MCollectibleCompareFn somfTestFunction();
  104.  
  105.   // Return the test function.  This is usually either IsSame or IsEqual.
  106.   //# protected:
  107.   //#   MCollectibleCompareFn TestFunction() const;
  108.  
  109.   void somfSetTestFunction(in somf_MCollectible::somf_MCollectibleCompareFn testfn);
  110.  
  111.   // Set the test function.
  112.   //# protected:
  113.   //#   void      SetTestFunction(MCollectibleCompareFn testfn);
  114.  
  115.   somf_TCollection somfTCollectionInit(in somf_MCollectible::somf_MCollectibleCompareFn testfn);
  116.  
  117.   // Initialize the somf_TCollection test function to testfn.
  118.   //# protected:
  119.   //#   TCollection(MCollectibleCompareFn testfn);
  120.  
  121.  
  122. #ifdef __SOMIDL__
  123.   implementation {
  124.     releaseorder: somfAdd,somfAddAll,somfRemove,somfRemoveAll,somfDeleteAll,
  125.           somfCount,somfMember,somfCreateIterator,somfTestFunction,
  126.           somfSetTestFunction,somfTCollectionInit;
  127.  
  128.     //# Class Modifiers
  129.     majorversion = 2;
  130.     minorversion = 1;
  131.     filestem = tcollect;
  132.     dllname = "somuc.dll";
  133.  
  134.  
  135.     passthru C_xh_after =  ""
  136. "class somf_TCollection;"
  137. "#include <titeratr.xh>";
  138.  
  139.     passthru C_h_after =  ""
  140. "#include <titeratr.h>";
  141.  
  142.     //# Internal Instance Variables
  143.     somf_MCollectible::somf_MCollectibleCompareFn fTestfn;
  144.  
  145.     //# Method Modifiers
  146.     somfCount: nomodify;
  147.     somfMember: nomodify;
  148.     somfCreateIterator: nomodify;
  149.     somfIsEqual: override;
  150.     somfTestFunction: nomodify;
  151.     somfTCollectionInit: nooverride;
  152.  
  153.     //# Data Modifiers
  154.  
  155.   };
  156. #endif /* __SOMIDL__ */
  157. };
  158.  
  159. #endif  /* TCollect_idl */
  160.