Natools

Diff
Login

Differences From Artifact [940d53e029]:

To Artifact [6608c95221]:


23
24
25
26
27
28
29
30

31
32








33
34
35
36
37
38
39
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







-
+


+
+
+
+
+
+
+
+







------------------------------------------------------------------------------

with Natools.S_Expressions.Atom_Refs;

package Natools.S_Expressions.Atom_Buffers is
   pragma Preelaborate (Atom_Buffers);

   type Atom_Buffer is tagged limited private;
   type Atom_Buffer is new Ada.Streams.Root_Stream_Type with private;
   pragma Preelaborable_Initialization (Atom_Buffer);

   overriding procedure Write
     (Buffer : in out Atom_Buffer;
      Item : in Ada.Streams.Stream_Element_Array);
   overriding procedure Read
     (Buffer : in out Atom_Buffer;
      Item : out Ada.Streams.Stream_Element_Array;
      Last : out Ada.Streams.Stream_Element_Offset);

   procedure Preallocate (Buffer : in out Atom_Buffer; Length : in Count);
      --  Preallocate enough memory to append Length octets without
      --  any further allocation.

   procedure Append (Buffer : in out Atom_Buffer; Data : in Atom);
   procedure Append (Buffer : in out Atom_Buffer; Data : in Octet);
      --  Append Data after the end of Buffer
67
68
69
70
71
72
73
74

75
76
77
78
79
75
76
77
78
79
80
81

82
83
84
85
86
87







-
+





      --  Clear buffer and release internal memory

   procedure Soft_Reset (Buffer : in out Atom_Buffer);
      --  Clear buffer keeping internal memory

private

   type Atom_Buffer is tagged limited record
   type Atom_Buffer is new Ada.Streams.Root_Stream_Type with record
      Ref : Atom_Refs.Reference;
      Available, Used : Count := 0;
   end record;

end Natools.S_Expressions.Atom_Buffers;