/src/wrappers/common/library/global_cache.e

http://github.com/tybor/Liberty · Specman e · 43 lines · 30 code · 6 blank · 7 comment · 2 complexity · 4e0577b62984795363687693923c2249 MD5 · raw file

  1. note
  2. description:
  3. "."
  4. copyright:
  5. "[
  6. Copyright (C) 2008-2017: Paolo Redaelli
  7. This library is free software; you can redistribute it and/or
  8. modify it under the terms of the GNU Lesser General Public License
  9. as published by the Free Software Foundation; either version 2.1 of
  10. the License, or (at your option) any later version.
  11. This library is distributed in the hope that it will be useful, but
  12. WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. Lesser General Public License for more details.
  15. You should have received a copy of the GNU Lesser General Public
  16. License along with this library; if not, write to the Free Software
  17. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  18. 02110-1301 USA
  19. ]"
  20. deferred class GLOBAL_CACHE
  21. -- GLOBAL_CACHE gives access to the shared cache of GLOBALLY_CACHED
  22. -- wrappers.
  23. insert
  24. ANY
  25. undefine copy, is_equal, fill_tagged_out_memory
  26. end
  27. feature {WRAPPER, WRAPPER_HANDLER} -- Implementation
  28. wrappers: HASHED_DICTIONARY[GLOBALLY_CACHED, POINTER]
  29. -- Dictionary storing GLOBALLY_CACHED wrappers created in the program. Key
  30. -- is the address (pointer) to the wrapped C structure, value
  31. -- is the corresponding Eiffel wrapper. This way you can get
  32. -- back an already-created Eiffel wrapper.
  33. --
  34. once
  35. create {HASHED_DICTIONARY[GLOBALLY_CACHED, POINTER]} Result.make
  36. end
  37. end -- class GLOBAL_CACHE