1 // Copyright (C) 2006-2008 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #include "Catalog.hxx"
20 #include "ComponentDefinition.hxx"
21 #include "TypeCode.hxx"
23 #include "ComposedNode.hxx"
26 #include "YacsTrace.hxx"
29 using namespace YACS::ENGINE;
31 Catalog::Catalog(const std::string& name):_name(name)
37 DEBTRACE("Catalog::~Catalog");
38 //decref type codes in map
39 std::map<std::string, TypeCode *>::iterator pt;
40 for(pt=_typeMap.begin();pt!=_typeMap.end();pt++)
41 ((*pt).second)->decrRef();
43 //get rid of component definitions in map
44 std::map<std::string, ComponentDefinition*>::const_iterator lt;
45 for(lt=_componentMap.begin();lt!=_componentMap.end();lt++)
48 //get rid of nodes in map
49 std::map<std::string, Node*>::const_iterator nt;
50 for(nt=_nodeMap.begin();nt!=_nodeMap.end();nt++)
53 //get rid of composed nodes in map
54 std::map<std::string, ComposedNode*>::const_iterator ct;
55 for(ct=_composednodeMap.begin();ct!=_composednodeMap.end();ct++)
60 CatalogLoader::CatalogLoader():_path("proto")
64 CatalogLoader::CatalogLoader(const std::string& path):_path(path)
68 CatalogLoader::~CatalogLoader()
70 DEBTRACE("CatalogLoader::~CatalogLoader");
73 void CatalogLoader::load(Catalog* cata,const std::string& path)
75 CatalogLoader* CL=newLoader(path);