0022627: Change OCCT memory management defaults
[occt.git] / src / RWStepBasic / RWStepBasic_RWOrganization.cxx
CommitLineData
7fd59977 1//gka 05.03.99 S4134 upgrade from CD to DIS
2#include <RWStepBasic_RWOrganization.ixx>
3
4
5RWStepBasic_RWOrganization::RWStepBasic_RWOrganization () {}
6
7void RWStepBasic_RWOrganization::ReadStep
8 (const Handle(StepData_StepReaderData)& data,
9 const Standard_Integer num,
10 Handle(Interface_Check)& ach,
11 const Handle(StepBasic_Organization)& ent) const
12{
13
14
15 // --- Number of Parameter Control ---
16
17 if (!data->CheckNbParams(num,3,ach,"organization")) return;
18
19 // --- own field : id ---
20
21 Handle(TCollection_HAsciiString) aId;
22 Standard_Boolean hasAid = Standard_True;
23 if (data->IsParamDefined(num,1)) {
24 //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
25 data->ReadString (num,1,"id",ach,aId);
26 }
27 else {
28 hasAid = Standard_False;
29 aId.Nullify();
30 }
31
32 // --- own field : name ---
33
34 Handle(TCollection_HAsciiString) aName;
35 //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
36 data->ReadString (num,2,"name",ach,aName);
37
38 // --- own field : description ---
39
40 Handle(TCollection_HAsciiString) aDescription;
41 if (data->IsParamDefined (num,3)) { //gka 05.03.99 S4134 upgrade from CD to DIS
42 //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
43 data->ReadString (num,3,"description",ach,aDescription);
44 }
45 //--- Initialisation of the read entity ---
46
47
48 ent->Init(hasAid, aId, aName, aDescription);
49}
50
51
52void RWStepBasic_RWOrganization::WriteStep
53 (StepData_StepWriter& SW,
54 const Handle(StepBasic_Organization)& ent) const
55{
56
57 // --- own field : id ---
58
59 Standard_Boolean hasAid = ent->HasId();
60 if (hasAid) {
61 SW.Send(ent->Id());
62 }
63 else {
64 SW.SendUndef();
65 }
66
67 // --- own field : name ---
68
69 SW.Send(ent->Name());
70
71 // --- own field : description ---
72
73 SW.Send(ent->Description());
74}