70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
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
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
procedure Append (Buffer : in out Atom_Buffer; Data : in Octet) is
begin
Preallocate (Buffer, 1);
Buffer.Ref.Update.Data.all (Buffer.Used + 1) := Data;
Buffer.Used := Buffer.Used + 1;
end Append;
procedure Append_Reverse (Buffer : in out Atom_Buffer; Data : in Atom) is
procedure Process (Target : in out Atom);
procedure Process (Target : in out Atom) is
begin
for I in reverse Data'Range loop
Buffer.Used := Buffer.Used + 1;
Target (Buffer.Used) := Data (I);
end loop;
end Process;
begin
Preallocate (Buffer, Data'Length);
Buffer.Ref.Update (Process'Access);
end Append_Reverse;
function Length (Buffer : Atom_Buffer) return Count is
begin
return Buffer.Used;
end Length;
|
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
|
+
+
+
+
+
+
+
|
function Element (Buffer : Atom_Buffer; Position : Count) return Octet is
begin
return Buffer.Ref.Query.Data.all (Position);
end Element;
procedure Pop (Buffer : in out Atom_Buffer; Data : out Octet) is
begin
Data := Buffer.Ref.Query.Data.all (Buffer.Used);
Buffer.Used := Buffer.Used - 1;
end Pop;
procedure Hard_Reset (Buffer : in out Atom_Buffer) is
begin
Buffer.Ref.Reset;
Buffer.Available := 0;
Buffer.Used := 0;
end Hard_Reset;
|