File: /home/oboss/Users/gec/sources/Basic_Services/Source_Data/cell_stream.ads
1 --% Compilation Unit: Cell_Stream
2 --
3 --% Category: Package Declaration
4 --
5 --% Release: $Name: $
6 --
7 --% Version: $Revision: 2.0 $
8 --
9 --% Author: $Author: gec $
10 --
11 --% Revision Log:
12 -- $Log: cell_stream.ads,v $
13 -- Revision 2.0 2003/04/04 08:50:13 gec
14 -- Initial release of source files serving as baseline for OBOSS-III project.
15 --
16 -- Revision 1.1.1.1 2003/04/04 08:13:04 gec
17 -- Imported using TkCVS
18 --
19 --
20 --
21 --% Project: OBOSS
22 --
23 --% Copyright (C) 2003 by Terma A/S
24 -- Proprietary and intellectual rights of Terma A/S, Denmark,
25 -- are involved in the subject-matter of this material and
26 -- all manufacturing, reproduction, use, disclosure, and
27 -- sales rights pertaining to such subject-matter are
28 -- expressly reserved. This material is submitted for a
29 -- specific purpose as agreed, and the recipient by
30 -- accepting this material agrees that this material will
31 -- not be used, copied, or reproduced in whole or in part
32 -- nor its contents revealed in any manner or to any person,
33 -- except to meet the purpose for which it was submitted and
34 -- subject to the terms of the agreement.
35 --
36 --% Target Dependencies:
37 -- None
38 --% Compiler Dependencies:
39 -- None
40
41 --~-----------------------------------------------------------------------------
42
43 with System;
44 with Basic_Types;
45 with Cell_Package;
46 package Cell_Stream is
47
48 --% Library Package:
49 -- Implementation of a stream data type on top of memory cells defined by
50 --+ Cell_Package.
51 --% Active Tasks:
52 --> None
53 --% Passive Tasks:
54 --> None
55
56 -- Attempt to append to end of a write stream has failed because end of
57 --+ stream was met.
58 Write_Stream_Exhausted : exception;
59
60 -- Attempt to read from head of a read stream has failed because end of
61 --+ stream was met.
62 Read_Stream_Exhausted : exception;
63
64 -- Representation of pointer to next position to be written in write
65 --+ streams.
66 type Put_Position is new Positive;
67 Init_Put_Position : constant Put_Position := Put_Position'First;
68
69 -- Representation of pointer to next position to be read in read streams.
70 type Get_Position is new Positive;
71 Init_Get_Position : constant Get_Position := Get_Position'First;
72
73 --% Subprogram:
74 -- Append object situated at Addr to write stream represented by C and
75 --+ Pp.
76 -- Type_Size indicates size of Ada type on which get operation is to be
77 --+ performed.
78 -- Object_Size indicates size of actual object.
79 --% Parameter Constraints:
80 --> Object_Size - Shall be >= Type_Size
81 --> Pp - Maintains the stream state. All calls with a given C shall
82 --+ include the associated Pp.
83 --% Exceptions Raised:
84 --> Write_Stream_Exhausted - End of stream was met during operation.
85 --+ Object has not been written.
86 procedure Put
87 (
88 C : in Cell_Package.Cell_Ref;
89 Pp : in out Put_Position;
90 Addr : in System.Address;
91 Type_Size : in Basic_Types.Bit_Size;
92 Object_Size : in Basic_Types.Bit_Size);
93
94
95 --% Subprogram:
96 -- Read object situated at Addr from read stream represented by C, Pp,
97 --+ and Gp.
98 -- Pp indicates the end of the read stream.
99 -- Type_Size indicates size of Ada type on which Put operation si to be
100 --+ performed.
101 -- Object_Size indicates size of actual object.
102 -- Iff Sign_Extend then will the sign-bit of the read object be extended
103 --+ to fill any unread bits at Addr (according to 2's complement
104 --+ representation).
105 --% Parameter Constraints:
106 --> Object_Size - Shall be >= Type_Size
107 --> Gp - Maintains the stream state. All calls with a given C and Pp
108 --+ shall include the associated Gp.
109 --% Exceptions Raised:
110 --> Read_Stream_Exhausted - End of stream was met during operation.
111 --+ Object has not been read.
112 procedure Get
113 (
114 C : in Cell_Package.Cell_Ref;
115 Pp : in Put_Position;
116 Gp : in out Get_Position;
117 Addr : in System.Address;
118 Type_Size : in Basic_Types.Bit_Size;
119 Object_Size : in Basic_Types.Bit_Size;
120 Sign_Extend : in Boolean);
121
122 end Cell_Stream;
123
124 --~-----------------------------------------------------------------------------
125
126