PageRenderTime 18ms CodeModel.GetById 11ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/src/tools/interpreter/liberty_interpreter_native_array_accessor_typed.e

http://github.com/tybor/Liberty
Specman e | 54 lines | 32 code | 8 blank | 14 comment | 0 complexity | 7364028022a4d3e70db7688e2da1db44 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--
15class LIBERTY_INTERPRETER_NATIVE_ARRAY_ACCESSOR_TYPED[E_]
16
17inherit
18   LIBERTY_INTERPRETER_NATIVE_ARRAY_ACCESSOR
19
20creation {LIBERTY_INTERPRETER_NATIVE_ARRAY_ACCESSOR_FACTORY}
21   make
22
23feature {LIBERTY_INTERPRETER_NATIVE_ARRAY, LIBERTY_INTERPRETER_NATIVE_ARRAY_ITERATOR}
24   retrieve (item: E_): LIBERTY_INTERPRETER_OBJECT is
25      do
26         Result := retriever.item([item])
27      end
28
29   store (item: LIBERTY_INTERPRETER_OBJECT): E_ is
30      do
31         Result := storer.item([item])
32      end
33
34feature {}
35   make (a_retriever: like retriever; a_storer: like storer) is
36      require
37         a_retriever /= Void
38         a_storer /= Void
39      do
40         retriever := a_retriever
41         storer := a_storer
42      ensure
43         retriever = a_retriever
44         storer = a_storer
45      end
46
47   retriever: FUNCTION[TUPLE[E_], LIBERTY_INTERPRETER_OBJECT]
48   storer: FUNCTION[TUPLE[LIBERTY_INTERPRETER_OBJECT], E_]
49
50invariant
51   retriever /= Void
52   storer /= Void
53
54end -- class LIBERTY_INTERPRETER_NATIVE_ARRAY_ACCESSOR_TYPED