1 // Copyright (C) 2006-2013 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
20 #include "Catalog.hxx"
21 #include "ComponentDefinition.hxx"
22 #include "TypeCode.hxx"
24 #include "ComposedNode.hxx"
27 #include "YacsTrace.hxx"
30 using namespace YACS::ENGINE;
32 Catalog::Catalog(const std::string& name):_name(name)
38 DEBTRACE("Catalog::~Catalog");
39 //decref type codes in map
40 std::map<std::string, TypeCode *>::iterator pt;
41 for(pt=_typeMap.begin();pt!=_typeMap.end();pt++)
42 ((*pt).second)->decrRef();
44 //get rid of component definitions in map
45 std::map<std::string, ComponentDefinition*>::const_iterator lt;
46 for(lt=_componentMap.begin();lt!=_componentMap.end();lt++)
49 //get rid of nodes in map
50 std::map<std::string, Node*>::const_iterator nt;
51 for(nt=_nodeMap.begin();nt!=_nodeMap.end();nt++)
54 //get rid of composed nodes in map
55 std::map<std::string, ComposedNode*>::const_iterator ct;
56 for(ct=_composednodeMap.begin();ct!=_composednodeMap.end();ct++)
61 CatalogLoader::CatalogLoader():_path("proto")
65 CatalogLoader::CatalogLoader(const std::string& path):_path(path)
69 CatalogLoader::~CatalogLoader()
71 DEBTRACE("CatalogLoader::~CatalogLoader");
74 void CatalogLoader::load(Catalog* cata,const std::string& path)
76 CatalogLoader* CL=newLoader(path);