string Parametername; /*!<Name of the parameter.*/
} ;
+ enum DataStreamDependency {
+ DATASTREAM_UNDEFINED,
+ DATASTREAM_TEMPORAL,
+ DATASTREAM_ITERATIVE
+ } ;
+
+ enum DataStreamType {
+ DATASTREAM_UNKNOWN,
+ DATASTREAM_INTEGER,
+ DATASTREAM_FLOAT,
+ DATASTREAM_DOUBLE,
+ DATASTREAM_STRING,
+ DATASTREAM_BOOLEAN
+ } ;
+
+ struct ServicesDataStreamParameter
+ {
+ DataStreamType Parametertype; /*!<Type of the parameter.*/
+ string Parametername; /*!<Name of the parameter.*/
+ DataStreamDependency Parameterdependency; /*!<Temporal or iterative dependency.*/
+ } ;
+
/*!
The list of the parameters of service.
*/
typedef sequence<ServicesParameter> ListOfServicesParameter;
+ typedef sequence<ServicesDataStreamParameter> ListOfServicesDataStreamParameter;
/*!
This struct contains fields completely defining each service.
struct Service
{
- string ServiceName; /*!<Name of the service.*/
- ListOfServicesParameter ServiceinParameter; /*!< List of input parameters of the services.*/
- ListOfServicesParameter ServiceoutParameter; /*!< List of output parameters of the services.*/
- boolean Servicebydefault; /*!<True if the service is taken with its defult fields.*/
+ string ServiceName; /*!<Name of the service.*/
+ ListOfServicesParameter ServiceinParameter; /*!< List of input parameters of the services.*/
+ ListOfServicesParameter ServiceoutParameter; /*!< List of output parameters of the services.*/
+ ListOfServicesDataStreamParameter ServiceinDataStreamParameter; /*!< List of input parameters of the services.*/
+ ListOfServicesDataStreamParameter ServiceoutDataStreamParameter; /*!< List of output parameters of the services.*/
+ boolean Servicebydefault; /*!<True if the service is taken with its defult fields.*/
} ;
/*!
List of services of the interface.
SALOME_ModuleCatalog_Acomponent_impl.hxx \
PathPrefix.hxx \
SALOME_ModuleCatalog_Parser.hxx \
+ SALOME_ModuleCatalog_Parser_IO.hxx \
SALOME_ModuleCatalog_Handler.hxx
# Libraries targets
LIB = libSalomeCatalog.la
LIB_SRC = \
SALOME_ModuleCatalog_Handler.cxx \
+ SALOME_ModuleCatalog_Parser_IO.cxx \
SALOME_ModuleCatalog_impl.cxx \
SALOME_ModuleCatalog_Acomponent_impl.cxx
#define WRITE_CATA_COMPONENT
#include "SALOME_ModuleCatalog_Handler.hxx"
+#include "SALOME_ModuleCatalog_Parser_IO.hxx"
using namespace std;
//----------------------------------------------------------------------
const QString& qName,
const QXmlAttributes& atts)
{
- SCRUTE(qName);
+// SCRUTE(qName);
return true;
}
const QString &,
const QString& qName)
{
- BEGIN_OF("endElement");
- MESSAGE(qName << " : " << content);
+// BEGIN_OF("endElement");
+// MESSAGE(qName << " : " << content);
// Path prefix
}
// _moduleList
- SCRUTE(_moduleList.size());
+// SCRUTE(_moduleList.size());
for (unsigned int ind = 0; ind < _moduleList.size(); ind++)
{
- DebugParserComponent( _moduleList[ind]);
+ SCRUTE(_moduleList[ind]);
}
MESSAGE("Document parsed");
// Type Definitions
struct ParserPathPrefix
{
- string path;
- vector<string> listOfComputer ;
+ std::string path;
+ std::vector<std::string> listOfComputer ;
};
-typedef vector<ParserPathPrefix> ListOfParserPathPrefix ;
+typedef std::vector<ParserPathPrefix> ListOfParserPathPrefix ;
enum ParserComponentType {GEOM, MESH, Med, SOLVER, DATA, VISU, SUPERV, OTHER} ;
struct ParserServParam
{
- string parserParamType;
- string parserParamName;
+ std::string parserParamType;
+ std::string parserParamName;
} ;
struct ParserServDataStreamParam
{
- string parserParamType;
- string parserParamName;
- string parserParamDependency;
+ std::string parserParamType;
+ std::string parserParamName;
+ std::string parserParamDependency;
} ;
-typedef vector<ParserServParam> ListOfParserServicesParameter;
-typedef vector<ParserServDataStreamParam> ListOfParserServicesDataStreamParameter;
+typedef std::vector<ParserServParam> ListOfParserServicesParameter;
+typedef std::vector<ParserServDataStreamParam> ListOfParserServicesDataStreamParameter;
struct ParserService
{
- string parserServiceName;
+ std::string parserServiceName;
ListOfParserServicesParameter parserServiceInParameter;
ListOfParserServicesParameter parserServiceOutParameter;
ListOfParserServicesDataStreamParameter parserServiceInDataStreamParameter;
bool parserServiceByDefault;
} ;
-typedef vector<ParserService> ListOfParserServices ;
+typedef std::vector<ParserService> ListOfParserServices ;
struct ParserDefInterface
{
- string parserInterfaceName ;
+ std::string parserInterfaceName ;
ListOfParserServices parserInterfaceServiceList ;
} ;
-typedef vector<ParserDefInterface> ListOfDefinitionInterface;
+typedef std::vector<ParserDefInterface> ListOfDefinitionInterface;
struct ParserComponent
{
- string parserComponentName;
- string parserComponentUsername;
+ std::string parserComponentName;
+ std::string parserComponentUsername;
ParserComponentType parserComponentType;
bool parserComponentMultistudy ;
- string parserComponentIcon;
+ std::string parserComponentIcon;
ListOfDefinitionInterface parserListInterface;
- string parserConstraint ;
+ std::string parserConstraint ;
};
-typedef vector<ParserComponent> ListOfParserComponent ;
+typedef std::vector<ParserComponent> ListOfParserComponent ;
#ifdef WRITE_CATA_COMPONENT
// contains all the paths and the computers defined in the catalog
#endif
-inline void DebugParserService(const ParserService &S)
-{
- MESSAGE("Service name : " << S.parserServiceName);
- MESSAGE("Service default : " << S.parserServiceByDefault);
-
- for (unsigned int k=0; k<S.parserServiceInParameter.size() ; k++)
- {
- const ParserServParam & P = S.parserServiceInParameter[k];
- MESSAGE("Service Parameter in name : " << P.parserParamName);
- MESSAGE("Service Parameter in type : " << P.parserParamType);
- }
- for (unsigned int k=0; k<S.parserServiceOutParameter.size() ; k++)
- {
- const ParserServParam & P = S.parserServiceOutParameter[k];
- MESSAGE("Service Parameter out name : " << P.parserParamName);
- MESSAGE("Service Parameter out type : " << P.parserParamType);
- }
-
- for (unsigned int k=0; k<S.parserServiceInDataStreamParameter.size() ; k++)
- {
- const ParserServDataStreamParam & P = S.parserServiceInDataStreamParameter[k];
- MESSAGE("Service DataStreamParameter in name : " << P.parserParamName);
- MESSAGE("Service DataStreamParameter in type : " << P.parserParamType);
- }
- for (unsigned int k=0; k<S.parserServiceOutDataStreamParameter.size() ; k++)
- {
- const ParserServDataStreamParam & P = S.parserServiceOutDataStreamParameter[k];
- MESSAGE("Service DataStreamParameter out name : " << P.parserParamName);
- MESSAGE("Service DataStreamParameter out type : " << P.parserParamType);
- }
-}
-
-inline void DebugParserComponent(const ParserComponent &P)
-{
- MESSAGE("Component name : " << P.parserComponentName);
- MESSAGE("Component type : " << P.parserComponentType);
- MESSAGE("Component constraint : " << P.parserConstraint);
- MESSAGE("Component icone : " << P.parserComponentIcon);
- for (unsigned int i = 0; i < P.parserListInterface.size(); i++)
- {
- const ParserDefInterface &L = P.parserListInterface[i];
-
- MESSAGE("Component interface name : " << L.parserInterfaceName);
- for (unsigned int j=0; j<L.parserInterfaceServiceList.size(); j++)
- DebugParserService(L.parserInterfaceServiceList[j]);
- }
-};
-
#endif // SALOME_CATALOG_PARSER_H
--- /dev/null
+
+// SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : SALOME_ModuleCatalog_Handler.cxx
+// Author : Estelle Deville
+// Module : SALOME
+// $Header$
+
+#include "SALOME_ModuleCatalog_Parser_IO.hxx"
+#include <string>
+
+std::ostream & operator<< (std::ostream & f, const ParserServParam & P)
+{
+ f << " name : " << P.parserParamName << std::endl;
+ f << " type : " << P.parserParamType << std::endl;
+ return f;
+}
+
+std::ostream & operator<< (std::ostream & f,
+ const ParserServDataStreamParam & P)
+{
+ f << " name : " << P.parserParamName << std::endl;
+ f << " type : " << P.parserParamType << std::endl;
+ f << " dependency : " << P.parserParamDependency << std::endl;
+ return f;
+}
+
+std::ostream & operator<< (std::ostream & f,
+ const ParserService & S)
+{
+ int i, n;
+ f << " name : " << S.parserServiceName << std::endl;
+ f << " default : " << (S.parserServiceByDefault ? "yes" : "no")
+ << std::endl;
+
+ n = S.parserServiceInParameter.size();
+ f << " in parameters : " << n << std::endl;
+ for (i=0; i<n; i++)
+ f << S.parserServiceInParameter[i] << std::endl;
+
+ n = S.parserServiceInDataStreamParameter.size();
+ f << " in DataStream parameters : " << n << std::endl;
+ for (i=0; i<n; i++)
+ f << S.parserServiceInDataStreamParameter[i] << std::endl;
+
+ n = S.parserServiceOutParameter.size();
+ f << " out parameters : " << n << std::endl;
+ for (i=0; i<n; i++)
+ f << S.parserServiceOutParameter[i] << std::endl;
+
+ n = S.parserServiceOutDataStreamParameter.size();
+ f << " out DataStream parameters : " << n << std::endl;
+ for (i=0; i<n; i++)
+ f << S.parserServiceOutDataStreamParameter[i] << std::endl;
+
+ return f;
+}
+
+std::ostream & operator<< (std::ostream & f,
+ const ParserDefInterface & I)
+{
+ int j, n;
+ f << " name : " << I.parserInterfaceName << std::endl;
+
+ n = I.parserInterfaceServiceList.size();
+ f << " services : " << n << std::endl;
+ for (j=0; j<n; j++)
+ f << I.parserInterfaceServiceList[j] << std::endl;
+
+ return f;
+}
+
+std::ostream & operator<< (std::ostream & f,
+ const ParserComponentType & T)
+{
+ std::string s;
+ switch (T) {
+ case GEOM : s = "GEOM"; break;
+ case MESH : s = "MESH"; break;
+ case Med : s = "Med"; break;
+ case SOLVER : s = "SOLVER"; break;
+ case DATA : s = "DATA"; break;
+ case VISU : s = "VISU"; break;
+ case SUPERV : s = "SUPERV"; break;
+ default : s = "OTHER"; break;
+ }
+ f << s << std::endl;
+ return f;
+}
+
+std::ostream & operator<< (std::ostream & f,
+ const ParserComponent & C)
+{
+ int j, n;
+ f << " name : " << C.parserComponentName << std::endl;
+ f << " user name : " << C.parserComponentUsername << std::endl;
+ f << " type : " << C.parserComponentType << std::endl;
+ f << " multistudy : " << (C.parserComponentMultistudy ? "yes" : "no")
+ << std::endl;
+ f << " icon : " << C.parserComponentIcon << std::endl;
+ f << " constraint : " << C.parserConstraint << std::endl;
+
+ n = C.parserListInterface.size();
+ f << " interfaces : " << n << std::endl;
+ for (j=0; j<n; j++)
+ f << C.parserListInterface[j] << std::endl;
+
+ return f;
+}
+
+
--- /dev/null
+
+// SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : SALOME_ModuleCatalog_Parser_IO.hxx
+// Author : Marc Tajchman
+// Module : SALOME
+// $Header$
+
+#ifndef SALOME_CATALOG_PARSER_IO_H
+#define SALOME_CATALOG_PARSER_IO_H
+
+#include "SALOME_ModuleCatalog_Parser.hxx"
+#include <iostream>
+
+std::ostream & operator<< (std::ostream & f,
+ const ParserServParam & P);
+std::ostream & operator<< (std::ostream & f,
+ const ParserServDataStreamParam & P);
+
+std::ostream & operator<< (std::ostream & f,
+ const ParserService & S);
+
+std::ostream & operator<< (std::ostream & f,
+ const ParserDefInterface & I);
+
+std::ostream & operator<< (std::ostream & f,
+ const ParserComponent & C);
+
+std::ostream & operator<< (std::ostream & f,
+ const ParserComponentType & T);
+
+#endif
+
if (p) {
- DebugParserComponent(*p);
+// DebugParserComponent(*p);
// get constraint
_constraint = CORBA::string_dup(p->parserConstraint.c_str());