Warnings on vc14 were eliminated
[occt.git] / src / RWStepAP214 / RWStepAP214_RWAutoDesignActualDateAndTimeAssignment.cxx
1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14
15 #include <Interface_Check.hxx>
16 #include <Interface_EntityIterator.hxx>
17 #include <RWStepAP214_RWAutoDesignActualDateAndTimeAssignment.hxx>
18 #include <StepAP214_AutoDesignActualDateAndTimeAssignment.hxx>
19 #include <StepAP214_AutoDesignDateAndTimeItem.hxx>
20 #include <StepAP214_HArray1OfAutoDesignDateAndTimeItem.hxx>
21 #include <StepBasic_DateAndTime.hxx>
22 #include <StepBasic_DateTimeRole.hxx>
23 #include <StepData_StepReaderData.hxx>
24 #include <StepData_StepWriter.hxx>
25
26 RWStepAP214_RWAutoDesignActualDateAndTimeAssignment::RWStepAP214_RWAutoDesignActualDateAndTimeAssignment () {}
27
28 void RWStepAP214_RWAutoDesignActualDateAndTimeAssignment::ReadStep
29         (const Handle(StepData_StepReaderData)& data,
30          const Standard_Integer num,
31          Handle(Interface_Check)& ach,
32          const Handle(StepAP214_AutoDesignActualDateAndTimeAssignment)& ent) const
33 {
34
35
36         // --- Number of Parameter Control ---
37
38         if (!data->CheckNbParams(num,3,ach,"auto_design_actual_date_and_time_assignment")) return;
39
40         // --- inherited field : assignedDateAndTime ---
41
42         Handle(StepBasic_DateAndTime) aAssignedDateAndTime;
43     data->ReadEntity(num, 1,"assigned_date_and_time", ach, STANDARD_TYPE(StepBasic_DateAndTime), aAssignedDateAndTime);
44
45         // --- inherited field : role ---
46
47         Handle(StepBasic_DateTimeRole) aRole;
48     data->ReadEntity(num, 2,"role", ach, STANDARD_TYPE(StepBasic_DateTimeRole), aRole);
49
50         // --- own field : items ---
51
52         Handle(StepAP214_HArray1OfAutoDesignDateAndTimeItem) aItems;
53         StepAP214_AutoDesignDateAndTimeItem aItemsItem;
54         Standard_Integer nsub3;
55         if (data->ReadSubList(num,3,"items",ach,nsub3)) {
56           Standard_Integer nb3 = data->NbParams(nsub3);
57           aItems = new StepAP214_HArray1OfAutoDesignDateAndTimeItem (1, nb3);
58           for (Standard_Integer i3 = 1; i3 <= nb3; i3 ++) {
59             Standard_Boolean stat3 = data->ReadEntity
60                  (nsub3,i3,"items",ach,aItemsItem);
61             if (stat3) aItems->SetValue(i3,aItemsItem);
62           }
63         }
64
65         //--- Initialisation of the read entity ---
66
67
68         ent->Init(aAssignedDateAndTime, aRole, aItems);
69 }
70
71
72 void RWStepAP214_RWAutoDesignActualDateAndTimeAssignment::WriteStep
73         (StepData_StepWriter& SW,
74          const Handle(StepAP214_AutoDesignActualDateAndTimeAssignment)& ent) const
75 {
76
77         // --- inherited field assignedDateAndTime ---
78
79         SW.Send(ent->AssignedDateAndTime());
80
81         // --- inherited field role ---
82
83         SW.Send(ent->Role());
84
85         // --- own field : items ---
86
87         SW.OpenSub();
88         for (Standard_Integer i3 = 1;  i3 <= ent->NbItems();  i3 ++) {
89           SW.Send(ent->ItemsValue(i3).Value());
90         }
91         SW.CloseSub();
92 }
93
94
95 void RWStepAP214_RWAutoDesignActualDateAndTimeAssignment::Share(const Handle(StepAP214_AutoDesignActualDateAndTimeAssignment)& ent, Interface_EntityIterator& iter) const
96 {
97
98         iter.GetOneItem(ent->AssignedDateAndTime());
99
100
101         iter.GetOneItem(ent->Role());
102
103
104         Standard_Integer nbElem3 = ent->NbItems();
105         for (Standard_Integer is3=1; is3<=nbElem3; is3 ++) {
106           iter.GetOneItem(ent->ItemsValue(is3).Value());
107         }
108
109 }
110