Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /charles/src/ai302/

charles
Discussion topic

Back to topic list

CVS update: /charles/src/ai302/

Reply

Author matthewjheaney
Full name Matthew Heaney
Date 2004-03-22 18:57:52 PST
Message User: matthewjheaney
Date: 04/03/22 18:57:52

Modified:
 /charles/src/ai302/
  ai302-containers-vectors.ads

Log:
 name changes per ARG meeting in Phoenix

File Changes:

Directory: /charles/src/ai302/
==============================

File [changed]: ai302-containers-vectors.ads
Url: http://charles.tigri​s.org/source/browse/​charles/src/ai302/ai​302-containers-vecto​rs.ads?r1=1.2&r2​=1.3
Delta lines: +60 -111
----------------------
--- ai302-containers-vectors.ads 15 Mar 2004 00:51:47 -0000 1.2
+++ ai302-containers-vectors.ads 23 Mar 2004 02:57:50 -0000 1.3
@@ -34,7 +34,7 @@
 
 generic
 
- type Index_Type is range <>; --NOTE: "range <>" or "(<>)"?
+ type Index_Type is range <>;
 
    type Element_Type is private;
 
@@ -49,159 +49,106 @@
    subtype Index_Subtype is Index_Type;
    subtype Element_Subtype is Element_Type;
 
---NOTE: our tentative plan is to use Containers.Size_Type
--- subtype Size_Type is --NOTE: "Size_Subtype" ?
--- Index_Type'Base range 0 .. Index_Type'Base'Last;
+ type Vector is private;
 
- type Vector_Type is private;
-
- function Empty_Vector return Vector_Type;
+ function Empty_Vector return Vector;
    --NOTE:
    --The subcommittee report has this as a constant,
    --but you can't do that without an Ada 0X compiler.
    --For now I'll declare this as a function (which
    --might be better anyway).
 
+ function To_Vector (Count : Size_Type) return Vector;
+
    function To_Vector
      (New_Item : Element_Type;
- Count : Size_Type) return Vector_Type;
+ Count : Size_Type) return Vector;
 
- function "=" (Left, Right : Vector_Type) return Boolean;
+ function "=" (Left, Right : Vector) return Boolean;
 
- function Length (Vector : Vector_Type) return Size_Type;
+ function Length (Container : Vector) return Size_Type;
 
- function Is_Empty (Vector : Vector_Type) return Boolean;
+ function Is_Empty (Container : Vector) return Boolean;
 
- procedure Clear (Vector : in out Vector_Type);
+ procedure Clear (Container : in out Vector);
 
- procedure Swap (Left, Right : in out Vector_Type);
+ procedure Swap (Left, Right : in out Vector);
 
- procedure Append (Vector : in out Vector_Type;
- New_Item : in Element_Type);
-
- procedure Insert (Vector : in out Vector_Type;
- Before : in Index_Type'Base;
+ procedure Append (Container : in out Vector;
                      New_Item : in Element_Type);
 
- --NOTE: get rid of?
- procedure Insert (Vector : in out Vector_Type;
+ procedure Insert (Container : in out Vector;
                      Before : in Index_Type'Base;
                      New_Item : in Element_Type;
- Count : in Size_Type);
-
- --NOTE: get rid of?
--- procedure Insert (Vector : in out Vector_Type;
--- Before : in Index_Type'Base);
+ Count : in Size_Type := 1);
 
- procedure Insert_N (Vector : in out Vector_Type;
+ procedure Insert_Space (Container : in out Vector;
                        Before : in Index_Type'Base;
- Count : in Size_Type);
+ Count : in Size_Type := 1);
 
- procedure Delete (Vector : in out Vector_Type;
+ procedure Delete (Container : in out Vector;
                      Index : in Index_Type'Base);
 
- procedure Delete_Last (Vector : in out Vector_Type);
+ procedure Delete_Last (Container : in out Vector);
 
- --NOTE:
- --the name and signature of the deletion operations is
- --still in flux.
- --END NOTE.
- --
- procedure Delete (Vector : in out Vector_Type;
+ procedure Delete (Container : in out Vector;
                      From : in Index_Type'Base;
                      Through : in Index_Type'Base);
 
- procedure Delete_N (Vector : in out Vector_Type;
+ procedure Delete_N (Container : in out Vector;
                        First : in Index_Type'Base;
                        Count : in Size_Type);
 
- function Size (Vector : Vector_Type) return Size_Type;
+ function Size (Container : Vector) return Size_Type;
 
- procedure Resize (Vector : in out Vector_Type;
+ procedure Resize (Container : in out Vector;
                      Size : in Size_Type);
 
- function Front (Vector : Vector_Type) return Index_Type'Base;
+ function First (Container : Vector) return Index_Type;
 
- function First (Vector : Vector_Type) return Index_Type;
+ function First_Element (Container : Vector) return Element_Type;
 
- function First_Element (Vector : Vector_Type) return Element_Type;
+ function Last (Container : Vector) return Index_Type'Base;
 
- function Last (Vector : Vector_Type) return Index_Type'Base;
+ function Last_Element (Container : Vector) return Element_Type;
 
- function Last_Element (Vector : Vector_Type) return Element_Type;
-
- function Back (Vector : Vector_Type) return Index_Type'Base;
-
- function Element (Vector : Vector_Type;
+ function Element (Container : Vector;
                      Index : Index_Type'Base)
       return Element_Type;
 
    generic
- type Element_Access is access all Element_Type;
- function Generic_Element (Vector : Vector_Type;
- Index : Index_Type'Base)
- return Element_Access;
+ with procedure Process (Element : in out Element_Type) is <>;
+ procedure Generic_Update (Container : in Vector;
+ Index : in Index_Type'Base);
 
- procedure Replace_Element (Vector : in Vector_Type;
+ procedure Replace_Element (Container : in Vector;
                               Index : in Index_Type'Base;
                               By : in Element_Type);
 
- --NOTE:
- --The following passive iterators aren't in the committee report,
- --but there seems to be interest in having some kind of passive
- --iterator for vector containers, too.
- --END NOTE.
-
    generic
- with procedure Process (Element : in Element_Type) is <>;
- procedure Generic_Constant_Iteration (Vector : in Vector_Type);
-
- generic
- with procedure Process (Element : in out Element_Type) is <>;
- procedure Generic_Iteration (Vector : in Vector_Type);
-
- generic
- with procedure Process (Element : in Element_Type) is <>;
- procedure Generic_Constant_Rev​erse_Iteration (Vector : in Vector_Type);
-
- generic
- with procedure Process (Element : in out Element_Type) is <>;
- procedure Generic_Reverse_Iteration (Vector : in Vector_Type);
-
-
- generic
-
       with function "<" (Left, Right : Element_Type)
          return Boolean is <>;
+ procedure Generic_Sort (Container : in Vector);
 
- procedure Generic_Sort (Vector : in Vector_Type);
-
-
- --NOTE:
- --Not in committee report, but appears to be useful,
- --especially when using vectors as storage for
- --multi-map and multi-set complex containers.
- --END NOTE.
-
- function Find (Vector : Vector_Type;
+ function Find (Container : Vector;
                   Item : Element_Type;
                   Index : Index_Type'Base := Index_Type'First)
       return Index_Type'Base;
 
- function Reverse_Find (Vector : Vector_Type;
+ function Reverse_Find (Container : Vector;
                           Item : Element_Type;
                           Index : Index_Type'Base :=
                             Index_Type'Pred (Index_Type'First))
       return Index_Type'Base;
 
    function Is_In (Item : Element_Type;
- Vector : Vector_Type)
+ Container : Vector)
       return Boolean;
 
 private
 
    type Elements_Type is
- array (Index_Type range <>) of aliased Element_Type;
+ array (Index_Type range <>) of Element_Type;
 
    function "=" (L, R : Elements_Type) return Boolean is abstract;
 
@@ -209,28 +156,30 @@
 
    use Ada.Finalization;
 
- type Vector_Type is new Controlled with record
+ type Vector is new Controlled with record
       Elements : Elements_Access;
       Last : Index_Type'Base := Index_Type'Pred (Index_Type'First);
    end record;
 
- procedure Adjust (Vector : in out Vector_Type);
+ procedure Adjust (Container : in out Vector);
+
+ procedure Finalize (Container : in out Vector);
 
- procedure Finalize (Vector : in out Vector_Type);
 
+ use Ada.Streams;
 
    procedure Write
- (Stream : access Ada.Streams.Root_Str​eam_Type'Class;
- Vector : in Vector_Type);
+ (Stream : access Root_Stream_Type'Class;
+ Container : in Vector);
 
- for Vector_Type'Write use Write;
+ for Vector'Write use Write;
 
 
    procedure Read
- (Stream : access Ada.Streams.Root_Str​eam_Type'Class;
- Vector : out Vector_Type);
+ (Stream : access Root_Stream_Type'Class;
+ Container : out Vector);
 
- for Vector_Type'Read use Read;
+ for Vector'Read use Read;
 
 
 end AI302.Containers.Vectors;




--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: cvs-unsubscribe@char​les.tigris.org
For additional commands, e-mail: cvs-help at charles dot tigris dot org

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: /charles/src/ai302/ matthewjheaney Matthew Heaney 2004-03-22 18:57:52 PST
Messages per page: