/src/wrappers/common/library/reference_counted.e

http://github.com/tybor/Liberty · Specman e · 48 lines · 35 code · 8 blank · 5 comment · 2 complexity · 8e5e7d6a6abcd811cfa5800e9c507d75 MD5 · raw file

  1. note
  2. copyright:
  3. "[
  4. Copyright (C) 2008-2017: Paolo Redaelli
  5. This library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public License
  7. as published by the Free Software Foundation; either version 2.1 of
  8. the License, or (at your option) any later version.
  9. This library is distributed in the hope that it will be useful, but
  10. WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public
  14. License along with this library; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  16. 02110-1301 USA
  17. ]"
  18. deferred class REFERENCE_COUNTED
  19. -- A wrapper for a C object whose memory is handled throught
  20. -- reference counting, i.e. GObject
  21. inherit
  22. WRAPPER
  23. undefine from_external_pointer
  24. end
  25. feature {WRAPPER, WRAPPER_HANDLER}
  26. ref
  27. -- Increase the reference count
  28. deferred
  29. end
  30. unref
  31. -- Decrease the reference count
  32. deferred
  33. end
  34. dispose
  35. --
  36. do
  37. unref
  38. handle := default_pointer
  39. end
  40. end -- class REFERENCE_COUNTED