Login | Register
My pages Projects Community openCollabNet

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

charles
Discussion topic

Back to topic list

CVS update: /charles/src/

Reply

Author matthewjheaney
Full name Matthew Heaney
Date 2004-03-07 17:52:37 PST
Message User: matthewjheaney
Date: 04/03/07 17:52:37

Added:
 /charles/src/
  charles-multimaps-ha​shed-strings-unbound​ed.ads

Log:
 initial release

File Changes:

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

File [added]: charles-multimaps-ha​shed-strings-unbound​ed.ads
Url: http://charles.tigri​s.org/source/browse/​charles/src/charles-​multimaps-hashed-str​ings-unbounded.ads?r​ev=1.1&content-t​ype=text/vnd.viewcvs​-markup
Added lines: 258
----------------
pragma License (Modified_GPL);

--------------------​--------------------​--------------------​------------------
-- --
-- CHARLES CONTAINER LIBRARY --
-- --
-- Copyright (C) 2001-2003 Matthew J Heaney --
-- --
-- The Charles Container Library ("Charles") is free software; you can --
-- redistribute it and/or modify it under terms of the GNU General Public --
-- License as published by the Free Software Foundation; either version 2, --
-- or (at your option) any later version. Charles is distributed in the --
-- hope that it will be useful, but WITHOUT ANY WARRANTY; without even the --
-- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
-- See the GNU General Public License for more details. You should have --
-- received a copy of the GNU General Public License distributed with --
-- Charles; see file COPYING.TXT. If not, write to the Free Software --
-- Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- Charles is maintained by Matthew J Heaney. --
-- --
-- http://home.earthlin​k.net/~matthewjheane​y/index.html --
-- mailto:matthewjheane​y@earthlink.net --
-- --
--------------------​--------------------​--------------------​------------------
with Ada.Finalization;

with Charles.Hash_Tables;
pragma Elaborate_All (Charles.Hash_Tables);

with Charles.Hash_String;

generic

   type Element_Type is private;

   with function Hash (Key : String)
     return Hash_Type is Charles.Hash_String;

   with function Is_Equal_Key (Left, Right : String)
      return Boolean is "=";

   with function "=" (Left, Right : Element_Type)
      return Boolean is <>;

package Charles.Multimaps.Ha​shed.Strings.Unbound​ed is
   pragma Preelaborate (Unbounded);

   subtype Key_Subtype is String;

   subtype Element_Subtype is Element_Type;

   function Compare_Keys (Left, Right : String)
      return Boolean renames Is_Equal_Key;

   function Compare_Elements (Left, Right : Element_Type)
      return Boolean renames "=";


   type Container_Type is private;

   type Iterator_Type is private;

   Null_Iterator : constant Iterator_Type;

   procedure Assign
     (Target : in out Container_Type;
      Source : in Container_Type);

   function "=" (Left, Right : Container_Type) return Boolean;

   function Length (Container : Container_Type) return Natural;

   function Is_Empty (Container : Container_Type) return Boolean;

   procedure Clear (Container : in out Container_Type);

   procedure Swap (Left, Right : in out Container_Type);

   procedure Insert
     (Container : in out Container_Type;
      Key : in String;
      New_Item : in Element_Type;
      Iterator : out Iterator_Type);

   procedure Insert
     (Container : in out Container_Type;
      Key : in String;
      New_Item : in Element_Type);

   procedure Insert
     (Container : in out Container_Type;
      Key : in String;
      Iterator : out Iterator_Type);

   procedure Insert
     (Container : in out Container_Type;
      Key : in String);

   procedure Insert_Sans_Resize
     (Container : in out Container_Type;
      Key : in String;
      New_Item : in Element_Type;
      Iterator : out Iterator_Type);

   procedure Insert_Sans_Resize
     (Container : in out Container_Type;
      Key : in String;
      New_Item : in Element_Type);

   procedure Insert_Sans_Resize
     (Container : in out Container_Type;
      Key : in String;
      Iterator : out Iterator_Type);

   procedure Insert_Sans_Resize
     (Container : in out Container_Type;
      Key : in String);

   procedure Delete
     (Container : in out Container_Type;
      Key : in String);

   procedure Delete
     (Container : in out Container_Type;
      Iterator : in out Iterator_Type);

   function Is_In
     (Key : String;
      Container : Container_Type) return Boolean;

   function Find
     (Container : Container_Type;
      Key : String) return Iterator_Type;

   function Size (Container : Container_Type) return Natural;

   procedure Resize
     (Container : in out Container_Type;
      Length : in Natural);

   generic
      with procedure Process
        (Iterator : Iterator_Type) is <>;
   procedure Generic_Equal_Range
     (Container : in Container_Type;
      Key : in String);

   function First (Container : Container_Type) return Iterator_Type;

   function First_Key (Container : Container_Type) return String;

   function First_Element (Container : Container_Type) return Element_Type;

   function Back (Container : Container_Type) return Iterator_Type;

   function Succ
     (Container : Container_Type;
      Iterator : Iterator_Type) return Iterator_Type;

   procedure Increment
     (Container : in Container_type;
      Iterator : in out Iterator_Type);

   function Is_Equal_Key
     (Left, Right : Iterator_Type) return Boolean;

   function Is_Equal_Key
     (Left : Iterator_Type;
      Right : String) return Boolean;

   function Is_Equal_Key
     (Left : String;
      Right : Iterator_Type) return Boolean;

   function Is_Equal (Left, Right : Iterator_Type) return Boolean;

   function Is_Equal
     (Left : Iterator_Type;
      Right : Element_Type) return Boolean;

   function Is_Equal
     (Left : Element_Type;
      Right : Iterator_Type) return Boolean;

   function Key (Iterator : Iterator_Type) return String;

   function Element (Iterator : Iterator_Type) return Element_Type;

   function Element
     (Container : Container_Type;
      Key : String) return Element_Type;

   generic
      type Element_Access is access all Element_Type;
   function Generic_Element
     (Iterator : Iterator_Type) return Element_Access;

   procedure Replace_Element
     (Iterator : in Iterator_Type;
      By : in Element_Type);

   generic
      with procedure Process
        (Iterator : in Iterator_Type) is <>;
   procedure Generic_Iteration
     (Container : in Container_Type);

private

   type Node_Type;
   type Node_Access is access Node_Type;

   procedure Set_Next
     (Node : Node_Access;
      Next : Node_Access);
   pragma Inline (Set_Next);

   function Next (Node : Node_Access) return Node_Access;
   pragma Inline (Next);

   procedure Free (X : in out Node_Access);
   pragma Inline (Free);

   function Hash (Node : Node_Access) return Hash_Type;
   pragma Inline (Hash);

   package Hash_Table_Types is
      new Charles.Hash_Tables (Node_Access, null);

   use Hash_Table_Types;

   type Container_Type is
      new Ada.Finalization.Controlled with record
         Hash_Table : Hash_Table_Type := (Buckets => null, Length => 0);
      end record;

   procedure Adjust (Container : in out Container_Type);

   procedure Finalize (Container : in out Container_Type);


   type Iterator_Type is
      record
         Node : Node_Access;
      end record;

   Null_Iterator : constant Iterator_Type := (Node => null);

end Charles.Multimaps.Ha​shed.Strings.Unbound​ed;





--------------------​--------------------​--------------------​---------
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/ matthewjheaney Matthew Heaney 2004-03-07 17:52:37 PST
Messages per page: