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.

77 lines
2.3 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. /* ------------------------------------------------------------------------*/
  12. /* */
  13. /* class TPWrittenObjects */
  14. /* */
  15. /* Maintains a database of all objects that have been written to the */
  16. /* current object stream. */
  17. /* */
  18. /* Used by opstream when it writes a pointer onto a stream to determine */
  19. /* whether the object pointed to has already been written to the stream. */
  20. /* */
  21. /* ------------------------------------------------------------------------*/
  22. #if defined( Uses_TPWrittenObjects ) && !defined( __TPWrittenObjects )
  23. #define __TPWrittenObjects
  24. class TPWrittenObjects : public TNSSortedCollection
  25. {
  26. friend class opstream;
  27. public:
  28. void removeAll() { curId = 0; TNSSortedCollection::removeAll(); }
  29. private:
  30. TPWrittenObjects();
  31. ~TPWrittenObjects();
  32. void registerObject( const void *adr );
  33. P_id_type find( const void *adr );
  34. void *keyOf( void * );
  35. int compare( void *, void * );
  36. void freeItem( void *item ); // Note: Just to use delete instead of delete[]
  37. P_id_type curId;
  38. };
  39. /* ------------------------------------------------------------------------*/
  40. /* */
  41. /* class TPWObj */
  42. /* */
  43. /* Used internally by TPWrittenObjects. */
  44. /* */
  45. /* ------------------------------------------------------------------------*/
  46. class TPWObj
  47. {
  48. friend class TPWrittenObjects;
  49. private:
  50. TPWObj( const void *adr, P_id_type id );
  51. const void *address;
  52. P_id_type ident;
  53. };
  54. #endif // Uses_TPWrittenObjects