1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212 | ------------------------------------------------------------------------------
-- --
-- GLADE TOOLS --
-- --
-- GLADE.EVENT_COMMUNICATION.IMPLEMENTATION --
-- --
-- S p e c --
-- --
-- Copyright (C) 1996-2020 Free Software Foundation, Inc. --
-- --
-- GLADE is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GLADE is distributed in the hope that it will be useful, but --
-- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABI- --
-- LITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public --
-- License for more details. You should have received a copy of the GNU --
-- General Public License distributed with GLADE; see file COPYING. If --
-- not, write to the Free Software Foundation, 59 Temple Place - Suite 330, --
-- Boston, MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
------------------------------------------------------------------------------
with Ada.Streams;
with GLADE.Event_Communication.Interface;
package GLADE.Event_Communication.Implementation is
pragma Remote_Types;
-------------------
-- Push_Consumer --
-------------------
type Push_Consumer is new Interface.Push_Consumer with private;
function Create
return Interface.Push_Consumer_Ref;
procedure Disconnect
(Consumer : access Push_Consumer);
function Get
(Consumer : access Push_Consumer)
return Ada.Streams.Stream_Element_Array;
procedure Push
(Consumer : access Push_Consumer;
Event : in Ada.Streams.Stream_Element_Array);
-------------------
-- Push_Supplier --
-------------------
type Push_Supplier is new Interface.Push_Supplier with private;
function Create
return Interface.Push_Supplier_Ref;
procedure Disconnect
(Supplier : access Push_Supplier);
procedure Put
(Supplier : access Push_Supplier;
Event : in Ada.Streams.Stream_Element_Array);
-------------------
-- Pull_Consumer --
-------------------
type Pull_Consumer is new Interface.Pull_Consumer with private;
function Create
return Interface.Pull_Consumer_Ref;
procedure Disconnect
(Consumer : access Pull_Consumer);
function Get
(Consumer : access Pull_Consumer)
return Ada.Streams.Stream_Element_Array;
-------------------
-- Pull_Supplier --
-------------------
type Pull_Supplier is new Interface.Pull_Supplier with private;
function Create
return Interface.Pull_Supplier_Ref;
procedure Disconnect
(Supplier : access Pull_Supplier);
function Pull
(Supplier : access Pull_Supplier)
return Ada.Streams.Stream_Element_Array;
procedure Put
(Supplier : access Pull_Supplier;
Event : Ada.Streams.Stream_Element_Array);
function Try_Pull
(Supplier : access Pull_Supplier)
return Ada.Streams.Stream_Element_Array;
private
-------------------
-- Push_Consumer --
-------------------
type Push_Consumer_Record;
type Push_Consumer_Access is access Push_Consumer_Record;
procedure Read
(S : access Ada.Streams.Root_Stream_Type'Class;
X : out Push_Consumer_Access);
procedure Write
(S : access Ada.Streams.Root_Stream_Type'Class;
X : in Push_Consumer_Access);
for Push_Consumer_Access'Read use Read;
for Push_Consumer_Access'Write use Write;
type Push_Consumer is new Interface.Push_Consumer with
record
X : Push_Consumer_Access;
end record;
-------------------
-- Pull_Consumer --
-------------------
type Pull_Consumer_Record;
type Pull_Consumer_Access is access Pull_Consumer_Record;
procedure Read
(S : access Ada.Streams.Root_Stream_Type'Class;
X : out Pull_Consumer_Access);
procedure Write
(S : access Ada.Streams.Root_Stream_Type'Class;
X : in Pull_Consumer_Access);
for Pull_Consumer_Access'Read use Read;
for Pull_Consumer_Access'Write use Write;
type Pull_Consumer is new Interface.Pull_Consumer with
record
X : Pull_Consumer_Access;
end record;
-------------------
-- Push_Supplier --
-------------------
type Push_Supplier_Record;
type Push_Supplier_Access is access Push_Supplier_Record;
procedure Read
(S : access Ada.Streams.Root_Stream_Type'Class;
X : out Push_Supplier_Access);
procedure Write
(S : access Ada.Streams.Root_Stream_Type'Class;
X : in Push_Supplier_Access);
for Push_Supplier_Access'Read use Read;
for Push_Supplier_Access'Write use Write;
type Push_Supplier is new Interface.Push_Supplier with
record
X : Push_Supplier_Access;
end record;
-------------------
-- Pull_Supplier --
-------------------
type Pull_Supplier_Record;
type Pull_Supplier_Access is access Pull_Supplier_Record;
procedure Read
(S : access Ada.Streams.Root_Stream_Type'Class;
X : out Pull_Supplier_Access);
procedure Write
(S : access Ada.Streams.Root_Stream_Type'Class;
X : in Pull_Supplier_Access);
for Pull_Supplier_Access'Read use Read;
for Pull_Supplier_Access'Write use Write;
type Pull_Supplier is new Interface.Pull_Supplier with
record
X : Pull_Supplier_Access;
end record;
end GLADE.Event_Communication.Implementation;
|