ReferenceCounter.h 451 B

12345678910111213141516171819202122232425
  1. #pragma once
  2. #include "Betriebssystem.h"
  3. namespace Framework
  4. {
  5. class ReferenceCounter
  6. {
  7. private:
  8. int ref;
  9. public:
  10. DLLEXPORT ReferenceCounter();
  11. DLLEXPORT virtual ~ReferenceCounter();
  12. DLLEXPORT ReferenceCounter *getThis();
  13. DLLEXPORT ReferenceCounter *release();
  14. template<typename T>
  15. inline T *as() const
  16. {
  17. return dynamic_cast<T>( this )
  18. }
  19. };
  20. }