1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

Integration of OCCT 6.5.0 from SVN

This commit is contained in:
bugmaster
2011-03-16 07:30:28 +00:00
committed by bugmaster
parent 4903637061
commit 7fd59977df
16375 changed files with 3882564 additions and 0 deletions

71
src/TObj/TObj_Persistence.cxx Executable file
View File

@@ -0,0 +1,71 @@
// File: TObj_Persistence.cxx
// Created: Tue Nov 23 11:36:45 2004
// Author: Andrey BETENEV
// Copyright: Open CASCADE 2007
// The original implementation Copyright: (C) RINA S.p.A
#include <TObj_Persistence.hxx>
#include <TObj_Object.hxx>
//=======================================================================
//function : getMapOfTypes
//purpose : Returns the map of types
//=======================================================================
TObj_DataMapOfStringPointer& TObj_Persistence::getMapOfTypes ()
{
static TObj_DataMapOfStringPointer myMapOfTypes;
return myMapOfTypes;
}
//=======================================================================
//function : Constructor
//purpose : Register the type for persistence
//=======================================================================
TObj_Persistence::TObj_Persistence (const Standard_CString theType)
{
myType = theType;
getMapOfTypes().Bind ( theType, this );
}
//=======================================================================
//function : Destructor
//purpose : Unregister the type
//=======================================================================
TObj_Persistence::~TObj_Persistence ()
{
getMapOfTypes().UnBind ( myType );
}
//=======================================================================
//function : CreateNewObject
//purpose :
//=======================================================================
Handle(TObj_Object) TObj_Persistence::CreateNewObject (const Standard_CString theType,
const TDF_Label& theLabel)
{
if ( getMapOfTypes().IsBound ( theType ) )
{
TObj_Persistence *tool =
(TObj_Persistence*) getMapOfTypes().Find ( theType );
if ( tool ) return tool->New (theLabel);
}
return 0;
}
//=======================================================================
//function : DumpTypes
//purpose :
//=======================================================================
void TObj_Persistence::DumpTypes (Standard_OStream &theOs)
{
TObj_DataMapOfStringPointer::Iterator it ( getMapOfTypes() );
for ( ; it.More(); it.Next() )
{
theOs << it.Key() << endl;
}
}