PageRenderTime 32ms CodeModel.GetById 27ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/src/lib/design_patterns/macro_command.e

http://github.com/tybor/Liberty
Specman e | 71 lines | 38 code | 7 blank | 26 comment | 0 complexity | a527d81c68d64febb16a120737d7b569 MD5 | raw file
 1-- This file is part of a Liberty Eiffel library.
 2-- See the full copyright at the end.
 3--
 4class MACRO_COMMAND[C_ -> COMMAND]
 5   --
 6   -- A very useful kind of Command: that's a bunch of commands to be executed at once.
 7   --
 8
 9inherit
10   COMMAND
11      undefine fill_tagged_out_memory, out_in_tagged_out_memory, default_create
12      redefine copy, is_equal
13      end
14   COLLECTION[C_]
15      undefine default_create, out_in_tagged_out_memory
16      end
17
18insert
19   FAST_ARRAY[C_]
20      redefine copy, is_equal
21      end
22
23create {ANY}
24   make, with_capacity
25
26feature {ANY}
27   execute
28      local
29         i: INTEGER
30      do
31         from
32            i := lower
33         until
34            i > upper
35         loop
36            item(i).execute
37            i := i + 1
38         end
39      end
40
41   copy (other: like Current)
42      do
43         Precursor {FAST_ARRAY} (other)
44      end
45
46   is_equal (other: like Current): BOOLEAN
47      do
48         Result := Precursor {FAST_ARRAY} (other)
49      end
50
51end -- class MACRO_COMMAND
52--
53-- Copyright (C) 2009-2017: by all the people cited in the AUTHORS file.
54--
55-- Permission is hereby granted, free of charge, to any person obtaining a copy
56-- of this software and associated documentation files (the "Software"), to deal
57-- in the Software without restriction, including without limitation the rights
58-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
59-- copies of the Software, and to permit persons to whom the Software is
60-- furnished to do so, subject to the following conditions:
61--
62-- The above copyright notice and this permission notice shall be included in
63-- all copies or substantial portions of the Software.
64--
65-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
66-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
67-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
68-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
69-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
70-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
71-- THE SOFTWARE.