Ada Programming/Libraries/Container/Booch

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Ada. Time-tested, safe and secure.

Library functions[edit | edit source]

Bags[edit | edit source]

Collections[edit | edit source]

Ordered[edit | edit source]

Dequeues[edit | edit source]

Graphs[edit | edit source]

Directed[edit | edit source]

Undirected[edit | edit source]

Lists[edit | edit source]

Single[edit | edit source]

Double[edit | edit source]

Maps[edit | edit source]

Queues[edit | edit source]

Ordered[edit | edit source]

Rings[edit | edit source]

Sets[edit | edit source]

Stacks[edit | edit source]

Trees[edit | edit source]

AVL[edit | edit source]

Binary[edit | edit source]

Multiway[edit | edit source]

Library links[edit | edit source]

Simon Wright
Project Info
CVS Archive

Sample code[edit | edit source]

Read the project tutorial for full detail.

with Ada.Calendar;
with Ada.Strings.Bounded;

package Cars is

   package Plate_Strings
     is new Ada.Strings.Bounded.Generic_Bounded_Length (10);
   subtype Plate_String is Plate_Strings.Bounded_String;

   package Model_Strings
     is new Ada.Strings.Bounded.Generic_Bounded_Length (32);
   subtype Model_String is Model_Strings.Bounded_String;

   type Car is 
         Plate : Plate_String;
         Model : Model_String;
         Registered : Ada.Calendar.Time;
      end record;

end Cars;
with BC.Containers.Collections.Bounded;
with Cars;
package My_Fleet_Combined is

   use type Cars.Car;

   package Abstract_Car_Containers 
     is new BC.Containers (Cars.Car);

   package Abstract_Car_Collections 
     is new Abstract_Car_Containers.Collections;

   package Fleets 
     is new Abstract_Car_Collections.Bounded (Maximum_Size => 30);

   The_Fleet : Fleets.Collection;

end My_Fleet_Combined;

See also[edit | edit source]

Wikibook[edit | edit source]