idisposable.h 335 B

1234567891011
  1. #ifndef __IDISPOSABLE_H
  2. #define __IDISPOSABLE_H
  3. class idisposable
  4. {
  5. public:
  6. idisposable();
  7. virtual ~idisposable(); // An virtual destructor is how C++ knows how to delete this object.
  8. int usage;
  9. static void dereference(idisposable **object_ptr); // Decrements usage. Calls dispose if usage == 0. Sets *object to nullptr.
  10. };
  11. #endif