An Index to Ada.Containers

(C) 2005 Marius Amado Alves

Explanation

Common operations

pragma Pure(Containers);
-- declared in the main package (Containers)
type Hash_Type is mod implementation-defined;
-- declared in the main package (Containers)
type Count_Type is range 0 .. implementation-defined;
-- declared in the main package (Containers)
type Element_Type is private;
-- generic formal parameter
with function "=" (Left, Right : Element_Type)
   return Boolean is <>;
-- generic formal parameter
pragma Preelaborate(Package);
type Container is tagged private;
pragma preelaborable_initialization(Container);
type Cursor is private;
pragma preelaborable_initialization(Cursor);
Empty_Container : constant Container;
No_Element : constant Cursor;
function "=" (Left, Right : Container) return Boolean;
function Length (Container : Container) return Count_Type;
function Is_Empty (Container : Container) return Boolean;
procedure Clear (Container : in out Container);
function Element (Position : Cursor) return Element_Type;
procedure Move (Target : in out Container;
                Source : in out Container);
function First (Container : Container) return Cursor;
function Next (Position : Cursor) return Cursor;
procedure Next (Position : in out Cursor);
function Has_Element (Position : Cursor) return Boolean;
procedure  Iterate
     (Container : in Container;
   Process   : not null access procedure (Position : in Cursor));

Operation common to Vectors, Lists, Maps

procedure Replace_Element (Position : in Cursor;
                           By       : in Element_Type);

Operations common to Vectors, Lists, Ordered Maps, Ordered Sets

function First_Element (Container : Container)
   return Element_Type;
function Last (Container : Container) return Cursor;
function Last_Element (Container : Container)
   return Element_Type;
function Previous (Position : Cursor) return Cursor;
procedure Previous (Position : in out Cursor);
procedure Reverse_Iterate
     (Container : in Container;
   Process   : not null access procedure (Position : in Cursor));

Operations common to Vectors, Lists, Sets

procedure Query_Element
     (Position : in Cursor;
   Process  : not null access procedure (Element : in Element_Type));
function Contains (Container : Container;
                   Item      : Element_Type) return Boolean;

Operations common to Vectors, Lists

procedure Update_Element
     (Position : in Cursor;
   Process  : not null access procedure (Element : in out Element_Type));
procedure Insert (Container : in out Container;
                  Before    : in     Cursor;
                  New_Item  : in     Element_Type;
                  Count     : in     Count_Type := 1);
procedure Insert (Container : in out Container;
                  Before    : in     Cursor;
                  New_Item  : in     Element_Type;
                  Position  :    out Cursor;
                  Count     : in     Count_Type := 1);
procedure Prepend (Container : in out Container;
                   New_Item  : in     Element_Type;
                   Count     : in     Count_Type := 1);
procedure Append (Container : in out Container;
                  New_Item  : in     Element_Type;
                  Count     : in     Count_Type := 1);
procedure Delete (Container : in out Container;
                  Position  : in out Cursor;
                  Count     : in     Count_Type := 1);
procedure Delete_First (Container : in out Container;
                        Count     : in     Count_Type := 1);
procedure Delete_Last (Container : in out Container;
                       Count     : in     Count_Type := 1);
procedure Swap (I, J      : in     Cursor);
function Find (Container : Container;
               Item      : Element_Type;
               Position  : Cursor := No_Element)
   return Cursor;
function Reverse_Find (Container : Container;
                       Item      : Element_Type;
                       Position  : Cursor := No_Element)
   return Cursor;

Operations common to Vectors, Hashed Maps, Hashed Sets

function Capacity (Container : Container) return Count_Type;
procedure Reserve_Capacity (Container : in out Container;
                            Capacity  : in     Count_Type);

Operations specific to Vectors

type Index_Type is range <>;
-- generic formal parameter
subtype Extended_Index is
      Index_Type'Base range
         Index_Type'First-1 ..
      Index_Type'Min (Index_Type'Base'Last - 1, Index_Type'Last) + 1;
No_Index : constant Extended_Index := Extended_Index'First;
subtype Index_Subtype is Index_Type;
function To_Container (Length : Count_Type) return Container;
function To_Container
  (New_Item : Element_Type;
   Length   : Count_Type) return Container;
function "&" (Left, Right : Container) return Container;
function "&" (Left  : Container;
              Right : Element_Type) return Container;
function "&" (Left  : Element_Type;
              Right : Container) return Container;
function "&" (Left, Right  : Element_Type) return Container;
function To_Cursor (Container : Container;
                    Index     : Extended_Index) return Cursor;
function To_Index (Position  : Cursor) return Extended_Index;
function Element (Container : Container;
                  Index     : Index_Type)
   return Element_Type;
procedure Query_Element
     (Container : in Container;
   Index     : in Index_Type;
   Process   : not null access procedure (Element : in Element_Type));
procedure Update_Element
     (Container : in Container;
   Index     : in Index_Type;
   Process   : not null access procedure (Element : in out Element_Type));
procedure Replace_Element (Container : in Container;
                           Index     : in Index_Type;
                           By        : in Element_Type);
procedure Assign (Target : in out Container;
                  Source : in     Container);
procedure Insert (Container : in out Container;
                  Before    : in     Extended_Index;
                  New_Item  : in     Container);
procedure Insert (Container : in out Container;
                  Before    : in     Cursor;
                  New_Item  : in     Container);
procedure Insert (Container : in out Container;
                  Before    : in     Cursor;
                  New_Item  : in     Container;
                  Position  :    out Cursor);
procedure Insert (Container : in out Container;
                  Before    : in     Extended_Index;
                  New_Item  : in     Element_Type;
                  Count     : in     Count_Type := 1);
procedure Prepend (Container : in out Container;
                   New_Item  : in     Container);
procedure Append (Container : in out Container;
                  New_Item  : in     Container);
procedure Insert_Space (Container : in out Container;
                        Before    : in     Extended_Index;
                        Count     : in     Count_Type := 1);
procedure Insert_Space (Container : in out Container;
                        Before    : in     Cursor;
                        Position  :    out Cursor;
                        Count     : in     Count_Type := 1);
procedure Set_Length (Container : in out Container;
                      Length    : in     Count_Type);
procedure Delete (Container : in out Container;
                  Index     : in     Extended_Index;
                  Count     : in     Count_Type := 1);
function First_Index (Container : Container) return Index_Type;
function Last_Index (Container : Container) return Extended_Index;
procedure Swap (Container : in Container;
                I, J      : in Index_Type);
generic
      with function "<" (Left, Right : Element_Type)
      return Boolean is <>;
   procedure Generic_Sort (Container : in Container);
function Find_Index (Container : Container;
                     Item      : Element_Type;
                     Index     : Index_Type := Index_Type'First)
   return Extended_Index;
function Reverse_Find_Index (Container : Container;
                             Item      : Element_Type;
                             Index     : Index_Type := Index_Type'Last)
   return Extended_Index;

Operations specific to Lists

procedure Insert (Container : in out Container;
                  Before    : in     Cursor;
                  Position  :    out Cursor;
                  Count     : in     Count_Type := 1);
generic
      with function "<" (Left, Right : Element_Type)
      return Boolean is <>;
   procedure Generic_Sort (Container : in out Container);
generic
      with function "<" (Left, Right : Element_Type)
      return Boolean is <>;
   procedure Generic_Merge (Target  : in out Container;
                         Source  : in out Container);
procedure Reverse_Container (Container : in out Container);
procedure Swap_Links (Container : in out Container;
                      I, J      : in     Cursor);
procedure Splice (Target   : in out Container;
                  Before   : in     Cursor;
                  Source   : in out Container);
procedure Splice (Target   : in out Container;
                  Before   : in     Cursor;
                  Position : in     Cursor);
procedure Splice (Target   : in out Container;
                  Before   : in     Cursor;
                  Source   : in out Container;
                  Position : in     Cursor);

Operations common to Maps, Sets

function Key (Position : Cursor) return Key_Type;
-- Generic_Keys (Sets)
procedure Replace (Container : in out Container;
                   Key       : in     Key_Type;
                   New_Item  : in     Element_Type);
-- Generic_Keys (Sets)
procedure Delete (Container : in out Container;
                  Key       : in     Key_Type);
-- Generic_Keys (Sets)
procedure Delete (Container : in out Container;
                  Position  : in out Cursor);
procedure Exclude (Container : in out Container;
                   Key       : in     Key_Type);
-- Generic_Keys (Sets)
function Contains (Container : Container;
                   Key       : Key_Type) return Boolean;
-- Generic_Keys (Sets)
function Find (Container : Container;
               Key       : Key_Type)
   return Cursor;
-- Generic_Keys (Sets)
function Element (Container : Container;
                  Key       : Key_Type)
   return Element_Type;
-- Generic_Keys (Sets)

Operations specific to Maps

type Key_Type is private;
-- generic formal parameter
procedure Query_Element
     (Position : in Cursor;
   Process  : not null access procedure (Key     : in Key_Type;
                                         Element : in Element_Type));
procedure Update_Element
    (Position : in Cursor;
  Process  : not null access procedure (Key     : in Key_Type;
                                        Element : in out Element_Type));
procedure Insert (Container : in out Container;
                  Key       : in     Key_Type;
                  New_Item  : in     Element_Type;
                  Position  :    out Cursor;
                  Inserted  :    out Boolean);
procedure Insert (Container : in out Container;
                  Key       : in     Key_Type;
                  Position  :    out Cursor;
                  Inserted  :    out Boolean);
procedure Insert (Container : in out Container;
                  Key       : in     Key_Type;
                  New_Item  : in     Element_Type);
procedure Include (Container : in out Container;
                   Key       : in     Key_Type;
                   New_Item  : in     Element_Type);

Operations common to Hashed Maps, Hashed Sets

with function Hash (Key : Key_Type) return Hash_Type;
-- generic formal parameter
-- Generic_Keys (Sets)
function Equivalent_Keys (Left  : Cursor;
                          Right : Key_Type)
   return Boolean;
-- Generic_Keys (Sets)
function Equivalent_Keys (Left  : Key_Type;
                          Right : Cursor)
   return Boolean;
-- Generic_Keys (Sets)

Operations specific to Hashed Maps

with function Equivalent_Keys (Left, Right : Key_Type)
   return Boolean;
-- generic formal parameter
function Equivalent_Keys (Left, Right : Cursor)
   return Boolean;

Operations common to Ordered Maps, Ordered Sets

procedure Delete_First (Container : in out Container);
procedure Delete_Last (Container : in out Container);
function "<" (Left, Right : Cursor) return Boolean;
function ">" (Left, Right : Cursor) return Boolean;
function "<" (Left : Cursor; Right : Key_Type) return Boolean;
-- Generic_Keys (Sets)
function ">" (Left : Cursor; Right : Key_Type) return Boolean;
-- Generic_Keys (Sets)
function "<" (Left : Key_Type; Right : Cursor) return Boolean;
-- Generic_Keys (Sets)
function ">" (Left : Key_Type; Right : Cursor) return Boolean;
-- Generic_Keys (Sets)

Operations specific to Ordered Maps

with function "<" (Left, Right : Key_Type) return Boolean is <>;
-- generic formal parameter
function Floor (Container : Container;
                Key       : Key_Type) return Cursor;
function Ceiling (Container : Container;
                  Key       : Key_Type) return Cursor;
function First_Key (Container : Container) return Key_Type;
function Last_Key (Container : Container) return Key_Type;

Operations specific to Sets

function Equivalent_Sets (Left, Right : Container) return Boolean;
procedure Replace_Element (Container : in Container;
                           Position  : in Cursor;
                           By        : in Element_Type);
procedure Insert (Container : in out Container;
                  New_Item  : in     Element_Type;
                  Position  :    out Cursor;
                  Inserted  :    out Boolean);
procedure Insert (Container : in out Container;
                  New_Item  : in     Element_Type);
procedure Include (Container : in out Container;
                   New_Item  : in     Element_Type);
procedure Replace (Container : in out Container;
                   New_Item  : in     Element_Type);
procedure Delete (Container : in out Container;
                  Item      : in     Element_Type);
procedure Exclude (Container : in out Container;
                   Item      : in     Element_Type);
function Find (Container : Container;
               Item      : Element_Type) return Cursor;
procedure Union (Target : in out Container;
                 Source : in     Container);
function Union (Left, Right : Container) return Container;
function "or" (Left, Right : Container) return Container renames Union;
procedure Intersection (Target : in out Container;
                        Source : in     Container);
function Intersection (Left, Right : Container) return Container;
function "and" (Left, Right : Container) return Container renames Intersection;
procedure Difference (Target : in out Container;
                      Source : in     Container);
function Difference (Left, Right : Container) return Container;
function "-" (Left, Right : Container) return Container renames Difference;
procedure Symmetric_Difference (Target : in out Container;
                                Source : in     Container);
function Symmetric_Difference (Left, Right : Container) return Container;
function "xor" (Left, Right : Container) return Container
  renames Symmetric_Difference;
function Overlap (Left, Right : Container) return Boolean;
function Is_Subset (Subset : Container;
                    Of_Container : ) return Boolean;
type Key_Type (<>) is limited private;
-- generic formal parameter
-- Generic_Keys (Sets)
procedure Update_Element_Preserving_Key
        (Container : in out Container;
   Position  : in     Cursor;
   Process   : not null access procedure (Element : in out Element_Type));
-- Generic_Keys (Sets)

Operations specific to Hashed Sets

with function Hash (Element : Element_Type) return Hash_Type;
-- generic formal parameter
with function Equivalent_Elements (Left, Right : Element_Type)
              return Boolean;
-- generic formal parameter
function Equivalent_Elements (Left, Right : Cursor)
  return Boolean;
function Equivalent_Elements (Left  : Cursor;
                              Right : Element_Type)
 return Boolean;
function Equivalent_Elements (Left  : Element_Type;
                              Right : Cursor)
 return Boolean;
with function Key (Element : in Element_Type) return Key_Type;
-- generic formal parameter
-- Generic_Keys (Sets)
with function Equivalent_Keys (Left : Key_Type; Right : Element_Type)
                               return Boolean;
-- generic formal parameter
-- Generic_Keys (Sets)

Operations specific to Ordered Sets

with function "<" (Left, Right : Element_Type) return Boolean is <>;
-- generic formal parameter
function Floor (Container : Container;
                Item      : Element_Type)
   return Cursor;
function Ceiling (Container : Container;
                  Item      : Element_Type)
   return Cursor;
function "<" (Left : Cursor; Right : Element_Type)
   return Boolean;
function ">" (Left : Cursor; Right : Element_Type)
   return Boolean;
function "<" (Left : Element_Type; Right : Cursor)
   return Boolean;
function ">" (Left : Element_Type; Right : Cursor)
   return Boolean;
with function Key (Element : Element_Type) return Key_Type;
-- generic formal parameter
-- Generic_Keys (Sets)
with function "<" (Left : Key_Type; Right : Element_Type)
   return Boolean is <>;
-- generic formal parameter
-- Generic_Keys (Sets)
with function ">" (Left : Key_Type; Right : Element_Type)
   return Boolean is <>;
-- generic formal parameter
-- Generic_Keys (Sets)
function Floor (Container : Container;
                Item      : Key_Type)
   return Cursor;
-- Generic_Keys (Sets)
function Ceiling (Container : Container;
                  Item      : Key_Type)
   return Cursor;
-- Generic_Keys (Sets)

Name index

"&" -- Vectors
"-" -- Sets
"<" -- Ordered Maps, Ordered Sets
"=" -- Vectors, Lists, Maps, Sets
">" -- Ordered Maps, Ordered Sets
"and" -- Sets
"or" -- Sets
"xor" -- Sets
Append -- Vectors, Lists
Assign -- Vectors
Capacity -- Vectors, Hashed Maps, Hashed Sets
Ceiling -- Ordered Maps, Ordered Sets
Clear -- Vectors, Lists, Maps, Sets
Container -- Vectors, Lists, Maps, Sets
Contains -- Vectors, Lists, Maps, Sets
Count_Type -- Vectors, Lists, Maps, Sets
Cursor -- Vectors, Lists, Maps, Sets
Delete -- Vectors, Lists, Maps, Sets
Delete_First -- Vectors, Lists, Ordered Maps, Ordered Sets
Delete_Last -- Vectors, Lists, Ordered Maps, Ordered Sets
Difference -- Sets
Element -- Vectors, Lists, Maps, Sets
Element_Type -- Vectors, Lists, Maps, Sets
Empty_Container -- Vectors, Lists, Maps, Sets
Equivalent_Elements -- Hashed Sets
Equivalent_Keys -- Hashed Maps, Hashed Sets
Equivalent_Sets -- Sets
Exclude -- Maps, Sets
Extended_Index -- Vectors
Find -- Vectors, Lists, Maps, Sets
Find_Index -- Vectors
First -- Vectors, Lists, Maps, Sets
First_Element -- Vectors, Lists, Ordered Maps, Ordered Sets
First_Index -- Vectors
First_Key -- Ordered Maps
Floor -- Ordered Maps, Ordered Sets
Generic_Merge -- Lists
Generic_Sort -- Vectors, Lists
Has_Element -- Vectors, Lists, Maps, Sets
Hash -- Hashed Maps, Hashed Sets
Hash_Type -- Vectors, Lists, Maps, Sets
Include -- Maps, Sets
Index_Subtype -- Vectors
Index_Type -- Vectors
Insert -- Vectors, Lists, Maps, Sets
Insert_Space -- Vectors
Intersection -- Sets
Is_Empty -- Vectors, Lists, Maps, Sets
Is_Subset -- Sets
Iterate -- Vectors, Lists, Maps, Sets
Key -- Maps, Sets
Key_Type -- Maps, Sets
Last -- Vectors, Lists, Ordered Maps, Ordered Sets
Last_Element -- Vectors, Lists, Ordered Maps, Ordered Sets
Last_Index -- Vectors
Last_Key -- Ordered Maps
Length -- Vectors, Lists, Maps, Sets
Move -- Vectors, Lists, Maps, Sets
Next -- Vectors, Lists, Maps, Sets
No_Element -- Vectors, Lists, Maps, Sets
No_Index -- Vectors
Overlap -- Sets
Prepend -- Vectors, Lists
Previous -- Vectors, Lists, Ordered Maps, Ordered Sets
Query_Element -- Vectors, Lists, Maps, Sets
Replace -- Maps, Sets
Replace_Element -- Vectors, Lists, Maps, Sets
Reserve_Capacity -- Vectors, Hashed Maps, Hashed Sets
Reverse_Container -- Lists
Reverse_Find -- Vectors, Lists
Reverse_Find_Index -- Vectors
Reverse_Iterate -- Vectors, Lists, Ordered Maps, Ordered Sets
Set_Length -- Vectors
Splice -- Lists
Swap -- Vectors, Lists
Swap_Links -- Lists
Symmetric_Difference -- Sets
To_Container -- Vectors
To_Cursor -- Vectors
To_Index -- Vectors
Union -- Sets
Update_Element -- Vectors, Lists, Maps
Update_Element_Preserving_Key -- Sets
pragma Preelaborate (Package); -- Vectors, Lists, Maps, Sets
pragma Pure (Containers); -- Vectors, Lists, Maps, Sets
pragma preelaborable_initialization (Container); -- Vectors, Lists, Maps, Sets
pragma preelaborable_initialization (Cursor); -- Vectors, Lists, Maps, Sets