You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.4 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. * Turbo Vision - Version 2.0
  3. *
  4. * Copyright (c) 1994 by Borland International
  5. * All Rights Reserved.
  6. *
  7. Modified by Robert H�hne to be used for RHIDE.
  8. *
  9. *
  10. */
  11. #if defined( Uses_TSortedCollection ) && !defined( __TSortedCollection )
  12. #define __TSortedCollection
  13. class TSortedCollection : public TNSSortedCollection, public TCollection
  14. {
  15. public:
  16. TSortedCollection( ccIndex aLimit, ccIndex aDelta) :
  17. TCollection( aLimit, aDelta ) {}
  18. private:
  19. virtual int compare( void *key1, void *key2 ) = 0;
  20. #if !defined( NO_STREAM )
  21. virtual const char *streamableName() const
  22. { return name; }
  23. virtual void *readItem( ipstream& ) = 0;
  24. virtual void writeItem( void *, opstream& ) = 0;
  25. protected:
  26. TSortedCollection( StreamableInit );
  27. virtual void *read( ipstream& );
  28. virtual void write( opstream& );
  29. public:
  30. static const char * const name;
  31. #endif // NO_STREAM
  32. };
  33. #if !defined( NO_STREAM )
  34. inline ipstream& operator >> ( ipstream& is, TSortedCollection& cl )
  35. { return is >> (TStreamable&)cl; }
  36. inline ipstream& operator >> ( ipstream& is, TSortedCollection*& cl )
  37. { return is >> (void *&)cl; }
  38. inline opstream& operator << ( opstream& os, TSortedCollection& cl )
  39. { return os << (TStreamable&)cl; }
  40. inline opstream& operator << ( opstream& os, TSortedCollection* cl )
  41. { return os << (TStreamable *)cl; }
  42. #endif // NO_STREAM
  43. #endif // Uses_TSortedCollection