B.2 Package Ada and Children

[ Table of Contents ] Prev ] Chapter Overview ] Next ] [Glossary/Index ]

Package Ada and the library units that are descended from it comprise a large portion of the predefined environment.

The code representing the declaration of package Ada.Calendar is shown at the end of this section. (See [ARM95] for the other predefined package declarations.)

This diagram depicts a minor fraction of the public children and grandchildren of package Ada. (There are approximately 60 altogether.) We have selected those that have been included in example programs of this volume. Note that Ada.Text_IO exports several generic packages (not shown) named Integer_IO, Float_IO, Fixed_IO, and Enumeration_IO, which can be instantiated to provide input/output services for various user-defined types.

You can click the boxes in the diagram to jump to corresponding Glossary/Index entries -- except for the green box labeled Calendar -- clicking it takes you to the code (below), which is the declaration of package Ada.Calendar.

ImB-3.gif (4776 bytes)

The following table lists the entire set of descendents of package Ada, and provides page references to relevant example programs in this volume. As you can see, we have illustrated only a small fraction of the capabilities provided by this section of the predefined environment.

Library Package

See Pages:

Ada.Asynchronous_Task_Control
Ada.Calendar  ---------------------------
Ada.Characters
Ada.Characters.Handling
Ada.Characters.Latin_1
Ada.Command_Line
Ada.Decimal
Ada.Direct_IO
Ada.Dynamic_Priorities
Ada.Exceptions
Ada.Finalization  -------------------------
Ada.Float_Text_IO  ---------------------
Ada.Float_Wide_Text_IO
Ada.Integer_Text_IO  -------------------
Ada.Integer_Wide_Text_IO
Ada.Interrupts
Ada.Interrupts.Names
Ada.Numerics  ----------------------
Ada.Numerics.Complex_Elementary_Functions
Ada.Numerics.Complex_Types
Ada.Numerics.Discrete_Random  ---------- Ada.Numerics.Elementary_Functions   ------
Ada.Numerics.Float_Random Ada.Numerics.Generic_Complex_Elementary_Functions
Ada.Numerics.Generic_Complex_Type
Ada.Numerics.Generic_Elementary_Functions
Ada.Real_Time
Ada.Sequential_IO
Ada.Storage_IO
Ada.Streams
Ada.Streams.Stream_IO
Ada.Strings  -------------------------------
Ada.Strings.Bounded
Ada.Strings.Fixed  -------------------------
Ada.Strings.Maps
Ada.Strings.Maps.Constants
Ada.Strings.Unbounded
Ada.Strings.Wide_Bounded
Ada.Strings.Wide_Fixed
Ada.Strings.Wide_Maps
Ada.Strings.Wide_Maps.Wide_Constants
Ada.Strings.Wide_Unbounded
Ada.Synchronous_Task_Control
Ada.Tags
Ada.Task_Attributes
Ada.Task_Identification
Ada.Text_IO  -----------------------------
Ada.Text_IO.Complex_IO
Ada.Text_IO.Editing
Ada.Text_IO.Text_Streams
Ada.Unchecked_Conversion
Ada.Unchecked_Deallocation  -------------
Ada.Wide_Text_IO
Ada.Wide_Text_IO.Complex_IO
Ada.Wide_Text_IO.Editing
Ada.Wide_Text_IO.Text_Streams

1.2, 1.3, 1.4, 3.4, 3.11, 6.1








5.7
2.4, 2.5, 2.13

2.13, 3.6, 3.8, 4.9



3.13, 4.12


3.13
4.12









4.7

4.7












1.1, 1.2, ... and many others




4.10



-

Source Code Listing

---------------------------------------------------------------
--  Package Calendar supplies ways to manipulate values of type 
--  Time and Duration. Time, a private type defined here, 
--  varies from the first day of 1901 to the last day of 2099. 
--  Duration, defined in package Standard, represents the 
--  difference between two values of Time. The Clock function 
--  returns the current value of Time. 
---------------------------------------------------------------
package Ada.Calendar is
  type Time is private;
  subtype Year_Number  is Integer range 1901 ..  2099;
  subtype Month_Number is Integer range 1 ..  12;
  subtype Day_Number   is Integer range 1 ..  31;
  subtype Day_Duration is Duration range 0.0 ..  86_400.0;

  function Clock return Time;
  function Year   (Date : Time) return Year_Number;
  function Month  (Date : Time) return Month_Number;
  function Day    (Date : Time) return Day_Number;
  function Seconds(Date : Time) return Day_Duration;

  procedure Split (Date    : in Time;
	           Year    : out Year_Number;
	           Month   : out Month_Number;
	           Day     : out Day_Number;
	           Seconds : out Day_Duration);
  function Time_Of(Year    : Year_Number;
	           Month   : Month_Number;
	           Day     : Day_Number;
	           Seconds : Day_Duration := 0.0)
    return Time;

  function "+" (Left : Time;   Right : Duration) return Time;
  function "+" (Left : Duration; Right : Time) return Time;
  function "–" (Left : Time;   Right : Duration) return Time;
  function "–" (Left : Time;   Right : Time) return Duration;
  function "<" (Left, Right : Time) return Boolean;
  function "<="(Left, Right : Time) return Boolean;
  function ">" (Left, Right : Time) return Boolean;
  function ">="(Left, Right : Time) return Boolean;

  Time_Error : exception;
private
  -- implementation dependent
end Ada.Calendar;
---------------------------------------------------------------

[ Back to top of pagePrev ] Next ]