home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / OTHERUTI / TCPP30-1.ZIP / CLASSINC.ZIP / SET.H < prev    next >
C/C++ Source or Header  |  1992-02-18  |  2KB  |  86 lines

  1. /*------------------------------------------------------------------------*/
  2. /*                                                                        */
  3. /*  SET.H                                                                 */
  4. /*                                                                        */
  5. /*  Copyright Borland International 1991                                  */
  6. /*  All Rights Reserved                                                   */
  7. /*                                                                        */
  8. /*------------------------------------------------------------------------*/
  9.  
  10. #if !defined( __SET_H )
  11. #define __SET_H
  12.  
  13. #if defined( TEMPLATES )
  14.  
  15.     #if !defined( __SETS_H )
  16.     #include <Sets.h>
  17.     #endif  // __SETS_H
  18.  
  19.     #define Set   BI_TCSetAsVector
  20.     #define PSet  PBI_TCSetAsVector
  21.     #define RSet  RBI_TCSetAsVector
  22.     #define RPSet RPBI_TCSetAsVector
  23.     #define PCSet PCBI_TCSetAsVector
  24.     #define RCSet RCBI_TCSetAsVector
  25.  
  26.     _CLASSDEF( BI_TCSetAsVector )
  27.  
  28.     #define SetIterator   BI_TCSetAsVectorIterator
  29.     #define PSetIterator  PBI_TCSetAsVectorIterator
  30.     #define RSetIterator  RBI_TCSetAsVectorIterator
  31.     #define RPSetIterator RPBI_TCSetAsVectorIterator
  32.     #define PCSetIterator PCBI_TCSetAsVectorIterator
  33.     #define RCSetIterator RCBI_TCSetAsVectorIterator
  34.  
  35.     _CLASSDEF( BI_TCSetAsVectorIterator )
  36.  
  37. #else   // TEMPLATES
  38.  
  39.     #if !defined( __RESOURCE_H )
  40.     #include <Resource.h>
  41.     #endif  // __RESOURCE_H
  42.  
  43.     #if !defined( __CLSTYPES_H )
  44.     #include <ClsTypes.h>
  45.     #endif  // __CLSTYPES_H
  46.  
  47.     #if !defined( __BAG_H )
  48.     #include <Bag.h>
  49.     #endif  // __BAG_H
  50.  
  51.     _CLASSDEF(Set)
  52.  
  53.     class _CLASSTYPE Set : public Bag
  54.     {
  55.  
  56.     public:
  57.  
  58.         Set( sizeType setSize = DEFAULT_SET_SIZE ) :
  59.             Bag( setSize )
  60.             {
  61.             }
  62.  
  63.         virtual void add( Object _FAR & toAdd )
  64.             {
  65.             if( !(Bag::hasMember( toAdd )) )
  66.                 {
  67.                 Bag::add( toAdd );
  68.                 }
  69.             }
  70.         virtual classType isA() const
  71.             {
  72.             return setClass;
  73.             }
  74.  
  75.         virtual char _FAR *nameOf() const
  76.             {
  77.             return "Set";
  78.             }
  79.  
  80.     };
  81.  
  82. #endif  // TEMPLATES
  83.  
  84. #endif  // __SET_H
  85.  
  86.