Rationale for Ada 2005

John Barnes
Contents   Index   References   Search   Previous   Next 

8.7 Summary table

This chapter concludes with a table showing at a glance the various facilities in the six main containers.
In order to save space the following abbreviations are used in the table:
Abbrv.MeaningAbbrv.Meaning
Tcontainer type eg MapH_THash_Type
C: TContainer: container typeI_TIndex_Type
P: CPosition: CursorK_TKey_Type
L, RLeft, RightEx_IndexExtended_Index
C_TCount_TypeBBoolean
E_TElement_Type
also Index – means that another subprogram exists with similar parameters except that the first parameters are of type Vector and Index_Type (or Extended_Index) rather than those involving cursors.
also Key and also Element similarly apply to maps and sets respectively.
vectorslistshashed mapsordered mapshashed setsordered sets
genericYYYYYY
  type Index_Type is range <>;Y
  type Key_Type is private;YY
  type Element_Type is private;YYYYYY
  with function Hash( ... ) return Hash_Type;on Keyon Element
  with function Equivalent_...(L, R: ...)
     return Boolean;
on Keyon Element
  with function "<" (L, R: ... )
     return Boolean is <>;
on Keyon Element
  with function "=" (L, R: E_T) return B is <>;YYYYYY
package Ada.Containers.... isVectorsDoubly_
Linked_
Lists
Hashed_
Maps
Ordered_
Maps
Hashed_
Sets
Ordered_
Sets
pragma Preelaborate( ... );YYY YYY
function Equivalent_...(L, R: ...) return Boolean;on Keyon Element
subtype Extended_Index ...
No_Index: constant Ex_Ind := Ex_Ind'First;
Y
type T is tagged private;
pragma Preelaborable_Initialization(T);
VectorListMapMapSetSet
type Cursor is private;
pragma Preelaborable_Initialization(Cursor);
YYYYYY
Empty_T: constant T;VectorListMapMapSetSet
No_Element: constant Cursor;YYY YYY
function "=" (Left, Right: T) return Boolean;YYYYYY
function Equivalent_Sets(L, R: Set)
   return Boolean;
function To_Set(New_Item: E_T) return Set;
YY
function To_Vector(Length: C_T) return Vector;
function To_Vector(
   New_Item: E_T;
   Length: C_T) return Vector;
Y
function "&" (L, R: Vector) return Vector;
function "&" (L: Vector; R: E_T) return Vector;
function "&" (L: E_T; R: Vector) return Vector;
function "&" (L, R: E_T) return Vector;
Y
function Capacity(C: T) return C_T;
procedure Reserve_Capacity(
   C: T; Capacity: C_T);
YYY
function Length(C: T) return Count_Type;YYY YYY
procedure Set_Length(
   C: in out T; Length: in C_T);
 Y
function Is_Empty(C: T) return B;
procedure Clear(C: in out T);
YY YYYY
function To_Cursor(C: Vector; Index: Ex_Ind)
      return Cursor;
function To_Index(P: C) return Ex_Ind;
Y
function Key(P: C) return K_T;YY
function Element(P: C) return E_T;Y
also Index
YY YYY
procedure Replace_Element(
   C: in out T; P: C;
   New_Item: E_T);
Y
also Index
YY YYY
procedure Query_Element(P: C;
   Process: not null acc proc( ... ) );
in Element
also Index
in Elementin Key,
in Element
in Key,
in Element
in Elementin Element
procedure Update_Element(C: in out T; P: C;
   Process: not null acc proc( ... ) );
in out Elem
also Index
in out Elemin Key,
in out Elem
in Key,
in out Elem
procedure Move(Target, Source: in out T);YYYYYY
procedure Insert(
   C: in out Vector; Before: Ex_Ind;
   New_Item: Vector);
procedure Insert(
   C: in out Vector; Before: Cursor;
   New_Item: Vector);
procedure Insert(
   C: in out Vector; Before: Cursor;
   New_Item: Vector; Position: out Cursor);
Y
procedure Insert(
   C: in out T; Before: C;
   New_Item: E_T; Count: C_T := 1);
Y
also Index
Y
procedure Insert(
   C: in out T; Before: C;
   New_Item: E_T; Position: out Cursor;
   Count: C_T := 1);
YY
procedure Insert(
   C: in out T; Before: C;
   Position: out Cursor; Count: C_T := 1);
element has default value
Y
also Index
Y
procedure Insert(
   C: in out T; Key: K_T;
   New_Item: E_T; Position: out Cursor;
   Inserted: out B);
YYY (no key)Y (no key)
procedure Insert(
   C: in out T; Key: K_T;
   Position: out Cursor; Inserted: out B);
element has default value
YY
procedure Insert(
   C: in out T; Key: K_T;
   New_Item: E_T);
YYY (no key)Y (no key)
procedure Prepend(
   C: in out Vector;
   New_Item: Vector);
Y
procedure Prepend(
   C: in out T;
   New_Item: E_T; Count: C_T := 1);
YY
procedure Append(
   C: in out Vector;
   New_Item: Vector);
Y
procedure Append(
   C: in out T;
   New_Item: E_T; Count: C_T := 1);
YY
procedure Insert_Space(
   C: in out V; Before: Cursor;
   Position: out Cursor; Count: C_T := 1);
Y
also Index
procedure Include(
   C: in out T;
   Key: Key_Type; New_Item: E_T);
YYY (no key)Y (no key)
procedure Replace(
   C: in out T;
   Key: Key_Type; New_Item: E_T);
YYY (no key)Y (no key)
procedure Exclude(
   C: in out T;
   Key: Key_Type);
YYY (Item not key)Y (item not key)
procedure Delete(
   C: in out T; P: in out C;
   Count: C_T := 1);
Y
also Index
YY (no count)
also Key
Y (no count)
also Key
Y (no count)
also Element
Y (no count)
also Element
procedure Delete_First(
   C: in out T; Count: C_T := 1);
procedure Delete_Last(
   C: in out T; Count: C_T := 1);
YYY (no count)Y (no count)
procedure Reverse_Elements(C: in out T);YY
procedure Swap(C: in out T; I, J: Cursor);Y
also Index
Y
procedure Swap_Links(
   C: in out List;
   I, J: Cursor);
Y
procedure Splice(
   Target: in out List; Before: Cursor;
   Source: in out List);
procedure Splice(
   Target: in out List; Before: Cursor;
   Source: in out List; Position: in out Cursor);
procedure Splice(
   Container: in out List; Before: Cursor;
   Position: Cursor);
Y
procedure Union(
   Target: in out Set;
   Source: Set);
function Union(L, R: Set) return Set;
function "or" (L, R: Set) return Set
   renames Union;
YY
procedure Intersection(
   Target: in out Set;
   Source: Set);
function Intersection(L, R: Set) return Set;
function "and" (L, R: Set) return Set
   renames Intersection;
YY
procedure Difference(
   Target: in out Set;
    Source: Set);
function Difference(L, R: Set) return Set;
function "–" (L, R: Set) return Set
   renames Difference;
YY
procedure Symmetric_Difference(
   Target: in out Set;
   Source: Set);
function Symmetric_Difference (L, R: Set)
   return Set;
function "xor" (L, R: Set) return Set
   renames Symmetric_Difference;
YY
function Overlap(L, R: Set) return Boolean;
function Is_Subset(Subset: Set; Of_Set: Set)
   return B;
YY
function First_Index(C: T) return Index_Type;Y
function First(C: T) return Cursor;YYYYYY
function First_Element(C: T)
   return Element_Type;
YYYY
function First_Key(C: T) return Key_Type;Y
function Last_Index(C: T) return Ex_Ind;Y
function Last(C: T) return Cursor;YYYY
function Last_Element(C: T)
   return Element_Type;
YYYY
function Last_Key(C: T) return Key_Type;Y
function Next(P: C) return Cursor;
procedure Next(P: in out C);
YYYYYY
function Previous(P: C) return Cursor;
procedure Previous(P: in out C);
YYYY
function Find_Index(
   C: T; Item: E_T;
   Index: I_T := I_T'First) return Ex_Ind;
Y
function Find(C: T; ... ; P: C := No_Element)
   return Cursor;
ElementElementKey (no position)Key (no position)Element (no position)Element (no position)
function Element(C: T; Key: K_T) return E_T;YY
function Reverse_Find_Index(
   C: T; Item: E_T;
   Index: I_T := I_T'First) return Ex_Ind;
Y
function Reverse_Find(
   C: T; ... ;
   P: C := No_Element) return Cursor;
ElementElement
function Floor(C: T; ...) return Cursor;
function Ceiling(C: T; ...) return Cursor;
Key: K_TItem: E_T
function Contains(C: T; ...) return Boolean;ElementElementKeyKeyElementElement
function Has_Element(P: C) return Boolean;YYYYYY
function Equivalent_... (L, R: Cursor)
   return Boolean;
function Equivalent_... (L: Cursor; R:...)
   return Boolean;
function Equivalent_... (L:...; R: Cursor)
   return Boolean;
KeysElements
function "<" (L, R: Cursor) return Boolean;
function ">" (L, R: Cursor) return Boolean;
function "<" (L, Cursor; R: ...) return Boolean;
function ">" (L, Cursor; R: ...) return Boolean;
function "<" (L:...; R: Cursor) return Boolean;
function ">" (L:...; R: Cursor) return Boolean;
KeyElement
procedure Iterate(C: in T;
   Process: not null acc proc (P: C) );
YYYYYY
procedure Reverse_Iterate(C: in T;
   Process: not null acc proc (P: C) );
YYYY
generic
   with function "<" (Left, Right: E_T)
      return B is <>;
package Generic_Sorting is
   function Is_Sorted(C: T) return Boolean;
   procedure Sort(C: in out T);
   procedure Merge(Target, Source: in out T);
end Generic_Sorting;
YY
generic
   type Key_Type (<>) is private;
YY
  with function Key(Element: E_T)
      return Key_Type;
YY
  with function Hash(Key: K_T)
       return Hash_Type;
Y
  with function Equivalent_Keys (
     L, R: Key_Type) return Boolean;
Y
  with function "<" (L, R: Key_Type)
      return B is <>;
Y
package Generic_Keys isYY
function Equivalent_Keys(L, R: Key_Type)
   return B;
Y
function Key(P: C) return Key_Type;YY
function Element(C: T; Key: K_T)
   return Element_T;
YY
procedure Replace(C: in out T; Key: Key_Type;
   New_Item: E_T);
procedure Exclude(
   C: in out T;
   Key: Key_Type);
procedure Delete(C: in out T; Key: Key_Type);
YY
function Find(C: T; Key: K_T) return Cursor;YY
function Floor(C: T; Key: K_T) return Cursor;
function Ceiling(C: T; Key: K_T) return Cursor;
     Y
function Contains(C: T; Key: K_T)
   return Boolean;
    YY
procedure Update_Element_Preserving_Key
   (C: in out T; P: C;
   Process: not null acc proc (
      Element: in out E_T) );
    YY
end Generic_Keys;YY
private
... -- not specified by the language
end Ada.Containers....;
YYYYYY

Contents   Index   References   Search   Previous   Next 
© 2005, 2006, 2007 John Barnes Informatics.
Sponsored in part by:
The Ada Resource Association and its member companies: ARA Members AdaCore Polyspace Technologies Praxis Critical Systems IBM Rational Sofcheck and   Ada-Europe:
Ada-Europe