Back to index

salome-kernel  6.5.0
SALOME_ModuleCatalog_Parser.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
00024 //  File   : SALOME_ModuleCatalog_Parser.hxx
00025 //  Author : Estelle Deville
00026 //  Module : SALOME
00027 //  $Header: /home/server/cvs/KERNEL/KERNEL_SRC/src/ModuleCatalog/SALOME_ModuleCatalog_Parser.hxx,v 1.9.32.2.12.1 2012-04-12 14:05:17 vsr Exp $
00028 //
00029 #ifndef SALOME_CATALOG_PARSER_H
00030 #define SALOME_CATALOG_PARSER_H
00031 
00032 #include <string>
00033 #include <vector>
00034 #include <map>
00035 
00036 // Type Definitions
00037 struct ParserPathPrefix
00038 {
00039   std::string         path;
00040   std::vector<std::string> listOfComputer ;
00041 };
00042 
00043 typedef std::vector<ParserPathPrefix> ParserPathPrefixes ;
00044 
00045 enum ParserComponentType {GEOM, MESH, Med, SOLVER, DATA, VISU, SUPERV, OTHER} ;
00046 
00047 struct ParserParameter
00048 {
00049   std::string type;
00050   std::string name;
00051 } ;
00052 
00053 
00054 struct ParserDataStreamParameter
00055 {
00056   std::string type;
00057   std::string name;
00058   std::string dependency;
00059 } ;
00060 
00061 typedef std::vector<ParserParameter> ParserParameters;
00062 typedef std::vector<ParserDataStreamParameter> ParserDataStreamParameters;
00063 
00064 struct ParserService
00065 {
00066   ParserService() {
00067     typeOfNode = 1;
00068     byDefault = 1;
00069   }
00070   std::string                name;
00071   ParserParameters           inParameters;
00072   ParserParameters           outParameters;
00073   ParserDataStreamParameters inDataStreamParameters;
00074   ParserDataStreamParameters outDataStreamParameters;
00075   bool                       byDefault;
00076   bool                       typeOfNode;
00077 } ;
00078 
00079 typedef std::vector<ParserService> ParserServices ;
00080 
00081 struct ParserInterface
00082 {
00083   std::string    name ;
00084   ParserServices services ;
00085 } ;
00086 
00087 typedef std::vector<ParserInterface> ParserInterfaces;
00088 
00089 struct ParserComponent
00090 {
00091   std::string         name;
00092   std::string         username;
00093   ParserComponentType type;
00094   bool                multistudy;
00095   std::string         icon;
00096   std::string         constraint;
00097   ParserInterfaces    interfaces;
00098   ParserPathPrefixes  prefixes;
00099   std::string         implementationType;
00100   std::string         implementationName;
00101   std::string         version;
00102   std::string         comment;
00103 };
00104 
00105 typedef std::vector<ParserComponent> ParserComponents ;
00106 
00107 struct ParserType
00108 {
00109   std::string         name;
00110   std::string         kind;
00111   std::string         id;
00112   std::string         content;
00113   std::vector<std::string> bases;
00114   std::vector< std::pair<std::string,std::string> > members;
00115 };
00116 typedef std::map<std::string,ParserType> ParserTypes ;
00117 typedef std::map<std::string,ParserType&> RefTypes ;
00118 typedef std::vector<ParserType> TypeList ;
00119 
00120 struct ParserSequence:public ParserType
00121 {
00122   ParserSequence(){kind="sequence";}
00123 };
00124 typedef std::map<std::string,ParserSequence> ParserSequences ;
00125 
00126 struct ParserObjref:public ParserType
00127 {
00128   ParserObjref(){kind="objref";}
00129 };
00130 typedef std::map<std::string,ParserObjref> ParserObjrefs ;
00131 
00132 struct ParserStruct:public ParserType
00133 {
00134   ParserStruct(){kind="struct";}
00135 };
00136 typedef std::map<std::string,ParserStruct> ParserStructs ;
00137 
00138 #endif // SALOME_CATALOG_PARSER_H