PageRenderTime 19ms CodeModel.GetById 11ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/src/lib/sequencer/events/stream_exception.e

http://github.com/tybor/Liberty
Specman e | 62 lines | 29 code | 7 blank | 26 comment | 0 complexity | 67e1187c452c354c6e4bd039de4ef89c MD5 | raw file
 1-- This file is part of a Liberty Eiffel library.
 2-- See the full copyright at the end.
 3--
 4class STREAM_EXCEPTION
 5   --
 6   -- Event: some exception occur on the stream
 7   --
 8
 9inherit
10   EVENT_DESCRIPTOR
11
12create {STREAM}
13   make
14
15feature {EVENTS_SET}
16   expect (events: EVENTS_SET)
17      do
18         events.when_exception(stream)
19         set_expected(events)
20      end
21
22   occurred (events: EVENTS_SET): BOOLEAN
23      do
24         Result := events.is_exception(stream)
25      end
26
27feature {}
28   stream: STREAM
29
30   make (a_stream: like stream)
31      require
32         not is_expected
33         a_stream /= Void
34         a_stream.is_connected
35         a_stream.has_descriptor
36      do
37         stream := a_stream
38      ensure
39         stream = a_stream
40      end
41
42end -- class STREAM_EXCEPTION
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.