/src/wrappers/common/library/wrapper_dictionary.e

http://github.com/tybor/Liberty · Specman e · 56 lines · 39 code · 9 blank · 8 comment · 2 complexity · 03801687fa096d53202108450fd15f24 MD5 · raw file

  1. note
  2. description:
  3. "A wrapper that is a dictionary of other wrappers."
  4. copyright:
  5. "[
  6. Copyright (C) 2007-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. license:
  21. "LGPL v2 or later"
  22. deferred class WRAPPER_DICTIONARY[VALUE_ -> WRAPPER, KEY_ -> COMPARABLE_WRAPPER]
  23. -- A wrapper that is a collection of other wrappers.
  24. -- Contains the shared logic used in Glib G_SLIST, G_HASH_TABLE
  25. -- and so on.
  26. inherit
  27. DICTIONARY[VALUE_, KEY_]
  28. WRAPPER
  29. undefine fill_tagged_out_memory, out_in_tagged_out_memory
  30. end
  31. feature {WRAPPER, WRAPPER_HANDLER} -- Implementation
  32. are_items_shared: BOOLEAN
  33. -- Are the items contained in Currect DICTIONARY shared? If
  34. -- an item is not shared the underlying C structure will be
  35. -- freed once the Eiffel object is disposed.
  36. set_shared_items (a_setting: BOOLEAN)
  37. do
  38. are_items_shared := a_setting
  39. ensure
  40. set: are_items_shared = a_setting
  41. end
  42. factory: WRAPPER_FACTORY[VALUE_]
  43. -- The wrapper factory takes a pointer and returns a correct
  44. -- VALUE_ wrapper.
  45. invariant
  46. factory_not_void: factory /= Void
  47. end -- class WRAPPER_DICTIONARY