-- --
-- S p e c --
-- --
--- Copyright (C) 2000-2005 Ada Core Technologies, Inc. --
+-- Copyright (C) 2000-2009, AdaCore --
-- --
-- GNAT 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- --
type Table_Type is
array (Table_Index_Type range <>) of Table_Component_Type;
-
subtype Big_Table_Type is
Table_Type (Table_Low_Bound .. Table_Index_Type'Last);
- -- We work with pointers to a bogus array type that is constrained
- -- with the maximum possible range bound. This means that the pointer
- -- is a thin pointer, which is more efficient. Since subscript checks
- -- in any case must be on the logical, rather than physical bounds,
- -- safety is not compromised by this approach.
+ -- We work with pointers to a bogus array type that is constrained with
+ -- the maximum possible range bound. This means that the pointer is a thin
+ -- pointer, which is more efficient. Since subscript checks in any case
+ -- must be on the logical, rather than physical bounds, safety is not
+ -- compromised by this approach. These types should not be used by the
+ -- client.
type Table_Ptr is access all Big_Table_Type;
- -- The table is actually represented as a pointer to allow
- -- reallocation.
+ for Table_Ptr'Storage_Size use 0;
+ -- The table is actually represented as a pointer to allow reallocation.
+ -- This type should not be used by the client.
type Table_Private is private;
- -- table private data that is not exported in Instance.
+ -- Table private data that is not exported in Instance
type Instance is record
Table : aliased Table_Ptr := null;
-- previously allocated larger table). Init must be called before using
-- the table. Init is convenient in reestablishing a table for new use.
- function Last (T : in Instance) return Table_Index_Type;
+ function Last (T : Instance) return Table_Index_Type;
pragma Inline (Last);
-- Returns the current value of the last used entry in the table,
-- which can then be used as a subscript for Table. Note that the
-- i.e. the table size is increased by one, and the given new item
-- stored in the newly created table element.
+ procedure Append_All (T : in out Instance; New_Vals : Table_Type);
+ -- Appends all components of New_Vals
+
procedure Set_Item
(T : in out Instance;
Index : Table_Index_Type;