f.write(module)
f.write(',')
pass
- f.write(_config["guimodules"][-1])
+ if len(_config["guimodules"]) > 0:
+ f.write(_config["guimodules"][-1])
f.write('"/>')
command="""
<parameter name="pyModules" value=""/>
args["session_gui"] = False
args[batch_nam] = False
args["study_hdf"] = None
- print 'launchConfigureParser cmd_opts',cmd_opts
if cmd_opts.gui is not None:
args[gui_nam] = cmd_opts.gui
if cmd_opts.batch is not None:
args[batch_nam] = True
- print 'launchConfigureParser args[',batch_nam,']',args[batch_nam]
if args[gui_nam]:
args["session_gui"] = True
if cmd_opts.desktop is not None:
traceback.print_exc()
print
print
- print "--- erreur au lancement Salome ---"
+ print "--- Error during Salome launch ---"
#print process_id
"""Salome launch as a main application"""
import sys
print "runSalome running on ",os.getenv('HOSTNAME')
- print os.environ.itervalues
args, modules_list, modules_root_dir = setenv.get_config()
kill_salome(args)
save_config = True
doc_DATA =
if RST2HTML_IS_OK
- doc_DATA += \
- index.html \
- UnitTests.html \
- SALOME_Application.html \
- INSTALL.html \
- kernel_resources.html \
- KERNEL_Services.html
+# doc_DATA += \
+# index.html \
+# UnitTests.html \
+# SALOME_Application.html \
+# INSTALL.html \
+# kernel_resources.html \
+# KERNEL_Services.html
endif
EXTRA_DIST=$(doc_DATA)
(cd salome && $(MAKE) $(AM_MAKEFLAGS) usr_docs)
dev_docs:
- (cd salome && $(MAKE) $(AM_MAKEFLAGS) dev_docs)
\ No newline at end of file
+ (cd salome && $(MAKE) $(AM_MAKEFLAGS) dev_docs)
install-data-local: html usr_docs
cp -rp $(top_builddir)/doc/salome/Batch.html $(docdir)
+
+EXTRA_DIST= main.dox batch.dox install.dox \
+ kernel_resources.dox kernel_services.dox \
+ salome_application.dox unittests.dox \
+ salome_file.dox
+
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = \
+ @top_srcdir@/doc/salome \
@top_srcdir@/bin \
@top_srcdir@/idl \
@top_srcdir@/src/Container \
@top_srcdir@/src/Notification \
@top_srcdir@/src/Utils \
@top_srcdir@/src/DSC
-FILE_PATTERNS = *.idl *.hxx *.cxx python_extension_must_be_here
+FILE_PATTERNS = *.dox *.idl *.hxx *.cxx python_extension_must_be_here
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
-<DIV class="div-footer">
-</tr>
-<hr>
-<table cellspacing="2" align="center" bgcolor="#808080" frame="void">
- <tbody align="center" valign="center" bgcolor="#D3D3D3">
- <tr>
- <td> <a href="../../index.html" target = _top>General KERNEL Documentation</a> </td>
- <td> <a href="../../KERNEL_Services.html" target = _top>End User KERNEL Services</a> </td>
- </tr>
- </tbody>
-</table>
-<br>
-Generated on $datetime for $projectname by <A href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></A> $doxygenversion</DIV>
-</BODY>
-</HTML>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+</head>
+<body>
+<hr style="width: 100%; height: 2px;">
+<div style="text-align: center;">Copyright © 2003-2007 CEA, EDF<br>
+</div>
+</body>
+</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Mozilla/4.73 [en] (WinNT; I) [Netscape]">
- <title>Main Page</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
+ <title>$title</title>
+ <link href="tabs.css" rel="stylesheet" type="text/css">
+ <link href="doxygen.css" rel="stylesheet" type="text/css">
</head>
-<body>
-
-<table cellspacing="2" align="center" bgcolor="#FFFFFF" frame="void">
- <tbody align="center" valign="center" bgcolor="#FFFFFF">
- <tr>
- <td> <a href="../../index.html" target = _top>General KERNEL Documentation</a> </td>
- <td> <a href="../../KERNEL_Services.html" target = _top>End User KERNEL Services</a> </td>
- </tr>
- </tbody>
-</table>
-<br>
<hr>
-</body>
-</html>
+<center>
+SALOME documentation central
+</center>
+<hr>
fi; \
$(DOXYGEN) ./doxyuser1; \
cd ..;
- $(INSTALL) -d $(docdir)/tui/KERNEL;
- cp -fr $(srcdir)/KERNEL/sources/static/*.* $(docdir)/tui/KERNEL;
- cp -fr $(srcdir)/KERNEL/sources/ $(docdir)/tui/KERNEL;
- cp -fr KERNEL $(docdir)/tui
- cp -fr $(srcdir)/KERNEL/HTML/ $(docdir)/tui/KERNEL;
- cp -f $(srcdir)/pythfilter.py $(docdir)/tui/KERNEL;
- cp -fr $(srcdir)/KERNEL/exemple/ $(docdir)/tui/KERNEL;
+# $(INSTALL) -d $(docdir)/tui/KERNEL;
+ cp -fr $(srcdir)/KERNEL/sources/static/*.* $(docdir);
+ cp -fr $(srcdir)/KERNEL/sources/ $(docdir);
+ cp -fr KERNEL/[a-l]*.* $(docdir)
+ cp -fr KERNEL/[m-z]*.* $(docdir)
+ cp -fr $(srcdir)/KERNEL/HTML/ $(docdir);
+ cp -f $(srcdir)/pythfilter.py $(docdir);
+ cp -fr $(srcdir)/KERNEL/exemple/ $(docdir);
+# cp -fr $(srcdir)/KERNEL/sources/static/*.* $(docdir)/tui/KERNEL;
+# cp -fr $(srcdir)/KERNEL/sources/ $(docdir)/tui/KERNEL;
+# cp -fr KERNEL $(docdir)/tui
+# cp -fr $(srcdir)/KERNEL/HTML/ $(docdir)/tui/KERNEL;
+# cp -f $(srcdir)/pythfilter.py $(docdir)/tui/KERNEL;
+# cp -fr $(srcdir)/KERNEL/exemple/ $(docdir)/tui/KERNEL;
dev_docs:
cp -fr $(srcdir)/KERNEL/* ./INPUT; \
// Author : Yves FRICAUD
// $Header$
-/*! \mainpage
- \image html Application-About1.jpg
-*/
-
/*!
\file SALOMEDS.idl This file contains a set of interfaces used for creation, managment
and modification of the %Study
typedef sequence<ServicesParameter> ListOfServicesParameter;
typedef sequence<ServicesDataStreamParameter> ListOfServicesDataStreamParameter;
+ typedef sequence<string> ListOfString;
+ enum TypeKind
+ {
+ NONE ,
+ Dble ,
+ Int ,
+ Str ,
+ Bool ,
+ Objref ,
+ Seq ,
+ Array ,
+ Struc
+ };
+ struct MemberDefinition
+ {
+ string name; /*! Name of the member */
+ string type; /*! Type of the member */
+ };
+ typedef sequence<MemberDefinition> ListOfMemberDefinition;
+/*!
+ * Struct to get the definition of types used in Salome catalogs
+ */
+ struct TypeDefinition
+ {
+ string name; /*! Name of the type */
+ TypeKind kind; /*! Kind of the type.*/
+ string id; /*! id (if needed) */
+ string content; /*! Content type (if needed) */
+ ListOfString bases; /*! Content type (if needed) */
+ ListOfMemberDefinition members; /*! Members types (if needed) */
+ };
+
+ typedef sequence<TypeDefinition> ListOfTypeDefinition;
+
/*!
This struct contains fields completely defining each service.
*/
/*!
Description of a component
*/
- struct Component
+ struct ComponentDef
{
ComponentType type;
string name;
*/
oneway void ShutdownWithExit();
+/*!
+ * Get the types of the catalog
+ */
+ ListOfTypeDefinition GetTypes();
+
/*!
Gets a list of names of computers of the catalog
*/
/*!
Gets the description of a component of the catalog.
*/
- Component GetComponentInfo(in string componentName) raises(NotFound);
+ ComponentDef GetComponentInfo(in string componentName) raises(NotFound);
/*!
Reads a xml file and imports new components from this file.
<path-prefix-list>
</path-prefix-list>
+<!-- Commonly used types -->
+<type-list>
+ <type name="double" kind="double"/>
+ <type name="float" kind="double"/>
+ <type name="int" kind="int"/>
+ <type name="short" kind="int"/>
+ <type name="long" kind="int"/>
+ <type name="string" kind="string"/>
+ <type name="char" kind="string"/>
+ <type name="bool" kind="bool"/>
+ <type name="boolean" kind="bool"/>
+ <sequence name="dblevec" content="double"/>
+ <sequence name="intvec" content="int"/>
+ <sequence name="stringvec" content="string"/>
+ <sequence name="boolvec" content="bool"/>
+ <objref name="CALCIUM_integer" id="IDL:Ports/Calcium_Ports/Calcium_Integer_Port:1.0"/>
+ <objref name="CALCIUM_real" id="IDL:Ports/Calcium_Ports/Calcium_Real_Port:1.0"/>
+ <objref name="CALCIUM_double" id="IDL:Ports/Calcium_Ports/Calcium_Double_Port:1.0"/>
+ <objref name="CALCIUM_string" id="IDL:Ports/Calcium_Ports/Calcium_String_Port:1.0"/>
+ <objref name="CALCIUM_boolean" id="IDL:Ports/Calcium_Ports/Calcium_Logical_Port:1.0"/>
+ <objref name="Study" id="IDL:SALOMEDS/Study:1.0"/>
+ <objref name="SObject" id="IDL:SALOMEDS/SObject:1.0"/>
+</type-list>
+
<!-- Component list -->
<component-list>
<component>
OMNIORB_CXXFLAGS="-DOMNIORB_VERSION=$OMNIORB_VERSION"
case $build_cpu in
sparc*)
- AC_DEFINE(__sparc__)
+ # AC_DEFINE(__sparc__)
OMNIORB_CXXFLAGS="$OMNIORB_CXXFLAGS -D__sparc__"
;;
*86*)
- AC_DEFINE(__x86__)
+ # AC_DEFINE(__x86__)
OMNIORB_CXXFLAGS="$OMNIORB_CXXFLAGS -D__x86__"
;;
esac
case $build_os in
osf*)
- AC_DEFINE(__osf1__)
+ # AC_DEFINE(__osf1__)
__OSVERSION__=5
- AC_DEFINE(__OSVERSION__)
+ AC_DEFINE([__OSVERSION__], [5], [Description])
OMNIORB_CXXFLAGS="$OMNIORB_CXXFLAGS -D__osf1__"
;;
solaris*)
- AC_DEFINE(__sunos__)
+ # AC_DEFINE(__sunos__)
__OSVERSION__=5
- AC_DEFINE(__OSVERSION__)
+ AC_DEFINE([__OSVERSION__], [5], [Description])
OMNIORB_CXXFLAGS="$OMNIORB_CXXFLAGS -D__sunos__"
;;
linux*)
- AC_DEFINE(__linux__)
+ # AC_DEFINE(__linux__)
__OSVERSION__=2
- AC_DEFINE(__OSVERSION__)
+ AC_DEFINE([__OSVERSION__], [2], [Description])
OMNIORB_CXXFLAGS="$OMNIORB_CXXFLAGS -D__linux__"
;;
esac
AC_SUBST(OMNIORB_IDL_TIE_H)
AC_SUBST(OMNIORB_IDL_TIE_CXX)
- AC_DEFINE(OMNIORB)
+ AC_DEFINE([OMNIORB], [], [Description])
CORBA_HAVE_POA=1
- AC_DEFINE(CORBA_HAVE_POA)
+ AC_DEFINE([CORBA_HAVE_POA], [], [Description])
CORBA_ORB_INIT_HAVE_3_ARGS=1
- AC_DEFINE(CORBA_ORB_INIT_HAVE_3_ARGS)
+ AC_DEFINE([CORBA_ORB_INIT_HAVE_3_ARGS], [], [Description])
CORBA_ORB_INIT_THIRD_ARG='"omniORB"'
- AC_DEFINE(CORBA_ORB_INIT_THIRD_ARG, "omniORB")
+ AC_DEFINE([CORBA_ORB_INIT_THIRD_ARG], [], [omniORB])
fi
AC_MSG_RESULT($swig_ok)
fi
+numpydir=`$PYTHON -c "import numpy;print numpy.get_include()" 2>/dev/null`
+if test -d "$numpydir"; then
+ SWIG_FLAGS="$SWIG_FLAGS -DWITH_NUMPY"
+ PYTHON_INCLUDES="$PYTHON_INCLUDES -I$numpydir"
+ AC_DEFINE([WITH_NUMPY], [], [Python has numpy extension])
+fi
+
AC_SUBST(SWIG_FLAGS)
AC_SUBST(SWIG)
#define COMMUNICATION_EXPORT
#endif
-#endif
\ No newline at end of file
+#endif
AM_CFLAGS = -fexceptions
pkgpython_PYTHON = calcium.py dsccalcium.py
pkgpyexec_LTLIBRARIES = _calcium.la
-SWIG_FLAGS= -python -c++ -noexcept
+MY_SWIG_FLAGS= $(SWIG_FLAGS) -noexcept
SWIG_SRC=calcium.i
_calcium_la_SOURCES = calcium_wrap.cpp
_calcium_la_LDFLAGS = -module
_calcium_la_CXXFLAGS = $(PYTHON_INCLUDES) $(COMMON_CPPFLAGS)
calcium_wrap.cpp calcium.py:calcium.i
- $(SWIG) $(SWIG_FLAGS) -o calcium_wrap.cpp $<
+ $(SWIG) $(MY_SWIG_FLAGS) -o calcium_wrap.cpp $<
CLEANFILES = calcium_wrap.cpp
%{
//C++ Includes
+#include <SALOMEconfig.h>
#include <Calcium.hxx>
#include <calcium.h>
#include <Superv_Component_i.hxx>
%{
// init section
+#ifdef WITH_NUMPY
+ import_array()
+#endif
+
PyObject* omnipy = PyImport_ImportModule((char*)"_omnipy");
if (!omnipy)
{
%}
%include "carrays.i"
-%include "cpointer.i"
-
-/* Wrap a class interface around an "int *" */
-%pointer_class(int, intp);
-/* Wrap a class interface around an "float *" */
-%pointer_class(float, floatp);
-/* Wrap a class interface around an "double *" */
-%pointer_class(double, doublep);
%array_class(int, intArray);
%array_class(float, floatArray);
%array_class(double, doubleArray);
-%typemap(python,in) CORBA::Boolean
+#ifdef WITH_NUMPY
+/*
+ * Most of this code is borrowed from numpy distribution
+ * The following code originally appeared in enthought/kiva/agg/src/numeric.i,
+ * author unknown. It was translated from C++ to C by John Hunter. Bill
+ * Spotz has modified it slightly to fix some minor bugs, add some comments
+ * and some functionality.
+ */
+
+%{
+
+#include <numpy/arrayobject.h>
+
+/* Macros to extract array attributes.
+ */
+#define is_array(a) ((a) && PyArray_Check((PyArrayObject *)a))
+#define array_type(a) (int)(PyArray_TYPE(a))
+#define array_dimensions(a) (((PyArrayObject *)a)->nd)
+#define array_size(a,i) (((PyArrayObject *)a)->dimensions[i])
+#define array_is_contiguous(a) (PyArray_ISCONTIGUOUS(a))
+
+/* Given a PyObject, return a string describing its type.
+ */
+char* pytype_string(PyObject* py_obj) {
+ if (py_obj == NULL ) return "C NULL value";
+ if (PyCallable_Check(py_obj)) return "callable" ;
+ if (PyString_Check( py_obj)) return "string" ;
+ if (PyInt_Check( py_obj)) return "int" ;
+ if (PyFloat_Check( py_obj)) return "float" ;
+ if (PyDict_Check( py_obj)) return "dict" ;
+ if (PyList_Check( py_obj)) return "list" ;
+ if (PyTuple_Check( py_obj)) return "tuple" ;
+ if (PyFile_Check( py_obj)) return "file" ;
+ if (PyModule_Check( py_obj)) return "module" ;
+ if (PyInstance_Check(py_obj)) return "instance" ;
+
+ return "unkown type";
+}
+
+/* Given a Numeric typecode, return a string describing the type.
+ */
+char* typecode_string(int typecode) {
+ char* type_names[20] = {"char","unsigned byte","byte","short",
+ "unsigned short","int","unsigned int","long",
+ "float","double","complex float","complex double",
+ "object","ntype","unkown"};
+ return type_names[typecode];
+}
+
+/* Make sure input has correct numeric type. Allow character and byte
+ * to match. Also allow int and long to match.
+ */
+int type_match(int actual_type, int desired_type) {
+ return PyArray_EquivTypenums(actual_type, desired_type);
+}
+
+/* Given a PyObject pointer, cast it to a PyArrayObject pointer if
+ * legal. If not, set the python error string appropriately and
+ * return NULL./
+ */
+PyArrayObject* obj_to_array_no_conversion(PyObject* input, int typecode) {
+ PyArrayObject* ary = NULL;
+ if (is_array(input) && (typecode == PyArray_NOTYPE ||
+ PyArray_EquivTypenums(array_type(input),
+ typecode))) {
+ ary = (PyArrayObject*) input;
+ }
+ else if is_array(input) {
+ char* desired_type = typecode_string(typecode);
+ char* actual_type = typecode_string(array_type(input));
+ PyErr_Format(PyExc_TypeError,
+ "Array of type '%s' required. Array of type '%s' given",
+ desired_type, actual_type);
+ ary = NULL;
+ }
+ else {
+ char * desired_type = typecode_string(typecode);
+ char * actual_type = pytype_string(input);
+ PyErr_Format(PyExc_TypeError,
+ "Array of type '%s' required. A %s was given",
+ desired_type, actual_type);
+ ary = NULL;
+ }
+ return ary;
+}
+
+/* Convert the given PyObject to a Numeric array with the given
+ * typecode. On Success, return a valid PyArrayObject* with the
+ * correct type. On failure, the python error string will be set and
+ * the routine returns NULL.
+ */
+PyArrayObject* obj_to_array_allow_conversion(PyObject* input, int typecode,
+ int* is_new_object)
+{
+ PyArrayObject* ary = NULL;
+ PyObject* py_obj;
+ if (is_array(input) && (typecode == PyArray_NOTYPE || type_match(array_type(input),typecode))) {
+ ary = (PyArrayObject*) input;
+ *is_new_object = 0;
+ }
+ else {
+ py_obj = PyArray_FromObject(input, typecode, 0, 0);
+ /* If NULL, PyArray_FromObject will have set python error value.*/
+ ary = (PyArrayObject*) py_obj;
+ *is_new_object = 1;
+ }
+ return ary;
+}
+
+/* Given a PyArrayObject, check to see if it is contiguous. If so,
+ * return the input pointer and flag it as not a new object. If it is
+ * not contiguous, create a new PyArrayObject using the original data,
+ * flag it as a new object and return the pointer.
+ */
+PyArrayObject* make_contiguous(PyArrayObject* ary, int* is_new_object,
+ int min_dims, int max_dims)
+{
+ PyArrayObject* result;
+ if (array_is_contiguous(ary)) {
+ result = ary;
+ *is_new_object = 0;
+ }
+ else {
+ result = (PyArrayObject*) PyArray_ContiguousFromObject((PyObject*)ary,
+ array_type(ary),
+ min_dims,
+ max_dims);
+ *is_new_object = 1;
+ }
+ return result;
+}
+
+/* Convert a given PyObject to a contiguous PyArrayObject of the
+ * specified type. If the input object is not a contiguous
+ * PyArrayObject, a new one will be created and the new object flag
+ * will be set.
+ */
+PyArrayObject* obj_to_array_contiguous_allow_conversion(PyObject* input,
+ int typecode,
+ int* is_new_object) {
+ int is_new1 = 0;
+ int is_new2 = 0;
+ PyArrayObject* ary2;
+ PyArrayObject* ary1 = obj_to_array_allow_conversion(input, typecode,
+ &is_new1);
+ if (ary1) {
+ ary2 = make_contiguous(ary1, &is_new2, 0, 0);
+ if ( is_new1 && is_new2) {
+ Py_DECREF(ary1);
+ }
+ ary1 = ary2;
+ }
+ *is_new_object = is_new1 || is_new2;
+ return ary1;
+}
+
+/* Test whether a python object is contiguous. If array is
+ * contiguous, return 1. Otherwise, set the python error string and
+ * return 0.
+ */
+int require_contiguous(PyArrayObject* ary) {
+ int contiguous = 1;
+ if (!array_is_contiguous(ary)) {
+ PyErr_SetString(PyExc_TypeError, "Array must be contiguous. A discontiguous array was given");
+ contiguous = 0;
+ }
+ return contiguous;
+}
+
+/* Require the given PyArrayObject to have a specified number of
+ * dimensions. If the array has the specified number of dimensions,
+ * return 1. Otherwise, set the python error string and return 0.
+ */
+int require_dimensions(PyArrayObject* ary, int exact_dimensions) {
+ int success = 1;
+ if (array_dimensions(ary) != exact_dimensions) {
+ PyErr_Format(PyExc_TypeError,
+ "Array must have %d dimensions. Given array has %d dimensions",
+ exact_dimensions, array_dimensions(ary));
+ success = 0;
+ }
+ return success;
+}
+
+/* Require the given PyArrayObject to have one of a list of specified
+ * number of dimensions. If the array has one of the specified number
+ * of dimensions, return 1. Otherwise, set the python error string
+ * and return 0.
+ */
+int require_dimensions_n(PyArrayObject* ary, int* exact_dimensions, int n) {
+ int success = 0;
+ int i;
+ char dims_str[255] = "";
+ char s[255];
+ for (i = 0; i < n && !success; i++) {
+ if (array_dimensions(ary) == exact_dimensions[i]) {
+ success = 1;
+ }
+ }
+ if (!success) {
+ for (i = 0; i < n-1; i++) {
+ sprintf(s, "%d, ", exact_dimensions[i]);
+ strcat(dims_str,s);
+ }
+ sprintf(s, " or %d", exact_dimensions[n-1]);
+ strcat(dims_str,s);
+ PyErr_Format(PyExc_TypeError,
+ "Array must have %s dimensions. Given array has %d dimensions",
+ dims_str, array_dimensions(ary));
+ }
+ return success;
+}
+
+/* Require the given PyArrayObject to have a specified shape. If the
+ * array has the specified shape, return 1. Otherwise, set the python
+ * error string and return 0.
+ */
+int require_size(PyArrayObject* ary, int* size, int n) {
+ int i;
+ int success = 1;
+ int len;
+ char desired_dims[255] = "[";
+ char s[255];
+ char actual_dims[255] = "[";
+ for(i=0; i < n;i++) {
+ if (size[i] != -1 && size[i] != array_size(ary,i)) {
+ success = 0;
+ }
+ }
+ if (!success) {
+ for (i = 0; i < n; i++) {
+ if (size[i] == -1) {
+ sprintf(s, "*,");
+ }
+ else
+ {
+ sprintf(s, "%d,", size[i]);
+ }
+ strcat(desired_dims,s);
+ }
+ len = strlen(desired_dims);
+ desired_dims[len-1] = ']';
+ for (i = 0; i < n; i++) {
+ sprintf(s, "%d,", array_size(ary,i));
+ strcat(actual_dims,s);
+ }
+ len = strlen(actual_dims);
+ actual_dims[len-1] = ']';
+ PyErr_Format(PyExc_TypeError,
+ "Array must have shape of %s. Given array has shape of %s",
+ desired_dims, actual_dims);
+ }
+ return success;
+}
+
+%}
+
+/* input typemap */
+%define TYPEMAP_IN3(type,typecode)
+%typemap(in) type* IN_ARRAY3
+ (PyArrayObject* array=NULL, int is_new_object) {
+ int size[1] = {-1};
+ if ((SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor,0)) == -1)
+ {
+ array = obj_to_array_contiguous_allow_conversion($input, typecode, &is_new_object);
+ if (!array || !require_dimensions(array,1) || !require_size(array,size,1)) SWIG_fail;
+ $1 = (type*) array->data;
+ }
+}
+%typemap(freearg) type* IN_ARRAY3 {
+ if (is_new_object$argnum && array$argnum) Py_DECREF(array$argnum);
+}
+%enddef
+
+TYPEMAP_IN3(int, PyArray_INT)
+TYPEMAP_IN3(float, PyArray_FLOAT )
+TYPEMAP_IN3(double, PyArray_DOUBLE)
+
+#undef TYPEMAP_IN3
+
+%apply int* IN_ARRAY3 {int *val};
+%apply float* IN_ARRAY3 {float *val};
+%apply double* IN_ARRAY3 {double *val};
+
+/* inplace typemaps */
+
+%define TYPEMAP_INPLACE3(type,typecode)
+%typemap(in) type* INPLACE_ARRAY3 (PyArrayObject* temp=NULL) {
+ if ((SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor,0)) == -1)
+ {
+ temp = obj_to_array_no_conversion($input,typecode);
+ if (!temp || !require_contiguous(temp)) SWIG_fail;
+ $1 = (type*) temp->data;
+ }
+}
+%enddef
+
+TYPEMAP_INPLACE3(int, PyArray_INT)
+TYPEMAP_INPLACE3(float, PyArray_FLOAT )
+TYPEMAP_INPLACE3(double, PyArray_DOUBLE)
+
+#undef TYPEMAP_INPLACE3
+
+%apply int* INPLACE_ARRAY3 {int *lval};
+%apply float* INPLACE_ARRAY3 {float *lval};
+%apply double* INPLACE_ARRAY3 {double *lval};
+
+#endif
+
+%typemap(in) CORBA::Boolean
{
$1=(CORBA::Boolean)PyInt_AsLong($input);
}
-%typemap(python,in) CORBA::ORB_ptr
+%typemap(in) CORBA::ORB_ptr
{
try {
CORBA::Object_ptr obj = api->pyObjRefToCxxObjRef($input,1);
PyErr_SetString(PyExc_RuntimeError, "not a valid CORBA object ptr");
}
}
-%typemap(python,in) PortableServer::POA_ptr
+
+%typemap(in) PortableServer::POA_ptr
{
try {
CORBA::Object_ptr obj = api->pyObjRefToCxxObjRef($input,1);
}
}
-%typemap(python,in) Engines::Container_ptr
+%typemap(in) Engines::Container_ptr
{
try {
CORBA::Object_ptr obj = api->pyObjRefToCxxObjRef($input,1);
PyErr_SetString(PyExc_RuntimeError, "not a valid CORBA object ptr");
}
}
-%typemap(python,in) Ports::Port_ptr
+
+%typemap(in) Ports::Port_ptr
{
try {
CORBA::Object_ptr obj = api->pyObjRefToCxxObjRef($input,1);
}
}
-%typemap(python,out) Ports::Port_ptr , Ports::PortProperties_ptr
+%typemap(out) Ports::Port_ptr , Ports::PortProperties_ptr
{
$result = api->cxxObjRefToPyObjRef($1, 1);
}
}
};
+%apply int *OUTPUT { int *nval };
+%apply float *INOUT { float *ti };
+%apply float *INPUT { float *tf };
+%apply int *INOUT { int *niter };
+%apply double *INOUT { double *ti };
+%apply double *INPUT { double *tf };
+
extern "C" void create_calcium_port(Superv_Component_i* compo,char* name,char* type,char *mode,char* depend);
#define CP_TEMPS 40
#define CP_CONT 20
#define CP_ARRET 21
-int cp_een(void *component,int dep,float t,int n,char *nom,int nval,int *val);
-int cp_edb(void *component,int dep,double t,int n,char *nom,int nval,double *val);
+int cp_cd(void *component,char *name);
+
+int cp_een(void *component,int dep,float t,int n,char *nom,int nval,int *eval);
+int cp_edb(void *component,int dep,double t,int n,char *nom,int nval,double *eval);
+int cp_ere(void *component,int dep,float t,int n,char *nom,int nval,float *eval);
+int cp_ecp(void *component,int dep,float t,int n,char *nom,int nval,float *eval);
+int cp_elo(void *component,int dep,float t,int n,char *nom,int nval,int *eval);
+
+int cp_len(void *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,int *lval);
+int cp_ldb(void *component,int dep,double *ti,double *tf,int *niter,char *nom,int nmax,int *nval,double *lval);
+int cp_lre(void *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,float *lval);
+int cp_lcp(void *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,float *lval);
+int cp_llo(void *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,int *lval);
-int cp_len(void *component,int dep,float *INOUT,float *INPUT,int *INOUT,char *nom,int nmax,int *OUTPUT,int *val);
-int cp_ldb(void *component,int dep,double *INOUT,double *INPUT,int *INOUT,char *nom,int nmax,int *OUTPUT,double *val);
int cp_fin(void *component,int cp_end);
endif
SUBDIRS = DSC_Basic DSC_User $(SUBDIR_PAR) DSC_Python
+
+EXTRA_DIST= DSC.dox
int studyId,
const Engines::MachineList& listOfMachines)
{
- const char *containerName = params.container_name;
- int nbproc = NbProc(params);
-
- MESSAGE("_LoadComponent, required " << containerName <<
- " " << componentName << " " << nbproc);
+ MESSAGE("_LoadComponent, required " << params.container_name <<
+ " " << componentName << " " << NbProc(params));
Engines::Container_var cont =
_ContManager->FindOrStartContainer(params,
{
INFOS("Caught system exception COMM_FAILURE -- unable to contact the object.");
}
-#ifndef WNT
- catch(CORBA::SystemException&)
- {
- INFOS("Caught a CORBA::SystemException.");
- }
-#endif
catch(CORBA::Exception&)
{
INFOS("Caught CORBA::Exception.");
// and the pathes prefixes for all computers
//----------------------------------------------------------------------
SALOME_ModuleCatalog_AcomponentImpl::SALOME_ModuleCatalog_AcomponentImpl
-(SALOME_ModuleCatalog::Component &C) : _Component(C)
+(SALOME_ModuleCatalog::ComponentDef &C) : _Component(C)
{
if(MYDEBUG) BEGIN_OF("SALOME_ModuleCatalog_AcomponentImpl");
{
public:
//! standard constructor
- SALOME_ModuleCatalog_AcomponentImpl(SALOME_ModuleCatalog::Component &C);
+ SALOME_ModuleCatalog_AcomponentImpl(SALOME_ModuleCatalog::ComponentDef &C);
//! standard destructor
virtual ~SALOME_ModuleCatalog_AcomponentImpl();
private :
- SALOME_ModuleCatalog::Component _Component;
+ SALOME_ModuleCatalog::ComponentDef _Component;
//! method to duplicate an interface
/*!
void PrintComponent(SALOME_ModuleCatalog::Acomponent_ptr C)
{
- const char *_name = C->componentname();
-
MESSAGE("Name : " << C->componentname());
MESSAGE("Type : " << C->component_type() << " multistudy : " << C->multistudy());
MESSAGE("Constraint : " << C->constraint());
// Function : SALOME_ModuleCatalog_Handler
// Purpose : Constructor
//----------------------------------------------------------------------
-SALOME_ModuleCatalog_Handler::SALOME_ModuleCatalog_Handler()
+SALOME_ModuleCatalog_Handler::SALOME_ModuleCatalog_Handler(ParserPathPrefixes& pathList,
+ ParserComponents& moduleList,
+ ParserTypes& typeMap,
+ TypeList& typeList):_typeMap(typeMap),_typeList(typeList),
+ _pathList(pathList),_moduleList(moduleList)
+
{
if(MYDEBUG) BEGIN_OF("SALOME_ModuleCatalog_Handler");
// Processing the document nodes
while(aCurNode != NULL)
{
- // Process path prefix list (tag test_path_prefix_list)
+ // Part 1: Process path prefix list (tag test_path_prefix_list)
if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_path_prefix_list) )
{
xmlNodePtr aCurSubNode = aCurNode->xmlChildrenNode;
}
}
- //@ Process list of components (tag test_component_list)
+ //Part 2: Process list of types
+ if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)"type-list") )
+ {
+ xmlNodePtr aTypeNode = aCurNode->xmlChildrenNode;
+ while (aTypeNode != NULL)
+ {
+ // match "type"
+ if ( !xmlStrcmp(aTypeNode->name, (const xmlChar*)"type" ))
+ {
+ // Here is a basic type description
+ ParserType aType;
+ xmlChar * name=xmlGetProp(aTypeNode,(const xmlChar*)"name");
+ if(name)
+ {
+ aType.name = (const char*)name;
+ xmlFree(name);
+ }
+ xmlChar *kind=xmlGetProp(aTypeNode,(const xmlChar*)"kind");
+ if(kind)
+ {
+ aType.kind = (const char*)kind;
+ xmlFree(kind);
+ }
+ if(aType.kind == "double" ||
+ aType.kind == "int" ||
+ aType.kind == "bool" ||
+ aType.kind == "string")
+ {
+ if ( _typeMap.find(aType.name) == _typeMap.end() )
+ {
+ std::cerr << "Registered basic type: " << aType.name << " " << aType.kind << std::endl;
+ _typeMap[aType.name]=aType;
+ _typeList.push_back(aType);
+ }
+ else
+ std::cerr << "Warning: this type (" << aType.name << "," << aType.kind << ") already exists, it will be ignored." << std::endl;
+ }
+ else
+ std::cerr << "Warning: this type (" << aType.name << "," << aType.kind << ") has incorrect kind, it will be ignored." << std::endl;
+ }
+ else if ( !xmlStrcmp(aTypeNode->name, (const xmlChar*)"sequence" ))
+ {
+ // Here is a sequence type description
+ ParserSequence aType;
+ xmlChar * name=xmlGetProp(aTypeNode,(const xmlChar*)"name");
+ if(name)
+ {
+ aType.name = (const char*)name;
+ xmlFree(name);
+ }
+ xmlChar *content=xmlGetProp(aTypeNode,(const xmlChar*)"content");
+ if(content)
+ {
+ aType.content = (const char*)content;
+ xmlFree(content);
+ }
+ if ( _typeMap.find(aType.content) != _typeMap.end() )
+ {
+ if ( _typeMap.find(aType.name) == _typeMap.end() )
+ {
+ std::cerr << "Registered sequence type: " << aType.name << " " << aType.content << std::endl;
+ _typeMap[aType.name]=aType;
+ _typeList.push_back(aType);
+ }
+ else
+ std::cerr << "Warning: this type (" << aType.name << "," << aType.kind << ") already exists, it will be ignored." << std::endl;
+ }
+ else
+ {
+ std::cerr << "Warning: this sequence type (" << aType.name << "," << aType.content << ") has unknown content type, it will be ignored." << std::endl;
+ }
+ }
+ else if ( !xmlStrcmp(aTypeNode->name, (const xmlChar*)"objref" ))
+ {
+ // Here is an objref type description
+ ParserObjref aType;
+ int error=0;
+ xmlChar * name=xmlGetProp(aTypeNode,(const xmlChar*)"name");
+ if(name)
+ {
+ aType.name = (const char*)name;
+ xmlFree(name);
+ }
+ xmlChar *id=xmlGetProp(aTypeNode,(const xmlChar*)"id");
+ if(id)
+ {
+ aType.id = (const char*)id;
+ xmlFree(id);
+ }
+
+ xmlNodePtr aTypeSubNode = aTypeNode->xmlChildrenNode;
+ while (aTypeSubNode != NULL)
+ {
+ if ( !xmlStrcmp(aTypeSubNode->name, (const xmlChar*)"base" ))
+ {
+ //a base type
+ xmlChar* content = xmlNodeGetContent(aTypeSubNode);
+ if(content)
+ {
+ std::string base=(const char*)content;
+ xmlFree(content);
+ if ( _typeMap.find(base) != _typeMap.end() && _typeMap[base].kind == "objref")
+ {
+ aType.bases.push_back(base);
+ }
+ else
+ {
+ std::cerr << "Warning: this objref type (" << aType.name << ") has unknown base type (" << base << "), it will be ignored." << std::endl;
+ error=1;
+ break;
+ }
+ }
+ }
+ aTypeSubNode = aTypeSubNode->next;
+ }
+ if(!error)
+ {
+ if ( _typeMap.find(aType.name) == _typeMap.end() )
+ {
+ std::cerr << "Registered objref type: " << aType.name << " " << aType.id << std::endl;
+ _typeMap[aType.name]=aType;
+ _typeList.push_back(aType);
+ }
+ else
+ std::cerr << "Warning: this type (" << aType.name << "," << aType.kind << ") already exists, it will be ignored." << std::endl;
+ }
+ }
+ else if ( !xmlStrcmp(aTypeNode->name, (const xmlChar*)"struct" ))
+ {
+ // Here is a struct type description
+ ParserStruct aType;
+ int error=0;
+ xmlChar * name=xmlGetProp(aTypeNode,(const xmlChar*)"name");
+ if(name)
+ {
+ aType.name = (const char*)name;
+ xmlFree(name);
+ }
+ xmlChar *id=xmlGetProp(aTypeNode,(const xmlChar*)"id");
+ if(id)
+ {
+ aType.id = (const char*)id;
+ xmlFree(id);
+ }
+
+ xmlNodePtr aTypeSubNode = aTypeNode->xmlChildrenNode;
+ while (aTypeSubNode != NULL)
+ {
+ if ( !xmlStrcmp(aTypeSubNode->name, (const xmlChar*)"member" ))
+ {
+ std::pair<std::string,std::string> member;
+ xmlChar * m_name=xmlGetProp(aTypeSubNode,(const xmlChar*)"name");
+ if(m_name)
+ {
+ member.first=(const char*)m_name;
+ xmlFree(m_name);
+ }
+ xmlChar * m_type=xmlGetProp(aTypeSubNode,(const xmlChar*)"type");
+ if(m_type)
+ {
+ member.second=(const char*)m_type;
+ xmlFree(m_type);
+ }
+ if ( _typeMap.find(member.second) != _typeMap.end() )
+ {
+ aType.members.push_back(member);
+ }
+ else
+ {
+ std::cerr << "Warning: this struct type (" << aType.name << ") has unknown member type (" << member.first << "," << member.second << "), it will be ignored." << std::endl;
+ error=1;
+ break;
+ }
+ }
+ aTypeSubNode = aTypeSubNode->next;
+ }
+ if(!error)
+ {
+ if ( _typeMap.find(aType.name) == _typeMap.end() )
+ {
+ std::cerr << "Registered struct type: " << aType.name << " " << aType.id << std::endl;
+ _typeMap[aType.name]=aType;
+ _typeList.push_back(aType);
+ }
+ else
+ std::cerr << "Warning: this type (" << aType.name << "," << aType.kind << ") already exists, it will be ignored." << std::endl;
+ }
+ } // end of struct
+ aTypeNode = aTypeNode->next;
+ }
+ }
+
+ //Part 3: Process list of components (tag test_component_list)
if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_component_list) )
{
xmlNodePtr aComponentNode = aCurNode->xmlChildrenNode;
xmlNodePtr aCompServiceNode = aSubNode->xmlChildrenNode;
while(aCompServiceNode != NULL) {
// Tag test_service
- if ( !xmlStrcmp(aCompServiceNode->name, (const xmlChar*)test_interface_name) ) {
+ if ( !xmlStrcmp(aCompServiceNode->name, (const xmlChar*)"component-service") ) {
xmlNodePtr aCompServiceSubNode = aCompServiceNode->xmlChildrenNode;
while(aCompServiceSubNode != NULL)
{
{
public:
//! standard constructor
- SALOME_ModuleCatalog_Handler();
+ SALOME_ModuleCatalog_Handler(ParserPathPrefixes& pathList,ParserComponents& moduleList,ParserTypes& typeMap,TypeList& typeList);
//! standard destructor
virtual ~SALOME_ModuleCatalog_Handler();
ParserComponent _aModule;
+ ParserPathPrefixes& _pathList;
+ ParserComponents& _moduleList;
ParserInterfaces _interfaceList;
ParserInterface _aInterface;
ParserDataStreamParameters _outDataStreamParamList;
ParserDataStreamParameter _outDataStreamParam;
+ ParserTypes& _typeMap;
+ TypeList& _typeList;
+
+ ParserSequences _sequenceMap;
+ ParserObjrefs _objrefMap;
+ ParserStructs _structMap;
};
#endif // SALOME_CATALOG_HANDLER_H
#include <string>
#include <vector>
+#include <map>
// Type Definitions
struct ParserPathPrefix
typedef std::vector<ParserComponent> ParserComponents ;
-#ifdef WRITE_CATA_COMPONENT
-// contains all the paths and the computers defined in the catalog
- ParserPathPrefixes _pathList;
-
-// contains all the modules defined in the catalog
- ParserComponents _moduleList;
-#else
-extern ParserPathPrefixes _pathList;
-extern ParserComponents _moduleList;
-#endif
+struct ParserType
+{
+ std::string name;
+ std::string kind;
+ std::string id;
+ std::string content;
+ std::vector<std::string> bases;
+ std::vector< std::pair<std::string,std::string> > members;
+};
+typedef std::map<std::string,ParserType> ParserTypes ;
+typedef std::map<std::string,ParserType&> RefTypes ;
+typedef std::vector<ParserType> TypeList ;
+
+struct ParserSequence:public ParserType
+{
+ ParserSequence(){kind="sequence";}
+};
+typedef std::map<std::string,ParserSequence> ParserSequences ;
+struct ParserObjref:public ParserType
+{
+ ParserObjref(){kind="objref";}
+};
+typedef std::map<std::string,ParserObjref> ParserObjrefs ;
+
+struct ParserStruct:public ParserType
+{
+ ParserStruct(){kind="struct";}
+};
+typedef std::map<std::string,ParserStruct> ParserStructs ;
#endif // SALOME_CATALOG_PARSER_H
int main(int argc,char **argv)
{
// initialize the ORB
- CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv);
+ CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
// LocalTraceCollector *myThreadTrace = SALOMETraceCollector::instance(orb);
try
{
// Active catalog
- SALOME_ModuleCatalogImpl Catalogue_i(argc, argv, orb);
- poa->activate_object (&Catalogue_i);
+ SALOME_ModuleCatalogImpl* Catalogue_i=new SALOME_ModuleCatalogImpl(argc, argv, orb);
+ PortableServer::ObjectId_var cataid = poa->activate_object (Catalogue_i);
+ //activate POA manager
mgr->activate();
-
- CORBA::Object_ptr myCata = Catalogue_i._this();
+ CORBA::Object_var myCata = Catalogue_i->_this();
+ Catalogue_i->_remove_ref();
// initialise Naming Service
- SALOME_NamingService *_NS;
- _NS = new SALOME_NamingService(orb);
+ SALOME_NamingService _NS(orb);
// register Catalog in Naming Service
- _NS->Register(myCata ,"/Kernel/ModulCatalog");
+ _NS.Register(myCata ,"/Kernel/ModulCatalog");
MESSAGE("Running CatalogServer.");
timer.ShowAbsolute();
#endif
orb->run();
+ std::cerr << "server returned from orb->run()" << std::endl;
+ orb->destroy();
// mgr->deactivate(true,true);
// poa->destroy(1,1);
list<string> aList;
int sepLen = theSeparator.length();
- int subLen = 0, strLen = theString.length();
+ int startPos = 0, sepPos = theString.find(theSeparator, startPos);
- for (int startPos = 0; startPos < theString.length(); startPos += subLen + sepLen)
- {
- int sepPos = theString.find(theSeparator, startPos);
- subLen = sepPos - startPos;
- if (subLen < 1) subLen = strLen - startPos;
- string anItem = theString.substr(startPos, subLen);
- aList.push_back(anItem);
- }
+ while (1)
+ {
+ string anItem ;
+ if(sepPos != string::npos)
+ anItem = theString.substr(startPos, sepPos - startPos);
+ else
+ anItem = theString.substr(startPos);
+ if (anItem.length() > 0)
+ aList.push_back(anItem);
+ if(sepPos == string::npos)
+ break;
+ startPos = sepPos + sepLen;
+ sepPos = theString.find(theSeparator, startPos);
+ }
return aList;
}
_parse_xml_file(aPath.c_str(),
_general_module_list,
- _general_path_list);
+ _general_path_list,
+ _typeMap,
+ _typeList);
}
// Verification of _general_path_list content
// _personal_path_list members with the personal catalog files
_parse_xml_file(_personal_path,
_personal_module_list,
- _personal_path_list);
+ _personal_path_list,
+ _typeMap,
+ _typeList);
// Verification of _general_path_list content
if(!_verify_path_prefix(_personal_path_list)){
}
+//! Get the list of all types of the catalog
+/*!
+ * \return the list of types
+ */
+SALOME_ModuleCatalog::ListOfTypeDefinition* SALOME_ModuleCatalogImpl::GetTypes()
+{
+ SALOME_ModuleCatalog::ListOfTypeDefinition_var type_list = new SALOME_ModuleCatalog::ListOfTypeDefinition();
+ type_list->length(_typeList.size());
+
+ for (int ind = 0 ; ind < _typeList.size() ; ind++)
+ {
+ std::cerr << "name: " << _typeList[ind].name << std::endl;
+ //no real need to call string_dup, omniorb calls it on operator= (const char *) but it is safer
+ type_list[ind].name=CORBA::string_dup(_typeList[ind].name.c_str());
+ type_list[ind].kind=SALOME_ModuleCatalog::NONE;
+ if(_typeList[ind].kind=="double")
+ type_list[ind].kind=SALOME_ModuleCatalog::Dble;
+ else if(_typeList[ind].kind=="int")
+ type_list[ind].kind=SALOME_ModuleCatalog::Int;
+ else if(_typeList[ind].kind=="bool")
+ type_list[ind].kind=SALOME_ModuleCatalog::Bool;
+ else if(_typeList[ind].kind=="string")
+ type_list[ind].kind=SALOME_ModuleCatalog::Str;
+ else if(_typeList[ind].kind=="objref")
+ {
+ type_list[ind].kind=SALOME_ModuleCatalog::Objref;
+ type_list[ind].id=CORBA::string_dup(_typeList[ind].id.c_str());
+ //bases
+ type_list[ind].bases.length(_typeList[ind].bases.size());
+ std::vector<std::string>::const_iterator miter;
+ miter=_typeList[ind].bases.begin();
+ int n_memb=0;
+ while(miter != _typeList[ind].bases.end())
+ {
+ type_list[ind].bases[n_memb]=CORBA::string_dup(miter->c_str());
+ miter++;
+ n_memb++;
+ }
+ }
+ else if(_typeList[ind].kind=="sequence")
+ {
+ type_list[ind].kind=SALOME_ModuleCatalog::Seq;
+ type_list[ind].content=CORBA::string_dup(_typeList[ind].content.c_str());
+ }
+ else if(_typeList[ind].kind=="array")
+ {
+ type_list[ind].kind=SALOME_ModuleCatalog::Array;
+ type_list[ind].content=CORBA::string_dup(_typeList[ind].content.c_str());
+ }
+ else if(_typeList[ind].kind=="struct")
+ {
+ type_list[ind].kind=SALOME_ModuleCatalog::Struc;
+ //members
+ type_list[ind].members.length(_typeList[ind].members.size());
+
+ std::vector< std::pair<std::string,std::string> >::const_iterator miter;
+ miter=_typeList[ind].members.begin();
+ int n_memb=0;
+ while(miter != _typeList[ind].members.end())
+ {
+ type_list[ind].members[n_memb].name=CORBA::string_dup(miter->first.c_str());
+ type_list[ind].members[n_memb].type=CORBA::string_dup(miter->second.c_str());
+ n_memb++;
+ miter++;
+ }
+ }
+ }
+ return type_list._retn();
+}
+
//----------------------------------------------------------------------
// Function : GetComputerList
// Purpose : get a computer list
if (_personal_module_list[ind].type == _temp_component_type)
{
_list_typed_component->length(_j + 1);
- _list_typed_component[_j] = (_moduleList[ind].name).c_str();
+ _list_typed_component[_j] = _personal_module_list[ind].name.c_str();
//if(MYDEBUG) SCRUTE(_list_typed_component[_j]);
_j++;
}
// DebugParserComponent(*C_parser);
- SALOME_ModuleCatalog::Component C_corba;
+ SALOME_ModuleCatalog::ComponentDef C_corba;
duplicate(C_corba, *C_parser);
return compo;
}
-SALOME_ModuleCatalog::Component *
+SALOME_ModuleCatalog::ComponentDef *
SALOME_ModuleCatalogImpl::GetComponentInfo(const char *name)
{
std::string s(name);
if (C_parser) {
- SALOME_ModuleCatalog::Component * C_corba
- = new SALOME_ModuleCatalog::Component;
+ SALOME_ModuleCatalog::ComponentDef * C_corba
+ = new SALOME_ModuleCatalog::ComponentDef;
duplicate(*C_corba, *C_parser);
return C_corba;
}
void
SALOME_ModuleCatalogImpl::_parse_xml_file(const char* file,
ParserComponents& modulelist,
- ParserPathPrefixes& pathList)
+ ParserPathPrefixes& pathList,
+ ParserTypes& typeMap,
+ TypeList& typeList)
{
if(MYDEBUG) BEGIN_OF("_parse_xml_file");
if(MYDEBUG) SCRUTE(file);
- SALOME_ModuleCatalog_Handler* handler = new SALOME_ModuleCatalog_Handler();
+ //Local path and module list for the file to parse
+ ParserPathPrefixes _pathList;
+ ParserComponents _moduleList;
+
+ SALOME_ModuleCatalog_Handler* handler = new SALOME_ModuleCatalog_Handler(_pathList,_moduleList,typeMap,typeList);
FILE* aFile = fopen(file, "r");
void
SALOME_ModuleCatalogImpl::ImportXmlCatalogFile(const char* file)
{
- _parse_xml_file(file, _personal_module_list, _personal_path_list);
+ _parse_xml_file(file, _personal_module_list, _personal_path_list,_typeMap,_typeList);
}
// Purpose : create a component from the catalog parsing
//----------------------------------------------------------------------
void SALOME_ModuleCatalogImpl::duplicate
-(SALOME_ModuleCatalog::Component & C_corba,
+(SALOME_ModuleCatalog::ComponentDef & C_corba,
const ParserComponent & C_parser)
{
C_corba.name = CORBA::string_dup(C_parser.name.c_str());
*/
virtual SALOME_ModuleCatalog::ListOfComputers* GetComputerList();
+ //! method to get the list of all types of the catalog
+ /*!
+ * \return the types list
+ */
+ virtual SALOME_ModuleCatalog::ListOfTypeDefinition* GetTypes();
+
//! method to get the PathPrefix of a computer
/*! If the wanted computer doesn't exist, the Notfound exception is thrown
\param machinename const char* arguments
\param componentname const char* arguments
\return the wanted component description
*/
- virtual SALOME_ModuleCatalog::Component *
+ virtual SALOME_ModuleCatalog::ComponentDef *
GetComponentInfo(const char *name);
void ping(){};
\param file const char* arguments
\param modulelist ParserComponents arguments
\param pathlist ParserPathPrefixes arguments
+ \param typeMap ParserTypes arguments
*/
virtual void _parse_xml_file(const char* file,
ParserComponents & modulelist,
- ParserPathPrefixes & pathlist);
+ ParserPathPrefixes & pathlist,
+ ParserTypes& typeMap,
+ TypeList& typeList);
//! method to find component in the parser list
/*!
\param C_corba Component argument
\param C_parser const ParserComponent argument
*/
- void duplicate(SALOME_ModuleCatalog::Component & C_corba,
+ void duplicate(SALOME_ModuleCatalog::ComponentDef & C_corba,
const ParserComponent & C_parser);
//! method to create a CORBA interface description from parser
// These variables will contain the informations on the general common catalog
ParserComponents _general_module_list ;
ParserPathPrefixes _general_path_list ;
+ ParserTypes _typeMap;
+ TypeList _typeList;
// These variables will contain the informations on the personal catalog
ParserComponents _personal_module_list ;
}
string absoluteName = string("/") + registryName;
naming.Register( varComponents , absoluteName.c_str() ) ;
- MESSAGE("On attend les requetes des clients") ;
+ MESSAGE("Wait client requests") ;
try
{
// Activation du POA
- MESSAGE("Activation du POA") ;
+ MESSAGE("POA activation") ;
manager->activate() ;
// Lancement de l'ORB
- MESSAGE("Lancement de l'ORB") ;
+ MESSAGE("ORB launching") ;
#ifdef CHECKTIME
Utils_Timer timer;
timer.Start();
}
catch( const CORBA::Exception &ex )
{
- MESSAGE("Erreur systeme") ;
+ MESSAGE("System error") ;
return EXIT_FAILURE ;
}
SCRUTE((*iter).second.Alias);
SCRUTE((*iter).second.UserName);
SCRUTE((*iter).second.AppliPath);
- SCRUTE((*iter).second.PreReqFilePath);
SCRUTE((*iter).second.OS);
SCRUTE((*iter).second.Protocol);
SCRUTE((*iter).second.Mode);
SALOMEDS_Server_SOURCES = SALOMEDS_Server.cxx
SALOMEDS_Server_CPPFLAGS = $(COMMON_CPPFLAGS)
-SALOMEDS_Server_LDADD = \
- libSalomeDS.la $(COMMON_LIBS) \
- ../ResourcesManager/libSalomeResourcesManager.la \
- @CORBA_LIBS@
+SALOMEDS_Server_LDADD = libSalomeDS.la
SALOMEDS_Client_SOURCES = SALOMEDS_Client.cxx
SALOMEDS_Client_CPPFLAGS = $(COMMON_CPPFLAGS)
-SALOMEDS_Client_LDADD = \
- libSalomeDS.la $(COMMON_LIBS) \
- ../ResourcesManager/libSalomeResourcesManager.la \
- @CORBA_LIBS@
-
+SALOMEDS_Client_LDADD = libSalomeDS.la
bin_PROGRAMS = TestSALOMEDS
dist_TestSALOMEDS_SOURCES = TestSALOMEDS.cxx
TestSALOMEDS_CPPFLAGS = $(COMMON_CPPFLAGS)
-TestSALOMEDS_LDADD = \
- libSALOMEDSTest.la ../libSalomeDS.la \
- $(RPATH)/NamingService/Test/libNamingServiceTest.la \
- $(COMMON_LIBS)
+TestSALOMEDS_LDADD = libSALOMEDSTest.la