0022627: Change OCCT memory management defaults
[occt.git] / src / RWStepBasic / RWStepBasic_RWDocumentUsageConstraint.cxx
1
2 #include <RWStepBasic_RWDocumentUsageConstraint.ixx>
3
4 #include <Interface_EntityIterator.hxx>
5
6
7 #include <StepBasic_Document.hxx>
8 #include <TCollection_HAsciiString.hxx>
9
10
11 RWStepBasic_RWDocumentUsageConstraint::RWStepBasic_RWDocumentUsageConstraint () {}
12
13 void RWStepBasic_RWDocumentUsageConstraint::ReadStep
14         (const Handle(StepData_StepReaderData)& data,
15          const Standard_Integer num,
16          Handle(Interface_Check)& ach,
17          const Handle(StepBasic_DocumentUsageConstraint)& ent) const
18 {
19
20
21         // --- Number of Parameter Control ---
22
23         if (!data->CheckNbParams(num,3,ach,"document_usage_constraint")) return;
24
25         // --- own field : source ---
26
27         Handle(StepBasic_Document) aSource;
28         //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
29         data->ReadEntity (num, 1,"source", ach, STANDARD_TYPE(StepBasic_Document), aSource);
30
31         // --- own field : label ---
32
33         Handle(TCollection_HAsciiString) aLabel;
34         //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
35         data->ReadString (num,2,"subject_element",ach,aLabel);
36
37         // --- own field : description ---
38
39         Handle(TCollection_HAsciiString) aDescription;
40         //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
41         data->ReadString (num,3,"subject_element_value",ach,aDescription);
42
43         //--- Initialisation of the read entity ---
44
45
46         ent->Init(aSource, aLabel, aDescription);
47 }
48
49
50 void RWStepBasic_RWDocumentUsageConstraint::WriteStep
51         (StepData_StepWriter& SW,
52          const Handle(StepBasic_DocumentUsageConstraint)& ent) const
53 {
54
55         // --- own field : id ---
56
57         SW.Send(ent->Source());
58
59         // --- own field : subject_element ---
60
61         SW.Send(ent->SubjectElement());
62
63         // --- own field : subject_element_value ---
64
65         SW.Send(ent->SubjectElementValue());
66 }
67
68
69 void RWStepBasic_RWDocumentUsageConstraint::Share(const Handle(StepBasic_DocumentUsageConstraint)& ent, Interface_EntityIterator& iter) const
70 {
71   iter.AddItem (ent->Source());
72 }