0024157: Parallelization of assembly part of BO
[occt.git] / src / RWStepBasic / RWStepBasic_RWAddress.cxx
1 // Copyright (c) 1999-2012 OPEN CASCADE SAS
2 //
3 // The content of this file is subject to the Open CASCADE Technology Public
4 // License Version 6.5 (the "License"). You may not use the content of this file
5 // except in compliance with the License. Please obtain a copy of the License
6 // at http://www.opencascade.org and read it completely before using this file.
7 //
8 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
10 //
11 // The Original Code and all software distributed under the License is
12 // distributed on an "AS IS" basis, without warranty of any kind, and the
13 // Initial Developer hereby disclaims all such warranties, including without
14 // limitation, any warranties of merchantability, fitness for a particular
15 // purpose or non-infringement. Please see the License for the specific terms
16 // and conditions governing the rights and limitations under the License.
17
18
19 #include <RWStepBasic_RWAddress.ixx>
20
21
22 RWStepBasic_RWAddress::RWStepBasic_RWAddress () {}
23
24 void RWStepBasic_RWAddress::ReadStep
25         (const Handle(StepData_StepReaderData)& data,
26          const Standard_Integer num,
27          Handle(Interface_Check)& ach,
28          const Handle(StepBasic_Address)& ent) const
29 {
30
31
32         // --- Number of Parameter Control ---
33
34         if (!data->CheckNbParams(num,12,ach,"address")) return;
35         // --- own field : internalLocation ---
36
37         Handle(TCollection_HAsciiString) aInternalLocation;
38         Standard_Boolean hasAinternalLocation = Standard_True;
39         if (data->IsParamDefined(num,1)) {
40           //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
41           data->ReadString (num,1,"internal_location",ach,aInternalLocation);
42         }
43         else {
44           hasAinternalLocation = Standard_False;
45           aInternalLocation.Nullify();
46         }
47
48         // --- own field : streetNumber ---
49
50         Handle(TCollection_HAsciiString) aStreetNumber;
51         Standard_Boolean hasAstreetNumber = Standard_True;
52         if (data->IsParamDefined(num,2)) {
53           //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
54           data->ReadString (num,2,"street_number",ach,aStreetNumber);
55         }
56         else {
57           hasAstreetNumber = Standard_False;
58           aStreetNumber.Nullify();
59         }
60
61         // --- own field : street ---
62
63         Handle(TCollection_HAsciiString) aStreet;
64         Standard_Boolean hasAstreet = Standard_True;
65         if (data->IsParamDefined(num,3)) {
66           //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
67           data->ReadString (num,3,"street",ach,aStreet);
68         }
69         else {
70           hasAstreet = Standard_False;
71           aStreet.Nullify();
72         }
73
74         // --- own field : postalBox ---
75
76         Handle(TCollection_HAsciiString) aPostalBox;
77         Standard_Boolean hasApostalBox = Standard_True;
78         if (data->IsParamDefined(num,4)) {
79           //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed
80           data->ReadString (num,4,"postal_box",ach,aPostalBox);
81         }
82         else {
83           hasApostalBox = Standard_False;
84           aPostalBox.Nullify();
85         }
86
87         // --- own field : town ---
88
89         Handle(TCollection_HAsciiString) aTown;
90         Standard_Boolean hasAtown = Standard_True;
91         if (data->IsParamDefined(num,5)) {
92           //szv#4:S4163:12Mar99 `Standard_Boolean stat5 =` not needed
93           data->ReadString (num,5,"town",ach,aTown);
94         }
95         else {
96           hasAtown = Standard_False;
97           aTown.Nullify();
98         }
99
100         // --- own field : region ---
101
102         Handle(TCollection_HAsciiString) aRegion;
103         Standard_Boolean hasAregion = Standard_True;
104         if (data->IsParamDefined(num,6)) {
105           //szv#4:S4163:12Mar99 `Standard_Boolean stat6 =` not needed
106           data->ReadString (num,6,"region",ach,aRegion);
107         }
108         else {
109           hasAregion = Standard_False;
110           aRegion.Nullify();
111         }
112
113         // --- own field : postalCode ---
114
115         Handle(TCollection_HAsciiString) aPostalCode;
116         Standard_Boolean hasApostalCode = Standard_True;
117         if (data->IsParamDefined(num,7)) {
118           //szv#4:S4163:12Mar99 `Standard_Boolean stat7 =` not needed
119           data->ReadString (num,7,"postal_code",ach,aPostalCode);
120         }
121         else {
122           hasApostalCode = Standard_False;
123           aPostalCode.Nullify();
124         }
125
126         // --- own field : country ---
127
128         Handle(TCollection_HAsciiString) aCountry;
129         Standard_Boolean hasAcountry = Standard_True;
130         if (data->IsParamDefined(num,8)) {
131           //szv#4:S4163:12Mar99 `Standard_Boolean stat8 =` not needed
132           data->ReadString (num,8,"country",ach,aCountry);
133         }
134         else {
135           hasAcountry = Standard_False;
136           aCountry.Nullify();
137         }
138
139         // --- own field : facsimileNumber ---
140
141         Handle(TCollection_HAsciiString) aFacsimileNumber;
142         Standard_Boolean hasAfacsimileNumber = Standard_True;
143         if (data->IsParamDefined(num,9)) {
144           //szv#4:S4163:12Mar99 `Standard_Boolean stat9 =` not needed
145           data->ReadString (num,9,"facsimile_number",ach,aFacsimileNumber);
146         }
147         else {
148           hasAfacsimileNumber = Standard_False;
149           aFacsimileNumber.Nullify();
150         }
151
152         // --- own field : telephoneNumber ---
153
154         Handle(TCollection_HAsciiString) aTelephoneNumber;
155         Standard_Boolean hasAtelephoneNumber = Standard_True;
156         if (data->IsParamDefined(num,10)) {
157           //szv#4:S4163:12Mar99 `Standard_Boolean stat10 =` not needed
158           data->ReadString (num,10,"telephone_number",ach,aTelephoneNumber);
159         }
160         else {
161           hasAtelephoneNumber = Standard_False;
162           aTelephoneNumber.Nullify();
163         }
164
165         // --- own field : electronicMailAddress ---
166
167         Handle(TCollection_HAsciiString) aElectronicMailAddress;
168         Standard_Boolean hasAelectronicMailAddress = Standard_True;
169         if (data->IsParamDefined(num,11)) {
170           //szv#4:S4163:12Mar99 `Standard_Boolean stat11 =` not needed
171           data->ReadString (num,11,"electronic_mail_address",ach,aElectronicMailAddress);
172         }
173         else {
174           hasAelectronicMailAddress = Standard_False;
175           aElectronicMailAddress.Nullify();
176         }
177
178         // --- own field : telexNumber ---
179
180         Handle(TCollection_HAsciiString) aTelexNumber;
181         Standard_Boolean hasAtelexNumber = Standard_True;
182         if (data->IsParamDefined(num,12)) {
183           //szv#4:S4163:12Mar99 `Standard_Boolean stat12 =` not needed
184           data->ReadString (num,12,"telex_number",ach,aTelexNumber);
185         }
186         else {
187           hasAtelexNumber = Standard_False;
188           aTelexNumber.Nullify();
189         }
190
191         //--- Initialisation of the read entity ---
192
193
194         ent->Init(hasAinternalLocation, aInternalLocation, hasAstreetNumber, aStreetNumber, hasAstreet, aStreet, hasApostalBox, aPostalBox, hasAtown, aTown, hasAregion, aRegion, hasApostalCode, aPostalCode, hasAcountry, aCountry, hasAfacsimileNumber, aFacsimileNumber, hasAtelephoneNumber, aTelephoneNumber, hasAelectronicMailAddress, aElectronicMailAddress, hasAtelexNumber, aTelexNumber);
195 }
196
197
198 void RWStepBasic_RWAddress::WriteStep
199         (StepData_StepWriter& SW,
200          const Handle(StepBasic_Address)& ent) const
201 {
202
203         // --- own field : internalLocation ---
204
205         Standard_Boolean hasAinternalLocation = ent->HasInternalLocation();
206         if (hasAinternalLocation) {
207           SW.Send(ent->InternalLocation());
208         }
209         else {
210           SW.SendUndef();
211         }
212
213         // --- own field : streetNumber ---
214
215         Standard_Boolean hasAstreetNumber = ent->HasStreetNumber();
216         if (hasAstreetNumber) {
217           SW.Send(ent->StreetNumber());
218         }
219         else {
220           SW.SendUndef();
221         }
222
223         // --- own field : street ---
224
225         Standard_Boolean hasAstreet = ent->HasStreet();
226         if (hasAstreet) {
227           SW.Send(ent->Street());
228         }
229         else {
230           SW.SendUndef();
231         }
232
233         // --- own field : postalBox ---
234
235         Standard_Boolean hasApostalBox = ent->HasPostalBox();
236         if (hasApostalBox) {
237           SW.Send(ent->PostalBox());
238         }
239         else {
240           SW.SendUndef();
241         }
242
243         // --- own field : town ---
244
245         Standard_Boolean hasAtown = ent->HasTown();
246         if (hasAtown) {
247           SW.Send(ent->Town());
248         }
249         else {
250           SW.SendUndef();
251         }
252
253         // --- own field : region ---
254
255         Standard_Boolean hasAregion = ent->HasRegion();
256         if (hasAregion) {
257           SW.Send(ent->Region());
258         }
259         else {
260           SW.SendUndef();
261         }
262
263         // --- own field : postalCode ---
264
265         Standard_Boolean hasApostalCode = ent->HasPostalCode();
266         if (hasApostalCode) {
267           SW.Send(ent->PostalCode());
268         }
269         else {
270           SW.SendUndef();
271         }
272
273         // --- own field : country ---
274
275         Standard_Boolean hasAcountry = ent->HasCountry();
276         if (hasAcountry) {
277           SW.Send(ent->Country());
278         }
279         else {
280           SW.SendUndef();
281         }
282
283         // --- own field : facsimileNumber ---
284
285         Standard_Boolean hasAfacsimileNumber = ent->HasFacsimileNumber();
286         if (hasAfacsimileNumber) {
287           SW.Send(ent->FacsimileNumber());
288         }
289         else {
290           SW.SendUndef();
291         }
292
293         // --- own field : telephoneNumber ---
294
295         Standard_Boolean hasAtelephoneNumber = ent->HasTelephoneNumber();
296         if (hasAtelephoneNumber) {
297           SW.Send(ent->TelephoneNumber());
298         }
299         else {
300           SW.SendUndef();
301         }
302
303         // --- own field : electronicMailAddress ---
304
305         Standard_Boolean hasAelectronicMailAddress = ent->HasElectronicMailAddress();
306         if (hasAelectronicMailAddress) {
307           SW.Send(ent->ElectronicMailAddress());
308         }
309         else {
310           SW.SendUndef();
311         }
312
313         // --- own field : telexNumber ---
314
315         Standard_Boolean hasAtelexNumber = ent->HasTelexNumber();
316         if (hasAtelexNumber) {
317           SW.Send(ent->TelexNumber());
318         }
319         else {
320           SW.SendUndef();
321         }
322 }