0022627: Change OCCT memory management defaults
[occt.git] / src / RWStepBasic / RWStepBasic_RWDocumentProductAssociation.cxx
CommitLineData
7fd59977 1// File: RWStepBasic_RWDocumentProductAssociation.cxx
2// Created: Tue Jan 28 12:40:35 2003
3// Author: data exchange team
4// Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2
5// Copyright: Open CASCADE 2002
6
7#include <RWStepBasic_RWDocumentProductAssociation.ixx>
8
9//=======================================================================
10//function : RWStepBasic_RWDocumentProductAssociation
11//purpose :
12//=======================================================================
13
14RWStepBasic_RWDocumentProductAssociation::RWStepBasic_RWDocumentProductAssociation ()
15{
16}
17
18//=======================================================================
19//function : ReadStep
20//purpose :
21//=======================================================================
22
23void RWStepBasic_RWDocumentProductAssociation::ReadStep (const Handle(StepData_StepReaderData)& data,
24 const Standard_Integer num,
25 Handle(Interface_Check)& ach,
26 const Handle(StepBasic_DocumentProductAssociation) &ent) const
27{
28 // Check number of parameters
29 if ( ! data->CheckNbParams(num,4,ach,"document_product_association") ) return;
30
31 // Own fields of DocumentProductAssociation
32
33 Handle(TCollection_HAsciiString) aName;
34 data->ReadString (num, 1, "name", ach, aName);
35
36 Handle(TCollection_HAsciiString) aDescription;
37 Standard_Boolean hasDescription = Standard_True;
38 if ( data->IsParamDefined (num,2) ) {
39 data->ReadString (num, 2, "description", ach, aDescription);
40 }
41 else {
42 hasDescription = Standard_False;
43 }
44
45 Handle(StepBasic_Document) aRelatingDocument;
46 data->ReadEntity (num, 3, "relating_document", ach, STANDARD_TYPE(StepBasic_Document), aRelatingDocument);
47
48 StepBasic_ProductOrFormationOrDefinition aRelatedProduct;
49 data->ReadEntity (num, 4, "related_product", ach, aRelatedProduct);
50
51 // Initialize entity
52 ent->Init(aName,
53 hasDescription,
54 aDescription,
55 aRelatingDocument,
56 aRelatedProduct);
57}
58
59//=======================================================================
60//function : WriteStep
61//purpose :
62//=======================================================================
63
64void RWStepBasic_RWDocumentProductAssociation::WriteStep (StepData_StepWriter& SW,
65 const Handle(StepBasic_DocumentProductAssociation) &ent) const
66{
67
68 // Own fields of DocumentProductAssociation
69
70 SW.Send (ent->Name());
71
72 if ( ent->HasDescription() ) {
73 SW.Send (ent->Description());
74 }
75 else SW.SendUndef();
76
77 SW.Send (ent->RelatingDocument());
78
79 SW.Send (ent->RelatedProduct().Value());
80}
81
82//=======================================================================
83//function : Share
84//purpose :
85//=======================================================================
86
87void RWStepBasic_RWDocumentProductAssociation::Share (const Handle(StepBasic_DocumentProductAssociation) &ent,
88 Interface_EntityIterator& iter) const
89{
90
91 // Own fields of DocumentProductAssociation
92
93 iter.AddItem (ent->RelatingDocument());
94
95 iter.AddItem (ent->RelatedProduct().Value());
96}