1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-07 18:30:55 +03:00
occt/src/IGESData/IGESData_FileProtocol.cxx
2012-03-05 19:23:40 +04:00

32 lines
913 B
C++
Executable File

#include <IGESData_FileProtocol.ixx>
IGESData_FileProtocol::IGESData_FileProtocol () { }
void IGESData_FileProtocol::Add (const Handle(IGESData_Protocol)& protocol)
{
if (theresource.IsNull()) theresource = protocol;
else if (theresource->IsInstance(protocol->DynamicType())) return; // passer
else if (!thenext.IsNull()) thenext->Add(protocol);
else {
thenext = new IGESData_FileProtocol;
thenext->Add(protocol);
}
}
Standard_Integer IGESData_FileProtocol::NbResources () const
{
Standard_Integer nb = (theresource.IsNull() ? 0 : 1);
if (!thenext.IsNull()) nb += thenext->NbResources();
return nb;
}
Handle(Interface_Protocol) IGESData_FileProtocol::Resource
(const Standard_Integer num) const
{
Handle(IGESData_Protocol) res;
if (num == 1) return theresource;
else if (!thenext.IsNull()) return thenext->Resource(num-1);
return res; // Null
}