ANY JOB LOOP_ITEM NONE
class interface READY_DESCRIPTION
   -- Mainly used by loop_item and jobs.
   -- May be useful for time/date waiting.
   -- May be useful to check if data are available in files without locking.
   -- Have a look at queryable for the two states.

creation
   make
      ensure
         queryable = False

feature(s) from READY_DESCRIPTION
   make
      ensure
         queryable = False

feature(s) from READY_DESCRIPTION
   queryable: BOOLEAN
      -- First this object is not queryable. You have to configure
      -- the condition you want to wait for (data on file,
      -- timeout...) When configuration is done, you start waiting
      -- with wait. Then this object is queryable, that mean
      -- that you can query the state of files, using is_data
      -- and is_free.

   reset
      ensure
         queryable = False

   after (timeout_ms: INTEGER)
      -- timeout_ms is the max time in milliseconds to wait when
      -- wait begin.
      require
         timeout_ms >= 0;
         not queryable

   after_from_now (timeout_ms: INTEGER)
      -- timeout_ms is the max time in milliseconds to wait from now.
      require
         timeout_ms >= 0;
         not queryable

   at (date: MICROSECOND_TIME)
      -- date is the last moment wait can wait.
      require
         not queryable

   when_data (file: INPUT_WATCHED_FILE)
      require
         file /= Void;
         file.is_connected;
         not queryable

   is_data (file: INPUT_WATCHED_FILE): BOOLEAN
      require
         file /= Void;
         file.is_connected;
         queryable

   when_free (file: OUTPUT_WATCHED_FILE)
      require
         file /= Void;
         file.is_connected;
         not queryable

   is_free (file: OUTPUT_WATCHED_FILE): BOOLEAN
      require
         file /= Void;
         file.is_connected;
         queryable

   wait
      -- block until requested condition (max time and/or data)
      require
         not queryable
      ensure
         queryable

feature(s) from READY_DESCRIPTION
   current_time: MICROSECOND_TIME

feature(s) from READY_DESCRIPTION
   current_time_update
      -- (Because current_time is an expanded.)

feature(s) from READY_DESCRIPTION
   timeout: INTEGER

   expiration: MICROSECOND_TIME

   expiration_valid: BOOLEAN

   read_set: POINTER

   read_size: INTEGER

   write_set: POINTER

   write_size: INTEGER

   highest: INTEGER

   basic_file_create_set: POINTER

   basic_file_reset (set: POINTER)

   basic_file_watch (set: POINTER; file: INTEGER)

   basic_file_is_ready (set: POINTER; file: INTEGER): BOOLEAN

   basic_file_wait (n: INTEGER; rset: POINTER; rsize: INTEGER; wset: POINTER; wsize: INTEGER; s, us: INTEGER): INTEGER
      --return -1 if signal interupt occured



end of READY_DESCRIPTION