0022941: Memory leak in StepData_StepReaderData.cxx line 1826
[occt.git] / src / StepData / StepData_FileProtocol.cxx
CommitLineData
7fd59977 1#include <StepData_FileProtocol.ixx>
2
3
4//static TCollection_AsciiString thename("");
5static Standard_CString thename = "";
6
7// Protocol fabrique a la demande avec d autres Protocoles
8
9
10 StepData_FileProtocol::StepData_FileProtocol () { }
11
12 void StepData_FileProtocol::Add (const Handle(StepData_Protocol)& protocol)
13{
14 if (protocol.IsNull()) return;
15 Handle(Standard_Type) ptype = protocol->DynamicType();
16 Standard_Integer nb = thecomps.Length();
17 for (Standard_Integer i = 1; i <= nb; i ++) {
18 if (thecomps.Value(i)->IsInstance(ptype)) return;
19 }
20 thecomps.Append(protocol);
21}
22
23
24 Standard_Integer StepData_FileProtocol::NbResources () const
25 { return thecomps.Length(); }
26
27 Handle(Interface_Protocol) StepData_FileProtocol::Resource
28 (const Standard_Integer num) const
29 { return Handle(Interface_Protocol)::DownCast(thecomps.Value(num)); }
30
31
32 Standard_Integer StepData_FileProtocol::TypeNumber
33 (const Handle(Standard_Type)& atype) const
34 { return 0; }
35
36
37Standard_Boolean StepData_FileProtocol::GlobalCheck(const Interface_Graph& G,
38 Handle(Interface_Check)& ach) const
39{
40 Standard_Boolean res = Standard_False;
41 Standard_Integer i,nb = NbResources();
42 for (i = 1; i <= nb; i ++) res |= Resource(i)->GlobalCheck (G,ach);
43 return res;
44}
45
46
47 Standard_CString StepData_FileProtocol::SchemaName () const
48 { return thename; }