/src/tools/interpreter/liberty_interpreter_native_array_iterator.e

http://github.com/tybor/Liberty · Specman e · 64 lines · 40 code · 10 blank · 14 comment · 0 complexity · e97e74f03bd62d80b62b4c3054ae7644 MD5 · raw file

  1. -- This file is part of Liberty Eiffel.
  2. --
  3. -- Liberty Eiffel is free software: you can redistribute it and/or modify
  4. -- it under the terms of the GNU General Public License as published by
  5. -- the Free Software Foundation, version 3 of the License.
  6. --
  7. -- Liberty Eiffel is distributed in the hope that it will be useful,
  8. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. -- GNU General Public License for more details.
  11. --
  12. -- You should have received a copy of the GNU General Public License
  13. -- along with Liberty Eiffel. If not, see <http://www.gnu.org/licenses/>.
  14. --
  15. class LIBERTY_INTERPRETER_NATIVE_ARRAY_ITERATOR[E_]
  16. inherit
  17. ITERATOR[LIBERTY_INTERPRETER_OBJECT]
  18. creation {LIBERTY_INTERPRETER_NATIVE_ARRAY_TYPED}
  19. make
  20. feature {ANY}
  21. start is
  22. do
  23. elements.start
  24. end
  25. is_off: BOOLEAN is
  26. do
  27. Result := elements.is_off
  28. end
  29. item: LIBERTY_INTERPRETER_OBJECT is
  30. do
  31. Result := accessor.retrieve(elements.item)
  32. end
  33. next is
  34. do
  35. elements.next
  36. end
  37. feature {}
  38. make (a_elements: like elements; a_accessor: like accessor) is
  39. require
  40. a_elements /= Void
  41. a_accessor /= Void
  42. do
  43. elements := a_elements
  44. accessor := a_accessor
  45. ensure
  46. elements = a_elements
  47. accessor = a_accessor
  48. end
  49. elements: ITERATOR[E_]
  50. accessor: LIBERTY_INTERPRETER_NATIVE_ARRAY_ACCESSOR_TYPED[E_]
  51. invariant
  52. elements /= Void
  53. accessor /= Void
  54. end -- class LIBERTY_INTERPRETER_NATIVE_ARRAY_ITERATOR