DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: ┃ T V ┃
Length: 9437 (0x24dd) Types: TextFile Names: »V«
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11 └─ ⟦129cab021⟧ »DATA« └─⟦this⟧ └─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04 └─ ⟦d65440be7⟧ »DATA« └─⟦this⟧
with Activity; with Directory_Tools; package Object_Sets is -- This package provides a set abstraction built on top of the "Object. -- Handle" and "Object.Iterator" abstractions of the "Directory_Tools" -- package. Standard set operations such as union and intersection are -- provided. In addition, operations are provided to create sets based -- on relationships between compilation units. -- -- Since the underlying representation of an object set is the same as -- an object iterator, operations from the "Directory_Tools" package may -- be freely applied to object sets, and vice versa. -- -- This package has a renaming package "Object_Sets_Renames" associated -- with it which allows the algebraic set operations defined in this -- package to be written as infix operators. -- -- Most operations in this package need to read more than one object -- during execution. No synchronization is used by these operations: they -- process only one object in a set at a time. This allows other users -- to access objects in a set while the set is being processed without a -- lock error occurring. There is the possibility, however, that another -- user's access will partially invalidate the results of an operation, -- and this needs to be taken into account. subtype Object is Directory_Tools.Object.Handle; subtype Object_Set is Directory_Tools.Object.Iterator; function Empty_Set return Object_Set; -- Returns a new set which contains no objects. function Is_Empty (This_Set : in Object_Set) return Boolean; function Number_In (This_Set : in Object_Set) return Natural; function Are_Equal (This_Set : in Object_Set; That_Set : in Object_Set) return Boolean; -- Returns True if the sets contain exactly the same objects. function Copy_Of (This_Set : in Object_Set) return Object_Set; function Is_Member (This_Set : in Object_Set; This_Object : in Object) return Boolean; procedure Add (This_Object : in Object; This_Set : in out Object_Set); -- Adds the object to the set. Does nothing if the object is already -- in the set. procedure Remove (This_Object : in Object; This_Set : in out Object_Set); -- Removes the object from the set. Does nothing if the object is not -- in the set. generic with function "<" (This_Object : in Object; That_Object : in Object) return Boolean; procedure Sort (This_Set : in out Object_Set); -- Sorts the objects in the specified set in accordance with the supplied -- "<" function. generic with function Dont_Want (This_Object : in Object) return Boolean; procedure Filter (This_Set : in out Object_Set); -- Removes objects from the specified set in accordance with the supplied -- function "Dont_Want". generic with procedure Process (This_Object : in out Object); procedure Process_Objects (This_Set : in out Object_Set); -- Applies the supplied processing procedure to all objects in the -- specified set. generic type Process_State is private; with procedure Initialize (This_State : in out Process_State); with procedure Process (This_Object : in out Object; This_State : in out Process_State); with procedure Finalize (This_State : in out Process_State); procedure Process_Objects_With_State (This_Set : in out Object_Set; This_State : in out Process_State); -- Applies the supplied processing procedure to all objects in the -- specified set while preserving state information in a state variable -- controlled by the client. -- ALGEBRAIC OPERATIONS: function Union (This_Set : in Object_Set; That_Set : in Object_Set) return Object_Set; -- Returns a new set which is the union of the two sets. function Intersection (This_Set : in Object_Set; That_Set : in Object_Set) return Object_Set; -- Returns a new set which is the intersection of the two sets. function Exclusive_Or (This_Set : in Object_Set; That_Set : in Object_Set) return Object_Set; -- Returns a new set which is the exclusive-or of the two sets. function Subtraction (This_Set : in Object_Set; Except_For : in Object_Set) return Object_Set; -- Returns a new set which contains all objects in the first set -- except for those which are also in the second set. function Subset (This_Set : in Object_Set; Contains : in Object_Set) return Boolean; -- Returns True if the second set is a subset of the first set. function Proper_Subset (This_Set : in Object_Set; Contains : in Object_Set) return Boolean; -- Returns True if the second set is a proper subset of the first set. -- CLOSURE OPERATIONS: -- The operations in this section create object sets based on the -- dependency relationships between Ada units. There are several -- parameters common to these operations: -- -- * Specs_Only: -- -- When this parameter is True, only Ada specs will be included. -- -- * Transitive: -- -- When this parameter is True, an object set will be generated -- using transitive closure (if 'A' depends on 'B', and 'B' -- depends on 'C', then 'A' depends on 'C' transitively). -- -- * Include_Universe_Mirrors: -- -- When this parameter is True, Ada specs which are an integral -- part of the Rational Environment will be included. -- -- * Code_Share_Generics: -- -- When this parameter is True, generic instantiations will be -- analyzed using a code-sharing model (as on the R1000). -- -- When this parameter is False, generic instantiations will be -- analyzed using a macro in-line expansion model (as on a VAX). -- -- * This_Activity: -- -- This parameter allows the client to specify which activity should -- be used when subsystems are involved. In the default case, the -- activity is empty and dependencies will not cross view boundaries. function Dependencies_On (Unit : in Object; Specs_Only : in Boolean := False; Transitive : in Boolean := True; Include_Universe_Mirrors : in Boolean := False; Code_Share_Generics : in Boolean := True; This_Activity : in Activity.Activity_Name := Activity.Nil) return Object_Set; -- Returns a set containing every object which depends on the specified -- unit. If the unit is a spec in a load view, the dependencies on the -- corresponding spec in the spec view will be added to the closure. function Dependencies_On (Units : in Object_Set; Specs_Only : in Boolean := False; Transitive : in Boolean := True; Include_Universe_Mirrors : in Boolean := False; Code_Share_Generics : in Boolean := True; This_Activity : in Activity.Activity_Name := Activity.Nil) return Object_Set; function Dependencies_By (Unit : in Object; Specs_Only : in Boolean := False; Transitive : in Boolean := True; Include_Universe_Mirrors : in Boolean := False; Code_Share_Generics : in Boolean := True; This_Activity : in Activity.Activity_Name := Activity.Nil) return Object_Set; -- Returns a set containing every object which is depended upon by the -- specified unit. If the object depends upon a spec in a spec view, -- the corresponding spec in the load view will be added to the closure. function Dependencies_By (Units : in Object_Set; Specs_Only : in Boolean := False; Transitive : in Boolean := True; Include_Universe_Mirrors : in Boolean := False; Code_Share_Generics : in Boolean := True; This_Activity : in Activity.Activity_Name := Activity.Nil) return Object_Set; function Withed_Objects (Unit : in Object) return Object_Set; -- Returns a set containing the objects in the WITH clause(s) -- of the specified unit. function Family (Unit : in Object; This_Activity : in Activity.Activity_Name := Activity.Nil) return Object_Set; -- Returns a set containing the objects in the "family" of the specified -- unit. A family is defined as follows: -- -- For a subunit: the subunit itself, and the transitive -- closure of all subunits of the subunit. -- -- For a body: the body itself, all subunits of the body, -- and the families of those subunits. -- -- For an ordinary spec: the spec itself, the body associated -- with the spec, and the family of the body. -- -- For a spec in a spec view: the family of the corresponding -- spec in the load view specified in the activity. end Object_Sets;