|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - download
Length: 13312 (0x3400) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, package Values, seg_044e9a
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« └─⟦this⟧
------------------------------------------------------------------------ -- <UNIT> Values ------------------------------------------------------------------------ -- -- <DESCRIPTION> Allow dynamic creation of data type Natural, Boolean or string -- -- !!!!Danger : Dynamic object must be initialized with New_Value -- Dynamic object must be de-allocated after usage with Dispose -- -- <AUTHOR> Barthe Raphael, Beck Didier, Kempe Laurent -- <VERSION> 1.0 -- <DATE> 24-jan-95 -- <MODIFY> 24-jan-95 -- -- <PKG USED> Bounded_String,Text_io. ------------------------------------------------------------------------ with Bounded_String, Text_Io; package Values is subtype My_String is Bounded_String.Variable_String (128); -- exception No_Natural_Value : exception; No_Boolean_Value : exception; No_String_Value : exception; type Kind_Of_Values is (Undefine_Value, Natural_Value, Boolean_Value, String_Value); -- use of limited type in order to forbid the egal operation -- we have to redefine a fonction to copy two elements type Value (Kind : Kind_Of_Values := Undefine_Value) is limited private; -- creation -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> New_Value -- -- <DESCRIPTION> create an undefine value -- -- <PARAMETERS> V (Value) : for creating an undefine object -- -- <EXCEPTIONS> Nothing -- -------------------------------------------------------------------------------- procedure New_Value (V : out Value); -- access -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Kind_Of -- -- <DESCRIPTION> return the type of the value -- -- <PARAMETERS> V (Value) -- -- <EXCEPTIONS> Nothing -- -------------------------------------------------------------------------------- function Kind_Of (V : in Value) return Kind_Of_Values; -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Value_As -- -- <DESCRIPTION> return the value of the data (for natural) -- -- <PARAMETERS> V (Value) -- -- <EXCEPTIONS> No_Natural_Value -- -------------------------------------------------------------------------------- function Value_As (V : in Value) return Natural; -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Value_As -- -- <DESCRIPTION> return the value of the data (for boolean) -- -- <PARAMETERS> V (Value) -- -- <EXCEPTIONS> No_Boolean_Value -- -------------------------------------------------------------------------------- function Value_As (V : in Value) return Boolean; -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Value_As -- -- <DESCRIPTION> return the value of the data (for string) -- -- <PARAMETERS> V (Value) -- -- <EXCEPTIONS> No_String_Value -- -------------------------------------------------------------------------------- function Value_As (V : in Value) return String; -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Equal -- -- <DESCRIPTION> test between two values; return a boolean -- -- <PARAMETERS> V1 (Value), V2 (Value) : make a comparaison between V1 and V2 -- -- <EXCEPTIONS> Nothing -- -------------------------------------------------------------------------------- function Equal (V1 : in Value; V2 : in Value) return Boolean; --------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Image -- -- <DESCRIPTION> Give the string of a value -- -- <PARAMETERS> V (Value) -- -- <EXCEPTIONS> Nothing -- -------------------------------------------------------------------------------- function Image (V : in Value) return String; -- modification -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Undefine -- -- <DESCRIPTION> deallocation and creation of a new undefine object -- -- <PARAMETERS> V (Value) -- -- <EXCEPTIONS> Nothing -- -------------------------------------------------------------------------------- procedure Undefine (V : in out Value); -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Set_To -- -- <DESCRIPTION> initialize a value -- -- <PARAMETERS> V (Value), B (Boolean) : change V in a natural I -- -- <EXCEPTIONS> Nothing -- -------------------------------------------------------------------------------- procedure Set_To (V : in out Value; I : in Natural); -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Set_To -- -- <DESCRIPTION> initialize a value -- -- <PARAMETERS> V (Value), B (Boolean) : change V in a boolean B -- -- <EXCEPTIONS> Nothing -- -------------------------------------------------------------------------------- procedure Set_To (V : in out Value; B : in Boolean); -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Set_To -- -- <DESCRIPTION> initialize a value -- -- <PARAMETERS> V (Value), S (String) : change V in a string S -- -- <EXCEPTIONS> Nothing -- -------------------------------------------------------------------------------- procedure Set_To (V : in out Value; S : in String); -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Copy -- -- <DESCRIPTION> copy between two values; usefull because we haven't "=" ! -- -- <PARAMETERS> To_Value (Value), The_Value (Value) : copy The_Value in To_Value -- -- <EXCEPTIONS> Nothing -- -------------------------------------------------------------------------------- procedure Copy (To_Value : in out Value; The_Value : in Value); -- liberation -------------------------------------------------------------------------------- -- <SUBPROGRAM> -- <UNIT> Dispose -- -- <DESCRIPTION> liberate the memory which was allocated -- -- <PARAMETERS> V (Value) -- -- <EXCEPTIONS> Nothing -- -------------------------------------------------------------------------------- procedure Dispose (V : in out Value); -- definition of the abstract data type private type Value (Kind : Kind_Of_Values := Undefine_Value) is record case Kind is when Undefine_Value => null; when Natural_Value => The_Natural : Natural; when Boolean_Value => The_Boolean : Boolean; when String_Value => The_String : My_String; end case; end record; end Values;
nblk1=c nid=b hdr6=12 [0x00] rec0=1f rec1=00 rec2=01 rec3=056 [0x01] rec0=24 rec1=00 rec2=07 rec3=03e [0x02] rec0=20 rec1=00 rec2=04 rec3=070 [0x03] rec0=21 rec1=00 rec2=09 rec3=004 [0x04] rec0=25 rec1=00 rec2=08 rec3=01c [0x05] rec0=20 rec1=00 rec2=0a rec3=01e [0x06] rec0=04 rec1=00 rec2=05 rec3=068 [0x07] rec0=25 rec1=00 rec2=06 rec3=014 [0x08] rec0=07 rec1=00 rec2=03 rec3=000 [0x09] rec0=e9 rec1=0c rec2=6e rec3=653 [0x0a] rec0=db rec1=92 rec2=60 rec3=000 [0x0b] rec0=9d rec1=00 rec2=00 rec3=000 tail 0x217463e4286467b53f5b8 0x42a00088462060003 Free Block Chain: 0xb: 0000 00 02 00 35 80 2a 53 65 74 5f 54 6f 20 28 56 20 ┆ 5 *Set_To (V ┆ 0x2: 0000 00 0c 03 fc 80 41 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ┆ A----------┆ 0xc: 0000 00 00 00 06 80 03 2d 2d 2d 03 00 00 00 00 00 6c ┆ --- l┆