1 // Copyright (c) 1999-2012 OPEN CASCADE SAS
3 // The content of this file is subject to the Open CASCADE Technology Public
4 // License Version 6.5 (the "License"). You may not use the content of this file
5 // except in compliance with the License. Please obtain a copy of the License
6 // at http://www.opencascade.org and read it completely before using this file.
8 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
11 // The Original Code and all software distributed under the License is
12 // distributed on an "AS IS" basis, without warranty of any kind, and the
13 // Initial Developer hereby disclaims all such warranties, including without
14 // limitation, any warranties of merchantability, fitness for a particular
15 // purpose or non-infringement. Please see the License for the specific terms
16 // and conditions governing the rights and limitations under the License.
19 #include <RWStepAP214_RWAppliedSecurityClassificationAssignment.ixx>
20 #include <StepAP214_HArray1OfSecurityClassificationItem.hxx>
21 #include <StepAP214_SecurityClassificationItem.hxx>
22 #include <StepBasic_SecurityClassification.hxx>
25 #include <Interface_EntityIterator.hxx>
28 #include <StepAP214_AppliedSecurityClassificationAssignment.hxx>
31 RWStepAP214_RWAppliedSecurityClassificationAssignment::RWStepAP214_RWAppliedSecurityClassificationAssignment () {}
33 void RWStepAP214_RWAppliedSecurityClassificationAssignment::ReadStep
34 (const Handle(StepData_StepReaderData)& data,
35 const Standard_Integer num,
36 Handle(Interface_Check)& ach,
37 const Handle(StepAP214_AppliedSecurityClassificationAssignment)& ent) const
41 // --- Number of Parameter Control ---
43 if (!data->CheckNbParams(num,2,ach,"applied_security_classification_assignment")) return;
45 // --- inherited field : assignedSecurityClassification ---
47 Handle(StepBasic_SecurityClassification) aAssignedSecurityClassification;
49 Standard_Boolean stat1 =
51 data->ReadEntity(num, 1,"assigned_security_classification", ach, STANDARD_TYPE(StepBasic_SecurityClassification), aAssignedSecurityClassification);
53 // --- own field : items ---
55 Handle(StepAP214_HArray1OfSecurityClassificationItem) aItems;
56 StepAP214_SecurityClassificationItem anent2;
57 Standard_Integer nsub2;
58 if (data->ReadSubList (num,2,"items",ach,nsub2)) {
59 Standard_Integer nb2 = data->NbParams(nsub2);
60 aItems = new StepAP214_HArray1OfSecurityClassificationItem (1, nb2);
61 for (Standard_Integer i2 = 1; i2 <= nb2; i2 ++) {
62 Standard_Boolean stat2 = data->ReadEntity
63 (nsub2, i2,"items", ach, anent2);
64 if (stat2) aItems->SetValue(i2, anent2);
68 //--- Initialisation of the read entity ---
71 ent->Init(aAssignedSecurityClassification, aItems);
75 void RWStepAP214_RWAppliedSecurityClassificationAssignment::WriteStep
76 (StepData_StepWriter& SW,
77 const Handle(StepAP214_AppliedSecurityClassificationAssignment)& ent) const
80 // --- inherited field assignedSecurityClassification ---
82 SW.Send(ent->AssignedSecurityClassification());
84 // --- own field : items ---
87 for (Standard_Integer i2 = 1; i2 <= ent->NbItems(); i2 ++) {
88 SW.Send(ent->ItemsValue(i2).Value());
94 void RWStepAP214_RWAppliedSecurityClassificationAssignment::Share(const Handle(StepAP214_AppliedSecurityClassificationAssignment)& ent, Interface_EntityIterator& iter) const
97 iter.GetOneItem(ent->AssignedSecurityClassification());
99 Standard_Integer nbElem2 = ent->NbItems();
100 for (Standard_Integer is2=1; is2<=nbElem2; is2 ++) {
101 iter.GetOneItem(ent->ItemsValue(is2).Value());