home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / source / bento / headers / typeset.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-02  |  2.2 KB  |  86 lines

  1. /*
  2.     File:        TypeSet.h
  3.  
  4.     Contains:    Class definition for TypeSet.
  5.  
  6.     Written by:    Vincent Lo
  7.  
  8.     Copyright:    ⌐ 1993 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <4>     2/15/94    CG        #1143680 - changed fSet from a LinkList* to
  13.                                     an OrderedCollection* which can be
  14.                                     allocated on a specified heap.
  15.          <3>     2/15/94    CC        Bug #1142945 - Standardize method names.
  16.          <2>      2/9/94    Té        made destructor explicitly virtual to
  17.                                     pacify ASLM
  18.          <1>      2/4/94    VL        first checked in
  19.  
  20.     To Do:
  21.  
  22. */
  23.  
  24. #ifndef _TYPESET_
  25. #define _TYPESET_
  26.  
  27. #ifndef _XMPTYPES_
  28. #include "XMPTypes.h"
  29. #endif
  30.  
  31. //=====================================================================================
  32. // Classes defined in this interface
  33. //=====================================================================================
  34. class XMPTypeSet;
  35.  
  36. //=====================================================================================
  37. // Classes used by this interface
  38. //=====================================================================================
  39. //class LinkedList;
  40. class OrderedCollection;
  41.  
  42. //=====================================================================================
  43. // Class XMPTypeSet
  44. //=====================================================================================
  45.  
  46. #define kXMPTypeSetID "appl:xmptypeset$class,1.0.0"
  47.  
  48. class XMPTypeSet
  49. {
  50.     friend class     XMPTypeSetIterator;
  51.  
  52. public:
  53.  
  54.     XMPTypeSet();
  55.     XMPTypeSet(XMPHeap where);
  56.     
  57.     virtual ~XMPTypeSet();
  58.     
  59.     XMPMethod void Add(XMPType type);
  60.     
  61.         // Adds a type to the end of the set, creating a copy of the argument in the set.
  62.  
  63.     XMPMethod void Remove(XMPType type);
  64.     
  65.         // Removes a type from a set.  Does nothing if the argument type is not present.
  66.     
  67.     XMPMethod XMPBoolean Contains(XMPType type);
  68.     
  69.         // Returns true if the set contains the specified type.
  70.         // Otherwise, returns false.
  71.  
  72.     XMPMethod XMPULong Count();
  73.         
  74.     XMPVMethod XMPTypeSetIterator* CreateTypeSetIterator();
  75.     
  76.         // Returns an iterator for the set, which can be used to retrieve types
  77.         // from the set in order.
  78.  
  79. private:
  80.  
  81.     OrderedCollection*    fSet;    
  82.     XMPHeap         fHeap;
  83. };
  84.  
  85. #endif    // _TYPESET_
  86.