Natools

Check-in [43ab20ac63]
Login
Overview
Comment:s_expressions-atom_buffers: add a capacity accessor
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 43ab20ac63ca9f4a4315db6d933ee5ec9fd850e1
User & Date: nat on 2014-08-09 10:37:32
Other Links: manifest | tags
Context
2014-08-10
17:13
s_expressions-atom_buffers-tests: use the new capacity accessor in tests check-in: b0c9543345 user: nat tags: trunk
2014-08-09
10:37
s_expressions-atom_buffers: add a capacity accessor check-in: 43ab20ac63 user: nat tags: trunk
2014-08-07
21:03
sxcat: also allow 'x' to represent atoms in separator arguments check-in: fafeac7b41 user: nat tags: trunk
Changes

Modified src/natools-s_expressions-atom_buffers.adb from [24525cb69b] to [eb31f6f60f].

118
119
120
121
122
123
124






125
126
127
128
129
130
131


   function Length (Buffer : Atom_Buffer) return Count is
   begin
      return Buffer.Used;
   end Length;








   function Data (Buffer : Atom_Buffer) return Atom is
   begin
      if Buffer.Ref.Is_Empty then
         pragma Assert (Buffer.Available = 0 and Buffer.Used = 0);
         return Null_Atom;
      else







>
>
>
>
>
>







118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137


   function Length (Buffer : Atom_Buffer) return Count is
   begin
      return Buffer.Used;
   end Length;


   function Capacity (Buffer : Atom_Buffer) return Count is
   begin
      return Buffer.Available;
   end Capacity;


   function Data (Buffer : Atom_Buffer) return Atom is
   begin
      if Buffer.Ref.Is_Empty then
         pragma Assert (Buffer.Available = 0 and Buffer.Used = 0);
         return Null_Atom;
      else

Modified src/natools-s_expressions-atom_buffers.ads from [0913ac5063] to [27750ce913].

41
42
43
44
45
46
47

48
49
50
51
52
53
54
   procedure Append_Reverse (Buffer : in out Atom_Buffer; Data : in Atom);
      --  Append bytes from Atom from last to first

   procedure Invert (Buffer : in out Atom_Buffer);
      --  Invert the order of bytes (first becomes last, etc)

   function Length (Buffer : Atom_Buffer) return Count;

   function Data (Buffer : Atom_Buffer) return Atom;
   procedure Query
     (Buffer : in Atom_Buffer;
      Process : not null access procedure (Data : in Atom));
   procedure Read
     (Buffer : in Atom_Buffer;
      Data : out Atom;







>







41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
   procedure Append_Reverse (Buffer : in out Atom_Buffer; Data : in Atom);
      --  Append bytes from Atom from last to first

   procedure Invert (Buffer : in out Atom_Buffer);
      --  Invert the order of bytes (first becomes last, etc)

   function Length (Buffer : Atom_Buffer) return Count;
   function Capacity (Buffer : Atom_Buffer) return Count;
   function Data (Buffer : Atom_Buffer) return Atom;
   procedure Query
     (Buffer : in Atom_Buffer;
      Process : not null access procedure (Data : in Atom));
   procedure Read
     (Buffer : in Atom_Buffer;
      Data : out Atom;