/src/lib/sequencer/events/timeout_event.e

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