Changes between Initial Version and Version 1 of League/IO


Ignore:
Timestamp:
Aug 3, 2010, 3:13:14 PM (11 years ago)
Author:
vadim.godunko
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • League/IO

    v1 v1  
     1[[PageOutline]]
     2= Input/Output =
     3
     4This page contains some ideas to implement input/output subsystem.
     5
     6== Input stream with notification capability ==
     7
     8{{{
     9with Ada.Streams;
     10with Interfaces;
     11
     12with League.Strings;
     13
     14package League.Input_Streams is
     15
     16   pragma Preelaborate;
     17
     18   type Input_Stream is limited interface;
     19
     20   type Input_Stream_Listener is limited interface;
     21
     22   not overriding function At_End
     23    (Self : not null access constant Input_Stream) return Boolean is abstract;
     24
     25   not overriding function Bytes_Available
     26    (Self : not null access constant Input_Stream) return Interfaces.Unsigned_64 is abstract;
     27
     28   not overriding function Error_String
     29    (Self : not null access constant Input_Stream)
     30       return League.Strings.Universal_String is abstract;
     31
     32   not overriding function Is_Open
     33    (Self : not null access constant Input_Stream)
     34       return Boolean is abstract;
     35
     36   not overriding procedure Read
     37    (Self    : not null access Input_Stream;
     38     Buffer  : out Ada.Streams.Stream_Element_Array;
     39     Last    : out Ada.Streams.Stream_Element_Offset;
     40     Success : out Boolean) is abstract;
     41
     42   not overriding procedure Read
     43    (Self    : not null access Input_Stream;
     44     Buffer  : out Ada.Streams.Stream_Element_Array;
     45     Last    : out Ada.Streams.Stream_Element_Offset;
     46     Success : out Boolean) is abstract;
     47
     48   procedure Read
     49    (Self   : not null access Input_Stream'Class;
     50     Buffer : out Ada.Streams.Stream_Element_Array;
     51     Last   : out Ada.Streams.Stream_Element_Offset);
     52
     53   not overriding procedure Add_Listener
     54    (Self     : not null access constant Input_Stream'Class;
     55     Listener : not null access Input_Stream_Listener'Class) is abstract;
     56
     57   ---------------------------
     58   -- Input_Stream_Listener --
     59   ---------------------------
     60
     61   not overriding procedure On_Ready_To_Read
     62    (Self   : not null access Input_Stream_Listener;
     63     Stream : not null access Input_Stream'Class) is abstract;
     64
     65   not overriding procedure On_Stream_Finished
     66    (Self   : not null access Input_Stream_Listener;
     67     Stream : not null access Input_Stream'Class) is abstract;
     68
     69end League.Input_Streams;
     70}}}