< Ada Programming < Libraries < Container
Library functions
Bags
Collections
Ordered
Dequeues
Graphs
Directed
Undirected
Lists
Single
Double
Maps
Queues
Ordered
Rings
Sets
Stacks
Trees
AVL
Binary
Multiway
Library links
- Author
- Simon Wright
- Homepage
- http://booch95.sourceforge.net
- Tutorial
- http://booch95.sourceforge.net/case-study.html
- Project Info
- http://sourceforge.net/projects/booch95
- CVS Archive
- http://sourceforge.net/cvs/?group_id=135616
- Download
- http://sourceforge.net/project/showfiles.php?group_id=135616
Sample code
Read the project tutorial for full detail.
with
Ada.Calendar;with
Ada.Strings.Bounded;package
Carsis
package
Plate_Stringsis
new
Ada.Strings.Bounded.Generic_Bounded_Length (10);subtype
Plate_Stringis
Plate_Strings.Bounded_String;package
Model_Stringsis
new
Ada.Strings.Bounded.Generic_Bounded_Length (32);subtype
Model_Stringis
Model_Strings.Bounded_String;type
Caris
record
Plate : Plate_String; Model : Model_String; Registered : Ada.Calendar.Time;end
record
;end
Cars;
with
BC.Containers.Collections.Bounded;with
Cars;package
My_Fleet_Combinedis
use
type
Cars.Car;package
Abstract_Car_Containersis
new
BC.Containers (Cars.Car);package
Abstract_Car_Collectionsis
new
Abstract_Car_Containers.Collections;package
Fleetsis
new
Abstract_Car_Collections.Bounded (Maximum_Size => 30); The_Fleet : Fleets.Collection;end
My_Fleet_Combined;
See also
Wikibook
Ada Reference Manual
—none apply --
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.