7fd59977 |
1 | -- File: Units_Unit.cdl |
2 | -- Created: Thu Oct 29 10:48:14 1992 |
3 | -- Author: Gilles DEBARBOUILLE |
4 | -- <gde@bravox> |
5 | ---Copyright: Matra Datavision 1992 |
6 | |
7 | class Unit from Units |
8 | |
9 | inherits |
10 | |
11 | TShared from MMgt |
12 | |
13 | ---Purpose: This class defines an elementary word contained in |
14 | -- a physical quantity. |
15 | |
16 | uses |
17 | |
18 | HAsciiString from TCollection, |
19 | AsciiString from TCollection, |
20 | HSequenceOfHAsciiString from TColStd, |
21 | Quantity from Units, |
22 | Token from Units |
23 | |
24 | |
25 | is |
26 | |
27 | Create(aname , asymbol : CString ; |
28 | avalue : Real ; |
29 | aquantity : any Quantity from Units) |
30 | |
31 | ---Level: Internal |
32 | |
33 | ---Purpose: Creates and returns a unit. <aname> is the name of |
34 | -- the unit, <asymbol> is the usual abbreviation of the |
35 | -- unit, and <avalue> is the value in relation to the |
36 | -- International System of Units. |
37 | |
38 | returns mutable Unit from Units; |
39 | |
40 | Create(aname , asymbol : CString) |
41 | |
42 | ---Level: Internal |
43 | |
44 | ---Purpose: Creates and returns a unit. <aname> is the name of |
45 | -- the unit, <asymbol> is the usual abbreviation of the |
46 | -- unit. |
47 | |
48 | returns mutable Unit from Units; |
49 | |
50 | Create(aname : CString) |
51 | |
52 | ---Level: Internal |
53 | |
54 | ---Purpose: Creates and returns a unit. <aname> is the name of |
55 | -- the unit. |
56 | |
57 | returns mutable Unit from Units; |
58 | |
59 | Name(me) returns AsciiString from TCollection |
60 | |
61 | ---Level: Internal |
62 | |
63 | ---C++: inline |
64 | |
65 | ---Purpose: Returns the name of the unit <thename> |
66 | |
67 | is static; |
68 | |
69 | Symbol(me : mutable ; asymbol : CString) |
70 | |
71 | ---Level: Internal |
72 | |
73 | ---Purpose: Adds a new symbol <asymbol> attached to <me>. |
74 | |
75 | is static; |
76 | |
77 | Value(me) returns Real |
78 | |
79 | ---Level: Internal |
80 | |
81 | ---C++: inline |
82 | |
83 | ---Purpose: Returns the value in relation with the International |
84 | -- System of Units. |
85 | |
86 | is static; |
87 | |
88 | Quantity(me) returns any Quantity from Units |
89 | |
90 | ---Level: Internal |
91 | |
92 | ---C++: inline |
93 | |
94 | ---Purpose: Returns <thequantity> contained in <me>. |
95 | |
96 | is static; |
97 | |
98 | SymbolsSequence(me) returns any HSequenceOfHAsciiString from TColStd |
99 | |
100 | ---Level: Internal |
101 | |
102 | ---C++: inline |
103 | |
104 | ---Purpose: Returns the sequence of symbols <thesymbolssequence> |
105 | |
106 | is static; |
107 | |
108 | Value(me : mutable ; avalue : Real) |
109 | |
110 | ---Level: Internal |
111 | |
112 | ---C++: inline |
113 | |
114 | ---Purpose: Sets the value <avalue> to <me>. |
115 | |
116 | is static; |
117 | |
118 | Quantity(me : mutable ; aquantity : any Quantity from Units) |
119 | |
120 | ---Level: Internal |
121 | |
122 | ---C++: inline |
123 | |
124 | ---Purpose: Sets the physical Quantity <aquantity> to <me>. |
125 | |
126 | is static; |
127 | |
128 | Token(me) returns mutable Token from Units |
129 | |
130 | ---Level: Internal |
131 | |
132 | ---Purpose: Starting with <me>, returns a new Token object. |
133 | |
134 | is virtual; |
135 | |
136 | IsEqual(me ; astring : CString) returns Boolean |
137 | |
138 | ---Level: Internal |
139 | |
140 | ---Purpose: Compares all the symbols linked within <me> with the |
141 | -- name of <atoken>, and returns True if there is one |
142 | -- symbol equal to the name, False otherwise. |
143 | |
144 | -- ---C++: alias "friend Standard_EXPORT Standard_Boolean operator ==(const Handle(Units_Unit)&,const Standard_CString);" |
145 | |
146 | is static; |
147 | |
148 | Dump(me ; ashift , alevel : Integer) |
149 | |
150 | ---Level: Internal |
151 | |
152 | ---Purpose: Useful for debugging |
153 | |
154 | is virtual; |
155 | |
156 | fields |
157 | |
158 | thename : HAsciiString from TCollection; |
159 | thesymbolssequence : HSequenceOfHAsciiString from TColStd is protected; |
160 | thevalue : Real is protected; |
161 | thequantity : Quantity from Units; |
162 | |
163 | end Unit; |
164 | |
165 | |
166 | |