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