2 -- File: Aspect_GenId.cdl
3 -- Created: Mercredi 13 Mai 1992
6 ---Copyright: MatraDatavision 1991,1992,1993
9 class GenId from Aspect
14 ---Purpose: This class permits the creation and control of all
16 -- Warning: An identifier is an integer.
22 ListOfInteger from TColStd
26 IdentDefinitionError from Aspect
31 returns GenId from Aspect;
33 ---Purpose: Creates an available set of identifiers with the lower
34 -- bound 0 and the upper bound INT_MAX/2.
36 Create ( Low, Up : Integer from Standard )
37 returns GenId from Aspect
39 ---Purpose: Creates an available set of identifiers with the lower
40 -- bound <Low> and the upper bound <Up>.
41 -- Warning: Raises IdentDefinitionError if <Up> is less than <Low>.
42 raises IdentDefinitionError from Aspect;
44 ---------------------------------------------------
45 -- Category: Methods to modify the class definition
46 ---------------------------------------------------
48 --Assign ( me : in out;
49 --Other : GenId from Aspect );
51 ---Purpose: Copies the content of <Other> into <me>.
52 ---Category: Methods to modify the class definition
53 -- C++: alias operator =
57 ---Purpose: Frees all identifiers of <me>.
58 ---Category: Methods to modify the class definition
61 Id : Integer from Standard );
63 ---Purpose: Frees the identifier <Id> of <me>.
64 ---Category: Methods to modify the class definition
66 ----------------------------
67 -- Category: Inquire methods
68 ----------------------------
71 returns Integer from Standard;
73 ---Purpose: Returns the number of available identifiers of <me>.
74 ---Category: Inquire methods
77 returns Integer from Standard;
79 ---Purpose: Returns the lower bound of <me>.
80 ---Category: Inquire methods
83 returns Integer from Standard
85 ---Purpose: Returns an available identifier of <me>.
86 -- Warning: Raises IdentDefinitionError if all identifiers are busy.
87 raises IdentDefinitionError from Aspect;
90 returns Integer from Standard;
92 ---Purpose: Returns the upper bound of <me>.
93 ---Category: Inquire methods
100 -- Class : Aspect_GenId
102 -- Purpose : Declaration of variables specific to identifiers
104 -- Reminder : An identifier is an integer
107 -- the current number of available identifiers
108 MyCount : Integer from Standard;
110 -- the number of identifiers
111 MyLength : Integer from Standard;
113 -- the limits for identifiers
114 MyLowerBound : Integer from Standard;
115 MyUpperBound : Integer from Standard;
117 -- to save free identifiers
118 MyFreeIds : ListOfInteger from TColStd;