0022627: Change OCCT memory management defaults
[occt.git] / src / RWStepBasic / RWStepBasic_RWWeekOfYearAndDayDate.cxx
1
2 #include <RWStepBasic_RWWeekOfYearAndDayDate.ixx>
3
4
5 RWStepBasic_RWWeekOfYearAndDayDate::RWStepBasic_RWWeekOfYearAndDayDate () {}
6
7 void RWStepBasic_RWWeekOfYearAndDayDate::ReadStep
8         (const Handle(StepData_StepReaderData)& data,
9          const Standard_Integer num,
10          Handle(Interface_Check)& ach,
11          const Handle(StepBasic_WeekOfYearAndDayDate)& ent) const
12 {
13
14
15         // --- Number of Parameter Control ---
16
17         if (!data->CheckNbParams(num,3,ach,"week_of_year_and_day_date")) return;
18
19         // --- inherited field : yearComponent ---
20
21         Standard_Integer aYearComponent;
22         //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
23         data->ReadInteger (num,1,"year_component",ach,aYearComponent);
24
25         // --- own field : weekComponent ---
26
27         Standard_Integer aWeekComponent;
28         //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
29         data->ReadInteger (num,2,"week_component",ach,aWeekComponent);
30
31         // --- own field : dayComponent ---
32
33         Standard_Integer aDayComponent;
34         Standard_Boolean hasAdayComponent = Standard_True;
35         if (data->IsParamDefined(num,3)) {
36           //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
37           data->ReadInteger (num,3,"day_component",ach,aDayComponent);
38         }
39         else {
40           hasAdayComponent = Standard_False;
41           aDayComponent = 0;
42         }
43
44         //--- Initialisation of the read entity ---
45
46
47         ent->Init(aYearComponent, aWeekComponent, hasAdayComponent, aDayComponent);
48 }
49
50
51 void RWStepBasic_RWWeekOfYearAndDayDate::WriteStep
52         (StepData_StepWriter& SW,
53          const Handle(StepBasic_WeekOfYearAndDayDate)& ent) const
54 {
55
56         // --- inherited field yearComponent ---
57
58         SW.Send(ent->YearComponent());
59
60         // --- own field : weekComponent ---
61
62         SW.Send(ent->WeekComponent());
63
64         // --- own field : dayComponent ---
65
66         Standard_Boolean hasAdayComponent = ent->HasDayComponent();
67         if (hasAdayComponent) {
68           SW.Send(ent->DayComponent());
69         }
70         else {
71           SW.SendUndef();
72         }
73 }