0022627: Change OCCT memory management defaults
[occt.git] / src / RWStepBasic / RWStepBasic_RWProductCategoryRelationship.cxx
CommitLineData
7fd59977 1// File: RWStepBasic_RWProductCategoryRelationship.cxx
2// Created: Fri Nov 26 16:26:38 1999
3// Author: Andrey BETENEV
4// Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.0
5// Copyright: Matra Datavision 1999
6
7#include <RWStepBasic_RWProductCategoryRelationship.ixx>
8
9//=======================================================================
10//function : RWStepBasic_RWProductCategoryRelationship
11//purpose :
12//=======================================================================
13
14RWStepBasic_RWProductCategoryRelationship::RWStepBasic_RWProductCategoryRelationship ()
15{
16}
17
18//=======================================================================
19//function : ReadStep
20//purpose :
21//=======================================================================
22
23void RWStepBasic_RWProductCategoryRelationship::ReadStep (const Handle(StepData_StepReaderData)& data,
24 const Standard_Integer num,
25 Handle(Interface_Check)& ach,
26 const Handle(StepBasic_ProductCategoryRelationship) &ent) const
27{
28 // Check number of parameters
29 if ( ! data->CheckNbParams(num,4,ach,"product_category_relationship") ) return;
30
31 // Own fields of ProductCategoryRelationship
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_ProductCategory) aCategory;
46 data->ReadEntity (num, 3, "category", ach, STANDARD_TYPE(StepBasic_ProductCategory), aCategory);
47
48 Handle(StepBasic_ProductCategory) aSubCategory;
49 data->ReadEntity (num, 4, "sub_category", ach, STANDARD_TYPE(StepBasic_ProductCategory), aSubCategory);
50
51 // Initialize entity
52 ent->Init(aName,
53 hasDescription,
54 aDescription,
55 aCategory,
56 aSubCategory);
57}
58
59//=======================================================================
60//function : WriteStep
61//purpose :
62//=======================================================================
63
64void RWStepBasic_RWProductCategoryRelationship::WriteStep (StepData_StepWriter& SW,
65 const Handle(StepBasic_ProductCategoryRelationship) &ent) const
66{
67
68 // Own fields of ProductCategoryRelationship
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->Category());
78
79 SW.Send (ent->SubCategory());
80}
81
82//=======================================================================
83//function : Share
84//purpose :
85//=======================================================================
86
87void RWStepBasic_RWProductCategoryRelationship::Share (const Handle(StepBasic_ProductCategoryRelationship) &ent,
88 Interface_EntityIterator& iter) const
89{
90
91 // Own fields of ProductCategoryRelationship
92
93 iter.AddItem (ent->Category());
94
95 iter.AddItem (ent->SubCategory());
96}