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

/src/lib/sequencer/events/can_read_data_from_stream.e

http://github.com/tybor/Liberty
Specman e | 62 lines | 29 code | 7 blank | 26 comment | 0 complexity | 5be259d39609825e36fb26b00d7f515d MD5 | raw file
 1-- This file is part of a Liberty Eiffel library.
 2-- See the full copyright at the end.
 3--
 4class CAN_READ_DATA_FROM_STREAM
 5   --
 6   -- Event: some data can be read from `input_stream'
 7   --
 8
 9inherit
10   EVENT_DESCRIPTOR
11
12create {INPUT_STREAM}
13   make
14
15feature {EVENTS_SET}
16   expect (events: EVENTS_SET)
17      do
18         events.when_data(input_stream)
19         set_expected(events)
20      end
21
22   occurred (events: EVENTS_SET): BOOLEAN
23      do
24         Result := events.is_data(input_stream)
25      end
26
27feature {}
28   input_stream: INPUT_STREAM
29
30   make (a_input_stream: like input_stream)
31      require
32         not is_expected
33         a_input_stream /= Void
34         a_input_stream.is_connected
35         a_input_stream.has_descriptor
36      do
37         input_stream := a_input_stream
38      ensure
39         input_stream = a_input_stream
40      end
41
42end -- class CAN_READ_DATA_FROM_STREAM
43--
44-- Copyright (C) 2009-2017: by all the people cited in the AUTHORS file.
45--
46-- Permission is hereby granted, free of charge, to any person obtaining a copy
47-- of this software and associated documentation files (the "Software"), to deal
48-- in the Software without restriction, including without limitation the rights
49-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
50-- copies of the Software, and to permit persons to whom the Software is
51-- furnished to do so, subject to the following conditions:
52--
53-- The above copyright notice and this permission notice shall be included in
54-- all copies or substantial portions of the Software.
55--
56-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
57-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
58-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
59-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
60-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
61-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
62-- THE SOFTWARE.