0022627: Change OCCT memory management defaults
[occt.git] / src / RWStepAP203 / RWStepAP203_RWCcDesignDateAndTimeAssignment.cxx
CommitLineData
7fd59977 1// File: RWStepAP203_RWCcDesignDateAndTimeAssignment.cxx
2// Created: Fri Nov 26 16:26:32 1999
3// Author: Andrey BETENEV
4// Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.0
5// Copyright: Matra Datavision 1999
6
7#include <RWStepAP203_RWCcDesignDateAndTimeAssignment.ixx>
8#include <StepAP203_HArray1OfDateTimeItem.hxx>
9#include <StepAP203_DateTimeItem.hxx>
10
11//=======================================================================
12//function : RWStepAP203_RWCcDesignDateAndTimeAssignment
13//purpose :
14//=======================================================================
15
16RWStepAP203_RWCcDesignDateAndTimeAssignment::RWStepAP203_RWCcDesignDateAndTimeAssignment ()
17{
18}
19
20//=======================================================================
21//function : ReadStep
22//purpose :
23//=======================================================================
24
25void RWStepAP203_RWCcDesignDateAndTimeAssignment::ReadStep (const Handle(StepData_StepReaderData)& data,
26 const Standard_Integer num,
27 Handle(Interface_Check)& ach,
28 const Handle(StepAP203_CcDesignDateAndTimeAssignment) &ent) const
29{
30 // Check number of parameters
31 if ( ! data->CheckNbParams(num,3,ach,"cc_design_date_and_time_assignment") ) return;
32
33 // Inherited fields of DateAndTimeAssignment
34
35 Handle(StepBasic_DateAndTime) aDateAndTimeAssignment_AssignedDateAndTime;
36 data->ReadEntity (num, 1, "date_and_time_assignment.assigned_date_and_time", ach, STANDARD_TYPE(StepBasic_DateAndTime), aDateAndTimeAssignment_AssignedDateAndTime);
37
38 Handle(StepBasic_DateTimeRole) aDateAndTimeAssignment_Role;
39 data->ReadEntity (num, 2, "date_and_time_assignment.role", ach, STANDARD_TYPE(StepBasic_DateTimeRole), aDateAndTimeAssignment_Role);
40
41 // Own fields of CcDesignDateAndTimeAssignment
42
43 Handle(StepAP203_HArray1OfDateTimeItem) aItems;
44 Standard_Integer sub3 = 0;
45 if ( data->ReadSubList (num, 3, "items", ach, sub3) ) {
46 Standard_Integer num2 = sub3;
47 Standard_Integer nb0 = data->NbParams(num2);
48 aItems = new StepAP203_HArray1OfDateTimeItem (1, nb0);
49 for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
50 StepAP203_DateTimeItem anIt0;
51 data->ReadEntity (num2, i0, "items", ach, anIt0);
52 aItems->SetValue(i0, anIt0);
53 }
54 }
55
56 // Initialize entity
57 ent->Init(aDateAndTimeAssignment_AssignedDateAndTime,
58 aDateAndTimeAssignment_Role,
59 aItems);
60}
61
62//=======================================================================
63//function : WriteStep
64//purpose :
65//=======================================================================
66
67void RWStepAP203_RWCcDesignDateAndTimeAssignment::WriteStep (StepData_StepWriter& SW,
68 const Handle(StepAP203_CcDesignDateAndTimeAssignment) &ent) const
69{
70
71 // Inherited fields of DateAndTimeAssignment
72
73 SW.Send (ent->StepBasic_DateAndTimeAssignment::AssignedDateAndTime());
74
75 SW.Send (ent->StepBasic_DateAndTimeAssignment::Role());
76
77 // Own fields of CcDesignDateAndTimeAssignment
78
79 SW.OpenSub();
80 for (Standard_Integer i2=1; i2 <= ent->Items()->Length(); i2++ ) {
81 StepAP203_DateTimeItem Var0 = ent->Items()->Value(i2);
82 SW.Send (Var0.Value());
83 }
84 SW.CloseSub();
85}
86
87//=======================================================================
88//function : Share
89//purpose :
90//=======================================================================
91
92void RWStepAP203_RWCcDesignDateAndTimeAssignment::Share (const Handle(StepAP203_CcDesignDateAndTimeAssignment) &ent,
93 Interface_EntityIterator& iter) const
94{
95
96 // Inherited fields of DateAndTimeAssignment
97
98 iter.AddItem (ent->StepBasic_DateAndTimeAssignment::AssignedDateAndTime());
99
100 iter.AddItem (ent->StepBasic_DateAndTimeAssignment::Role());
101
102 // Own fields of CcDesignDateAndTimeAssignment
103
104 for (Standard_Integer i3=1; i3 <= ent->Items()->Length(); i3++ ) {
105 StepAP203_DateTimeItem Var0 = ent->Items()->Value(i3);
106 iter.AddItem (Var0.Value());
107 }
108}