/src/wrappers/glib/partially-implemented/g_reference_array_iterator.e

http://github.com/tybor/Liberty · Specman e · 75 lines · 59 code · 14 blank · 2 comment · 5 complexity · 4676fe3dffdffa74d4b55f6334e5f6cd MD5 · raw file

  1. indexing
  2. description: "."
  3. copyright: "[
  4. Copyright (C) 2007 $EWLC_developer, $original_copyright_holder
  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 hopeOA 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. class G_REFERENCE_ARRAY_ITERATOR [ITEM->C_STRUCT]
  19. inherit
  20. ITERATOR[ITEM]
  21. WRAPPER_HANDLER
  22. insert
  23. WRAPPER_FACTORY [ITEM]
  24. SHARED_WRAPPERS_DICTIONARY
  25. G_PTR_ARRAY_EXTERNALS
  26. creation make
  27. feature {} -- Creation
  28. make (an_array: G_REFERENCE_ARRAY [ITEM]) is
  29. require array_not_void: an_array/=Void
  30. do
  31. array:=an_array
  32. end
  33. feature {ANY}
  34. start is
  35. do
  36. i:=array.lower
  37. end
  38. is_off: BOOLEAN is
  39. -- Returns True when there are no more objects in the
  40. -- sequence.
  41. do
  42. Result := i>upper
  43. end
  44. item: ITEM is
  45. local p: POINTER; npa: NATIVE_ARRAY[POINTER]
  46. do
  47. npa := npa.from_pointer(get_pdata(handle))
  48. p := npa.item(index)
  49. if p.is_not_null then
  50. if wrappers.has(p) then Result::=wrappers.item(p)
  51. else print_wrapper_factory_notice
  52. end
  53. end
  54. end
  55. next is
  56. do
  57. i:=i+1
  58. end
  59. feature {} -- Implementation
  60. array: G_REFERENCE_ARRAY [ITEM]
  61. end --class G_REFERENCE_ARRAY_ITERATOR