Salome HOME
Update copyrights
[modules/yacs.git] / src / engine / Catalog.hxx
1 // Copyright (C) 2006-2019  CEA/DEN, EDF R&D
2 //
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, or (at your option) any later version.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef __CATALOG_HXX__
21 #define __CATALOG_HXX__
22
23 #include "YACSlibEngineExport.hxx"
24 #include "RefCounter.hxx"
25
26 #include <string>
27 #include <map>
28
29 namespace YACS
30 {
31   namespace ENGINE
32   {
33     class TypeCode;
34     class ComponentDefinition;
35     class Node;
36     class ComposedNode;
37 /*! \brief class for YACS catalogs.
38  *
39  *
40  */
41     class YACSLIBENGINE_EXPORT Catalog : public RefCounter
42     {
43     public:
44       Catalog(const std::string& name);
45       virtual ~Catalog();
46       const std::string& getName() const { return _name; }
47       std::string getErrors(){return _errors;}
48       void setErrors(const std::string& errors){_errors=errors;}
49       std::map<std::string,TypeCode*> _typeMap;
50       std::map<std::string,ComponentDefinition*> _componentMap;
51       std::map<std::string,Node*> _nodeMap;
52       std::map<std::string,ComposedNode*> _composednodeMap;
53       Node* getNodeFromNodeMap(std::string name) {return _nodeMap[name];}
54     protected:
55       std::string _name;
56       std::string _errors;
57     };
58
59 /*! \brief class for YACS catalog loader.
60  *
61  */
62     class YACSLIBENGINE_EXPORT CatalogLoader
63     {
64     public:
65       CatalogLoader();
66       CatalogLoader(const std::string& path);
67       virtual ~CatalogLoader();
68       virtual CatalogLoader* newLoader(const std::string& path)=0 ;
69       virtual void loadCata(Catalog* cata)=0 ;
70       virtual void load(Catalog* cata,const std::string& path) ;
71     protected:
72       std::string _path;
73     };
74   }
75 }
76
77 #endif