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.

45 lines
909 B

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_TNSSortedCollection ) && !defined( __TNSSortedCollection )
  12. #define __TNSSortedCollection
  13. class TNSSortedCollection: public virtual TNSCollection
  14. {
  15. public:
  16. TNSSortedCollection( ccIndex aLimit, ccIndex aDelta) :
  17. TNSCollection( aLimit, aDelta ), duplicates(False)
  18. { delta = aDelta; setLimit( aLimit ); }
  19. virtual Boolean search( void *key, ccIndex& index );
  20. virtual ccIndex indexOf( void *item );
  21. virtual ccIndex insert( void *item );
  22. Boolean duplicates;
  23. virtual void *keyOf( void *item );
  24. protected:
  25. TNSSortedCollection() : duplicates(False) {}
  26. private:
  27. virtual int compare( void *key1, void *key2 ) = 0;
  28. };
  29. #endif // Uses_TNSSortedCollection