Salome HOME
CCAR: add trace file for DSC/CALCIUM calls
authorcaremoli <caremoli>
Fri, 25 Sep 2009 12:49:12 +0000 (12:49 +0000)
committercaremoli <caremoli>
Fri, 25 Sep 2009 12:49:12 +0000 (12:49 +0000)
Trace file is written by default on stderr and can be redirect to a file (automatic name)
by setting the environment variable DSC_TRACE to 1
Trace can be desactivated by setting the environment variable DSC_TRACELEVEL to 0

19 files changed:
src/DSC/DSC_User/Datastream/Calcium/Calcium.c
src/DSC/DSC_User/Datastream/Calcium/Calcium.cxx
src/DSC/DSC_User/Datastream/Calcium/CalciumCInterface.cxx
src/DSC/DSC_User/Datastream/Calcium/CalciumCInterface.hxx
src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.cxx
src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.hxx
src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.cxx [new file with mode: 0644]
src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.hxx
src/DSC/DSC_User/Datastream/Calcium/CalciumGenericUsesPort.hxx
src/DSC/DSC_User/Datastream/Calcium/CalciumMacroCInterface.hxx
src/DSC/DSC_User/Datastream/Calcium/CalciumTypes.hxx
src/DSC/DSC_User/Datastream/Calcium/Makefile.am
src/DSC/DSC_User/Datastream/Calcium/calciumP.h
src/DSC/DSC_User/Datastream/Calcium/calciumf.c
src/DSC/DSC_User/Datastream/GenericPort.hxx
src/DSC/DSC_User/Datastream/GenericUsesPort.hxx
src/DSC/DSC_User/Superv_Component_i.cxx
src/DSC/DSC_User/Superv_Component_i.hxx
src/DSC/DSC_User/base_port.cxx

index ccef0947faf246217442ad38b10eb164ccd2224a..20c11ada42fe567c01a58a9001f352015aa15296 100644 (file)
@@ -57,8 +57,6 @@ typedef char bool;
     long   _i=*i;                                                      \
     fflush(stdout);                                                    \
     fflush(stderr);                                                    \
-    fprintf(stderr,"Beginning of ecp_" #_name " : %s %d %f\n",nomvar,*i,*ti); \
-                                                                       \
                                                                        \
     InfoType info =  ecp_lecture_##_typeName (component, mode, ti, tf, &_i, \
                                              nomvar, bufferLength, &_nRead, \
@@ -94,8 +92,6 @@ InfoType ecp_lch(void * component, int mode, float * ti,      float * tf, int * i,
   size_t _nRead;                                                       
   long   _i=*i;                                                        
   fflush(stdout);fflush(stderr);                                                       
-  fprintf(stderr,"Beginning of cp_lch: %s %d %f\n",nomvar,*i,*ti);     
-                                                                       
  
   InfoType info =  ecp_lecture_str (component, mode, ti, tf, &_i, 
                                    nomvar, bufferLength, &_nRead, 
@@ -105,7 +101,6 @@ InfoType ecp_lch(void * component, int mode, float * ti,    float * tf, int * i,
   if(mode == CP_SEQUENTIEL)                                            
     *i = _i;                                                           
   *nRead=_nRead;                                                       
-  fprintf(stderr,"End of cp_lch: %s %d \n",nomvar,*i);                 
   fflush(stdout);fflush(stderr);                                                       
                                                                        
   return info;                                                 
@@ -143,7 +138,6 @@ CALCIUM_EXT_LECT_INTERFACE_C_(lcp,float,float,cplx,);
     long   _i            =*i;                                          \
     fflush(stdout);                                                    \
     fflush(stderr);                                                    \
-    fprintf(stderr,"Beginning of cp_" #_name " : %s %d %f\n",nomvar,*i,*ti); \
                                                                        \
     if ( (data == NULL) || (_bufferLength < 1) ) return CPNTNULL;      \
                                                                        \
@@ -153,7 +147,6 @@ CALCIUM_EXT_LECT_INTERFACE_C_(lcp,float,float,cplx,);
     if(mode == CP_SEQUENTIEL)                                          \
       *i = _i;                                                         \
     *nRead=_nRead;                                                     \
-    fprintf(stderr,"End of cp_" #_name " : %s %d \n",nomvar,*i);       \
     fflush(stdout);                                                    \
     fflush(stderr);                                                    \
                                                                        \
@@ -236,9 +229,8 @@ CALCIUM_LECT_INTERFACE_C_(lch_fort_,float ,cal_int,char    ,str,STAR, LCH_LAST_P
 /**********************************************/
 
 InfoType cp_cd (void * component, char * instanceName) {
-  /* TODO : Trouver le nom de l'instance SALOME*/
-  if (instanceName) strcpy(instanceName,"UNDEFINED");
-  return CPOK;
+  InfoType info =  ecp_cd_(component,instanceName);
+  return info;
 }
 
 InfoType cp_fin (void * component, int code) {
@@ -267,13 +259,11 @@ InfoType cp_fin (void * component, int code) {
     _timeType _t          =  t;                                                \
     fflush(stdout);                                                    \
     fflush(stderr);                                                    \
-    fprintf(stderr,"Beginning of cp_" #_name " : %s %d %f\n",nomvar,i,t); \
     if ( (data == NULL) || (nbelem < 1) ) return CPNTNULL;             \
                                                                        \
     _calInt info =  ecp_ecriture_##_typeName (component, _mode, &_t, _i, \
                                               nomvar, _nbelem,         \
                                               data );                  \
-    fprintf(stderr,"End of cp_" #_name " : %s %d \n",nomvar,i);                \
     fflush(stdout);                                                    \
     fflush(stderr);                                                    \
                                                                        \
index ef9dab545c10c8b90d041da4150126dd4a0ff195..f98b1edb6484ff996a5452a25fa776c9bc40133c 100644 (file)
@@ -23,6 +23,7 @@
 #include "CalciumInterface.hxx"
 #include "calcium.h"
 #include <iostream>
+#include <sstream>
 #include <string>
 #include <exception>
 
@@ -85,7 +86,11 @@ extern "C"
 
   void create_calcium_port(Superv_Component_i* compo,char* name,char* type,char *mode,char* depend)
   {
-    MESSAGE( "create_calcium_port: " << name << " " << type << " " << mode << " " << depend );
+    std::stringstream msg;
+    msg << type << " " << mode << " " << depend;
+    CORBA::String_var componentName=compo->instanceName();
+    std::string containerName=compo->getContainerName();
+    CalciumInterface::writeEvent("create_calcium_port",containerName,componentName,name,0,msg.str().c_str());
 
     if(std::string(mode) == "IN")
       {
index 8c9dd313c1576338b493c49f2119783417d73eb9..43dc0cc82db8a5a59cf54a99c102b6e77a6e04b5 100644 (file)
@@ -71,6 +71,15 @@ ecp_fin_ (void * component, int code) {
   return CalciumTypes::CPOK;
 };
 
+extern "C" CalciumTypes::InfoType 
+ecp_cd_ (void * component, char * instanceName) {
+  Superv_Component_i * _component = static_cast<Superv_Component_i *>(component); 
+  std::string name;
+  CalciumInterface::ecp_cd( *_component,name);
+  strcpy(instanceName,name.c_str());
+  return CalciumTypes::CPOK;
+}
+
 // INTERFACE C/CPP pour les chaines de caractères
 // Le paramètre supplémentaire strsize n'étant pas utilisé
 // j'utilise la génération par la macro CALCIUM_C2CPP_INTERFACE_(str,char*,);
index e30e6739a70a7f2ff6a89abcd7a8578383de96cc..92eff648b46430c78e20c52c8b78f44761ef7af4 100644 (file)
@@ -88,5 +88,6 @@ CALCIUM_C2CPP_INTERFACE_HXX_(str,str,char*,);
 
 /* Déclaration de ecp_fin */
 extern "C" CalciumTypes::InfoType ecp_fin_ (void * component, int code);
+extern "C" CalciumTypes::InfoType ecp_cd_ (void * component, char* instanceName);
 
 #endif
index 16f85bbd4e4eb8bb365abfb8f877fd565abccbb8..d64d28a39e2813f2a8a1456b5b551322085173c6 100644 (file)
@@ -40,14 +40,14 @@ CalciumTypes::DependencyType CalciumCouplingPolicy::getDependencyType () const
 void   CalciumCouplingPolicy::setStorageLevel   (size_t         storageLevel)   {
   MESSAGE( "CalciumCouplingPolicy::setStorageLevel: " << storageLevel );
   if ( storageLevel < 1 && (storageLevel != CalciumTypes::UNLIMITED_STORAGE_LEVEL)  )
-    throw CalciumException(CalciumTypes::CPRENA,LOC("Un niveau < 1 n'est pas autorisé"));
+    throw CalciumException(CalciumTypes::CPRENA,LOC("StorageLevel < 1 is not allowed"));
   _storageLevel = storageLevel;
 }
 size_t CalciumCouplingPolicy::getStorageLevel   () const                        {return _storageLevel;}
 void   CalciumCouplingPolicy::setDateCalSchem   (CalciumTypes::DateCalSchem   dateCalSchem)   {
   MESSAGE( "CalciumCouplingPolicy::setDateCalSchem: " << dateCalSchem );
   if ( _dependencyType != CalciumTypes::TIME_DEPENDENCY )
-    throw CalciumException(CalciumTypes::CPITVR,LOC("Il est impossible de positionner un schéma temporel sur un port qui n'est pas en dépendance temporelle"));
+    throw CalciumException(CalciumTypes::CPITVR,LOC("Can't set a temporal scheme on a port that is not time dependent"));
   _dateCalSchem = dateCalSchem;
 }
 
@@ -56,34 +56,34 @@ CalciumTypes::DateCalSchem CalciumCouplingPolicy::getDateCalSchem () const   { r
 void CalciumCouplingPolicy::setAlpha(double alpha) {
   MESSAGE( "CalciumCouplingPolicy::setAlpha: " << alpha );
   if ( _dependencyType != CalciumTypes::TIME_DEPENDENCY )
-    throw CalciumException(CalciumTypes::CPITVR,LOC("Il est impossible de positionner alpha sur un port qui n'est pas en dépendance temporelle"));
+    throw CalciumException(CalciumTypes::CPITVR,LOC("Can't set alpha on a port that is not time dependent"));
   
   if ( 0 <= alpha && alpha <= 1 ) _alpha = alpha; 
   else 
-    throw CalciumException(CalciumTypes::CPRENA,LOC("Le paramètre alpha doit être compris entre [0,1]"));
+    throw CalciumException(CalciumTypes::CPRENA,LOC("alpha must be between [0,1]"));
 }
 
 double CalciumCouplingPolicy::getAlpha() const   { return _alpha; }
 
 void CalciumCouplingPolicy::setDeltaT(double deltaT ) {
   if ( _dependencyType != CalciumTypes::TIME_DEPENDENCY )
-    throw CalciumException(CalciumTypes::CPITVR,LOC("Le paramètre deltaT sur un port qui n'est pas en dépendance temporelle n'a pas de sens"));
+    throw CalciumException(CalciumTypes::CPITVR,LOC("Can't set deltaT on a port that is not time dependent"));
   if ( 0 <= deltaT && deltaT <= 1 ) _deltaT = deltaT; 
   else 
-    throw(CalciumException(CalciumTypes::CPRENA,LOC("Le paramètre deltaT doit être compris entre [0,1]")));
+    throw(CalciumException(CalciumTypes::CPRENA,LOC("deltaT must be between [0,1]")));
 }
 double CalciumCouplingPolicy::getDeltaT() const  {return _deltaT;}
 
 void CalciumCouplingPolicy::setInterpolationSchem (CalciumTypes::InterpolationSchem interpolationSchem) {
   MESSAGE( "CalciumCouplingPolicy::setInterpolationSchem: " << interpolationSchem );
   if ( _dependencyType != CalciumTypes::TIME_DEPENDENCY )
-    throw CalciumException(CalciumTypes::CPITVR,LOC("Le paramètre InterpolationSchem sur un port qui n'est pas en dépendance temporelle n'a pas de sens"));
+    throw CalciumException(CalciumTypes::CPITVR,LOC("Can't set InterpolationSchem on a port that is not time dependent"));
   _interpolationSchem=interpolationSchem;
 }
 
 void CalciumCouplingPolicy::setExtrapolationSchem (CalciumTypes::ExtrapolationSchem extrapolationSchem) {
   if ( _dependencyType != CalciumTypes::TIME_DEPENDENCY )
-    throw CalciumException(CalciumTypes::CPITVR,LOC("Le paramètre ExtrapolationSchem sur un port qui n'est pas en dépendance temporelle n'a pas de sens"));
+    throw CalciumException(CalciumTypes::CPITVR,LOC("Can't set ExtrapolationSchem on a port that is not time dependent"));
 _extrapolationSchem=extrapolationSchem;
 }
 
@@ -104,10 +104,14 @@ CalciumCouplingPolicy::getEffectiveTime(CalciumCouplingPolicy::TimeType ti,
 void CalciumCouplingPolicy::disconnect(bool provideLastGivenValue) {
 
   if (provideLastGivenValue) {
+#ifdef MYDEBUG
     std::cout << "-------- CalciumCouplingPolicy::disconnect CP_CONT  ------------------" << std::endl;
+#endif
     _disconnectDirective = CalciumTypes::CONTINUE;
   } else {
+#ifdef MYDEBUG
     std::cout << "-------- CalciumCouplingPolicy::disconnect CP_ARRET  ------------------" << std::endl;
+#endif
     _disconnectDirective = CalciumTypes::STOP;
   }
 
index ab4448cef0ac79f418ec7f38de51262fc5f9ef7c..962794c26471b9422d080fe98a483481c9ca2378 100644 (file)
@@ -171,7 +171,9 @@ struct CalciumCouplingPolicy::BoundedDataIdProcessor{
                    const DataId & dataId,
                    const Iterator  & it1) const {
     typedef typename iterator_t<Iterator>::value_type value_type;
+#ifdef MYDEBUG
     std::cout << "-------- Calcium Generic BoundedDataIdProcessor.apply() called " << std::endl;
+#endif
 
   }
 };
@@ -385,9 +387,9 @@ struct CalciumCouplingPolicy::EraseDataIdProcessor {
       }
       // Si l'itérateur pointait sur une valeur que l'on vient de supprimer
       if (dist < s ) {
-       throw(CalciumException(CalciumTypes::CPNTNULL,LOC(OSS()<< "La gestion du niveau CALCIUM " 
+        throw(CalciumException(CalciumTypes::CPNTNULL,LOC(OSS()<< "StorageLevel management " 
                                            << _couplingPolicy._storageLevel << 
-                                           " vient d'entraîner la suppression de la donnée à renvoyer")));
+                                           " has just removed the data to send")));
       }
     }
 #ifdef MYDEBUG
@@ -435,8 +437,8 @@ struct CalciumCouplingPolicy::DisconnectProcessor {
 
     // TODO : Ds GenericPort::next il faut convertir en CPSTOPSEQ
     if ( _couplingPolicy._disconnectDirective == CalciumTypes::CP_ARRET )
-      throw(CalciumException(CalciumTypes::CPINARRET,LOC(OSS()<< "La directive CP_ARRET
-                                          << " provoque l'interruption de toute lecture de données")));
+      throw(CalciumException(CalciumTypes::CPINARRET,LOC(OSS()<< "CP_ARRET directive
+                                          << " interrupts all further data reading")));
 #ifdef MYDEBUG
     std::cout << "-------- CalciumCouplingPolicy::DisconnectProcessor MARK3 --------" << std::endl;
 #endif
@@ -445,8 +447,8 @@ struct CalciumCouplingPolicy::DisconnectProcessor {
     // S'il n'y a plus de données indique que l'on a pas pu effectuer de traitement
     // TODO : Dans la gestion des niveaux il faut peut être interdire un niveau ==  0
     if ( storedDatas.empty() ) 
-      throw(CalciumException(CalciumTypes::CPNTNULL,LOC(OSS()<< "La directive CP_CONT
-                                         << " est active mais aucune donnée n'est disponible.")));
+      throw(CalciumException(CalciumTypes::CPNTNULL,LOC(OSS()<< "CP_CONT directive
+                                         << " is active but no data is available.")));
     
     // expectedDataId n'a ni été trouvé dans storedDataIds ni encadré mais il se peut
     // qu'en mode itératif il ne soit pas plus grand que le plus grand DataId stocké auquel
@@ -467,8 +469,8 @@ struct CalciumCouplingPolicy::DisconnectProcessor {
 
     // TODO : Il faut en fait renvoyer le plus proche cf IT ou DT
     if (it1 == storedDatas.end())
-      throw(CalciumException(CalciumTypes::CPNTNULL,LOC(OSS()<< "La directive CP_CONT
-                                         << " est active mais le dataId demandé est inférieur ou égal au dernier reçu.")));
+      throw(CalciumException(CalciumTypes::CPNTNULL,LOC(OSS()<< "CP_CONT directive
+                                         << " is active but the requested dataId is less or equal to the last one received.")));
   
 #ifdef MYDEBUG
     std::cout << "-------- CalciumCouplingPolicy::DisconnectProcessor MARK6 " << std::endl;
diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.cxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.cxx
new file mode 100644 (file)
index 0000000..5a25252
--- /dev/null
@@ -0,0 +1,197 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  File   : CalciumCxxInterface.cxx
+//  Author : Eric Fayolle (EDF)
+//  Module : KERNEL
+// Modified by : $LastChangedBy$
+// Date        : $LastChangedDate: 2007-03-01 13:27:58 +0100 (jeu, 01 mar 2007) $
+// Id          : $Id$
+//
+
+#include "CalciumCxxInterface.hxx"
+#define PRG_MAIN
+#include "calciumP.h"
+#include <sys/time.h>
+#include <fstream>
+#include <sys/stat.h>
+
+using namespace std; 
+
+namespace CalciumInterface 
+{
+  
+  int traceType=-1; // 0=stderr;1=file;
+  int traceLevel=-1; // 0=no trace;1=normal trace;2=detailed trace
+  std::ofstream traceFile;
+  std::ostream *out;
+
+  void initTrace(const std::string& containerName)
+    {
+      // if initialization has already been done do nothing
+      if(traceLevel >= 0)return;
+
+      std::string typeenv="0";
+      std::string levelenv="1";
+      char* valenv=0;
+      valenv=getenv("DSC_TRACE");
+      if(valenv)typeenv=valenv;
+      valenv=getenv("DSC_TRACELEVEL");
+      if(valenv)levelenv=valenv;
+
+      if(levelenv=="0")
+        traceLevel=0; // no trace 
+      else if(levelenv=="2")
+        traceLevel=2; //detailed trace
+      else 
+        traceLevel=1; // normal trace (default)
+
+      if(traceLevel==0)
+       return;
+
+      if(typeenv=="1")
+        {
+          //trace in file
+          traceType=1;
+#ifdef WNT
+          std::string logFilename=getenv("TEMP");
+          logFilename += "\\";
+#else
+          std::string logFilename="/tmp";
+          char* val = getenv("SALOME_TMP_DIR");
+          if(val)
+            {
+              struct stat file_info;
+              stat(val, &file_info);
+              bool is_dir = S_ISDIR(file_info.st_mode);
+              if (is_dir)logFilename=val;
+            }
+          logFilename += "/";
+#endif
+
+          logFilename=logFilename+containerName+".tce";
+          traceFile.open(logFilename.c_str(), std::ios::out | std::ios::app);
+          out=&traceFile;
+        }
+      else
+        {
+          //trace to stderr (default)
+          traceType=0;
+          out=&std::cerr;
+        }
+      //trace heading
+      out->width(17);
+      *out << "Elapsed time" ;
+      *out << " | " ;
+      out->width(16);
+      *out << "Request" ;
+      *out << " | " ;
+      out->width(16);
+      *out << "Container" ;
+      *out << " | " ;
+      out->width(16);
+      *out << "Instance" ;
+      *out << " | " ;
+      out->width(16);
+      *out << "Port" ;
+      *out << " | " ;
+      out->width(24);
+      *out << "Error";
+      *out << " | " ;
+      *out << "Infos" ;
+      *out << std::endl;
+    }
+
+  void writeEvent(const char* request,const std::string& containerName, const char* instance_name, const char* port_name, 
+                  int error, const char* message)
+  {
+    if(traceLevel < 0)
+      initTrace(containerName);
+    if(traceLevel == 0)return;
+
+    struct timeval tv;
+    gettimeofday(&tv,0);
+    long tt0=tv.tv_sec/3600; //hours
+
+    if(traceType == 2)
+      {
+        //notifier (not used: salome notifier is now obsolete)
+        std::ostringstream msg;
+        msg.width(7);
+        msg << tt0 ;
+        msg << ":" ;
+        long tt1=(tv.tv_sec-3600*tt0)/60;//minutes
+        msg.width(2);
+        msg << tt1 ;
+        msg << ":" ;
+        long tt2=tv.tv_sec - 3600*tt0-60*tt1; //seconds
+        msg.width(2);
+        msg << tt2 ;
+        msg << ":" ;
+        long tt3=tv.tv_usec/1000; //milliseconds
+        msg.width(3);
+        msg << tt3 ;
+        msg << " | " ;
+        msg.width(24);
+        msg << CPMESSAGE[error];
+        msg << " | " ;
+        msg << message ;
+        //send event to notifier (containerName.c_str(),instance_name, request, msg.str().c_str())
+      }
+    else
+      {
+        //cerr or file
+        out->width(7);
+        *out << tt0 ;
+        *out << ":" ;
+        long tt1=(tv.tv_sec-3600*tt0)/60;//minutes
+        out->width(2);
+        *out << tt1 ;
+        *out << ":" ;
+        long tt2=tv.tv_sec - 3600*tt0-60*tt1; //seconds
+        out->width(2);
+        *out << tt2 ;
+        *out << ":" ;
+        long tt3=tv.tv_usec/1000; //milliseconds
+        out->width(3);
+        *out << tt3 ;
+        *out << " | " ;
+        out->width(16);
+        *out << request ;
+        *out << " | " ;
+        out->width(16);
+        *out << containerName ;
+        *out << " | " ;
+        out->width(16);
+        *out << instance_name ;
+        *out << " | " ;
+        out->width(16);
+        *out << port_name ;
+        *out << " | " ;
+        out->width(24);
+        *out << CPMESSAGE[error];
+        *out << " | " ;
+        *out << message ;
+        *out << std::endl;
+      }
+  }
+};
+
index 3d3ba931acf87a1a38ad15809760523426b6af12..4b766d3b73166db01c576fe7ea5c0b1d07f76b8f 100644 (file)
@@ -59,19 +59,30 @@ struct IsSameType<T1,T1> {
 
 namespace CalciumInterface {
   
-  /********************* INTERFACE DE DECONNEXION *****************/
+  /********************* LOGGING INTERFACE *****************/
+
+  void initTrace(const std::string&);
+  void writeEvent(const char*, const std::string&, const char*, const char*, int, const char*);
+
+  /********************* CONNECTION INTERFACE *****************/
 
   static inline void
   ecp_cd (Superv_Component_i & component, std::string & instanceName)
   { 
     /* TODO : Trouver le nom de l'instance SALOME*/
-    if (instanceName.empty()) instanceName="UNDEFINED";
-
+    CORBA::String_var componentName=component.instanceName();
+    std::string containerName=component.getContainerName();
+    if (instanceName.empty()) instanceName=componentName;
+    writeEvent("CP_CD",containerName,componentName,"",0,"");
   }
 
   static void
   ecp_fin (Superv_Component_i & component, bool provideLastGivenValue)
   { 
+    CORBA::String_var componentName=component.instanceName();
+    std::string containerName=component.getContainerName();
+    writeEvent("CP_FIN",containerName,componentName,"",0,"");
+
     std::vector<std::string> usesPortNames;
     std::vector<std::string>::const_iterator it;
     component.get_uses_port_names(usesPortNames);    
@@ -82,42 +93,48 @@ namespace CalciumInterface {
     //     uses_port *myUsesPort;
     calcium_uses_port* myCalciumUsesPort;
       
-    for (it=usesPortNames.begin(); it != usesPortNames.end(); ++it) {
-      try {
-
-       myCalciumUsesPort= 
-         component.Superv_Component_i::get_port< calcium_uses_port >((*it).c_str());
+    for (it=usesPortNames.begin(); it != usesPortNames.end(); ++it) 
+      {
+        try 
+          {
+            myCalciumUsesPort= component.Superv_Component_i::get_port< calcium_uses_port >((*it).c_str());
 
-//     component.Superv_Component_i::get_port(myUsesPort,(*it).c_str());
-//     calcium_uses_port* myCalciumUsesPort=
-//       dynamic_cast<calcium_uses_port*>(myUsesPort);
+//         component.Superv_Component_i::get_port(myUsesPort,(*it).c_str());
+//         calcium_uses_port* myCalciumUsesPort=
+//           dynamic_cast<calcium_uses_port*>(myUsesPort);
 
 #ifdef MYDEBUG
-       std::cerr << "-------- CalciumInterface(ecp_fin) MARK 1 -|"<< *it <<"|----"<< 
-         //      typeid(myUsesPort).name() <<"-------------" <<
-         typeid(myCalciumUsesPort).name() <<"-------------" << std::endl;
+            std::cerr << "-------- CalciumInterface(ecp_fin) MARK 1 -|"<< *it <<"|----"<< 
+          //          typeid(myUsesPort).name() <<"-------------" <<
+              typeid(myCalciumUsesPort).name() <<"-------------" << std::endl;
 #endif
-       
-//     if ( !myCalciumUsesPort )
-//       throw Superv_Component_i::BadCast(LOC(OSS()<<"Impossible de convertir le port "
-//                                             << *it << " en port de type calcium_uses_port." ));
-
-       myCalciumUsesPort->disconnect(provideLastGivenValue);
-
-      } catch ( const Superv_Component_i::BadCast & ex) {
-      MESSAGE(ex.what());
-       throw (CalciumException(CalciumTypes::CPTPVR,ex));
-      } catch ( const DSC_Exception & ex) {
-      MESSAGE(ex.what());
-       // Exception venant de SupervComponent :
-       //   PortNotDefined(CPNMVR), PortNotConnected(CPLIEN)  
-       // ou du port uses : Dsc_Exception
-       // On continue à traiter la deconnexion des autres ports uses
-      } catch (...) {
-       throw (CalciumException(CalciumTypes::CPATAL,"Exception innatendue"));
-       // En fonction du mode de gestion des erreurs throw;
+        
+//         if ( !myCalciumUsesPort )
+//           throw Superv_Component_i::BadCast(LOC(OSS()<<"Impossible de convertir le port "
+//                                                 << *it << " en port de type calcium_uses_port." ));
+
+            myCalciumUsesPort->disconnect(provideLastGivenValue);
+          }
+        catch ( const Superv_Component_i::BadCast & ex) 
+          {
+            writeEvent("CP_FIN",containerName,componentName,"",CalciumTypes::CPTPVR,ex.what());
+            throw (CalciumException(CalciumTypes::CPTPVR,ex));
+          }
+        catch ( const DSC_Exception & ex) 
+          {
+            writeEvent("CP_FIN",containerName,componentName,"",CalciumTypes::CPOK,ex.what());
+            // Exception venant de SupervComponent :
+            //   PortNotDefined(CPNMVR), PortNotConnected(CPLIEN)  
+            // ou du port uses : Dsc_Exception
+            // On continue à traiter la deconnexion des autres ports uses
+          }
+        catch (...) 
+          {
+            writeEvent("CP_FIN",containerName,componentName,"",CalciumTypes::CPATAL,"Unexpected exception");
+            throw (CalciumException(CalciumTypes::CPATAL,"Unexpected exception"));
+            // En fonction du mode de gestion des erreurs throw;
+          }
       }
-    }
   }
 
 
@@ -146,7 +163,7 @@ namespace CalciumInterface {
   }
 
 
-  /********************* INTERFACES DE LECTURE *****************/
+  /********************* READING INTERFACE *****************/
 
 
   // T1 est le type de données
@@ -156,23 +173,25 @@ namespace CalciumInterface {
   //     le port à utiliser est le port cplx
   template <typename T1, typename T2 > static void
   ecp_lecture ( Superv_Component_i & component,
-              int    const  & dependencyType,
-              double        & ti,
-              double const  & tf,
-              long          & i,
-              const std::string  & nomVar, 
-              size_t          bufferLength,
-              size_t        & nRead, 
-              T1            * &data )
+               int    const  & dependencyType,
+               double        & ti,
+               double const  & tf,
+               long          & i,
+               const std::string  & nomVar, 
+               size_t          bufferLength,
+               size_t        & nRead, 
+               T1            * &data )
   {
 
     assert(&component);
+    CORBA::String_var componentName=component.instanceName();
+    std::string containerName=component.getContainerName();
 
     typedef typename ProvidesPortTraits<T2>::PortType     PortType;
     typedef typename PortType::DataManipulator            DataManipulator;
     typedef typename DataManipulator::Type                CorbaDataType; // Attention != T1
     typedef typename DataManipulator::InnerType           InnerType;
-    CalciumTypes::DependencyType _dependencyType=              
+    CalciumTypes::DependencyType _dependencyType=                
       static_cast<CalciumTypes::DependencyType>(dependencyType);
     
     CorbaDataType     corbaData;
@@ -182,8 +201,10 @@ namespace CalciumInterface {
 #endif
 
     if (nomVar.empty())
-      throw CalciumException(CalciumTypes::CPNMVR,
-                               LOC("Le nom de la variable est <nul>"));
+      {
+        writeEvent("BEGIN_READ",containerName,componentName,"",CalciumTypes::CPNMVR,"");
+        throw CalciumException(CalciumTypes::CPNMVR, LOC("Empty variable name"));
+      }
     PortType * port;
 #ifdef MYDEBUG
     std::cout << "-------- CalciumInterface(lecture) MARK 2 --"<<typeid(port).name()<<"----------------" << std::endl;
@@ -193,57 +214,82 @@ namespace CalciumInterface {
     std::cout << "-------- CalciumInterface(lecture) MARK 2b2 -----" << typeid(t2).name() << "-------------" << std::endl;
 #endif
 
-    try {
-      port  = component.Superv_Component_i::get_port< PortType > (nomVar.c_str());
+    try 
+      {
+        port  = component.Superv_Component_i::get_port< PortType > (nomVar.c_str());
 #ifdef MYDEBUG
-      std::cout << "-------- CalciumInterface(ecp_lecture) MARK 3 ------------------" << std::endl;
+        std::cout << "-------- CalciumInterface(ecp_lecture) MARK 3 ------------------" << std::endl;
 #endif
-    } catch ( const Superv_Component_i::PortNotDefined & ex) {
-      MESSAGE(ex.what());
-      throw (CalciumException(CalciumTypes::CPNMVR,ex));
-    } catch ( const Superv_Component_i::PortNotConnected & ex) {
-      MESSAGE(ex.what());
-      throw (CalciumException(CalciumTypes::CPLIEN,ex)); 
-      // VERIFIER LES CAS DES CODES : CPINARRET, CPSTOPSEQ, CPCTVR, CPLIEN
-    } catch ( const Superv_Component_i::BadCast & ex) {
-      MESSAGE(ex.what());
-      throw (CalciumException(CalciumTypes::CPTPVR,ex));
-    }
+      }
+    catch ( const Superv_Component_i::PortNotDefined & ex) 
+      {
+        writeEvent("BEGIN_READ",containerName,componentName,nomVar.c_str(),CalciumTypes::CPNMVR,ex.what());
+        throw (CalciumException(CalciumTypes::CPNMVR,ex));
+      }
+    catch ( const Superv_Component_i::PortNotConnected & ex) 
+      {
+        writeEvent("BEGIN_READ",containerName,componentName,nomVar.c_str(),CalciumTypes::CPLIEN,ex.what());
+        throw (CalciumException(CalciumTypes::CPLIEN,ex)); 
+        // VERIFIER LES CAS DES CODES : CPINARRET, CPSTOPSEQ, CPCTVR, CPLIEN
+      }
+    catch ( const Superv_Component_i::BadCast & ex) 
+      {
+        writeEvent("BEGIN_READ",containerName,componentName,nomVar.c_str(),CalciumTypes::CPTPVR,ex.what());
+        throw (CalciumException(CalciumTypes::CPTPVR,ex));
+      }
   
     // mode == mode du port 
     CalciumTypes::DependencyType portDependencyType = port->getDependencyType();
 
     if ( portDependencyType == CalciumTypes::UNDEFINED_DEPENDENCY )
-      throw CalciumException(CalciumTypes::CPIT,
-                            LOC(OSS()<<"Le mode de dépendance de la variable " 
-                                << nomVar << " est indéfini."));
+      {
+        writeEvent("BEGIN_READ",containerName,componentName,nomVar.c_str(),CalciumTypes::CPIT,"Dependency mode is undefined");
+        throw CalciumException(CalciumTypes::CPIT, LOC(OSS()<<"Dependency mode of variable " << nomVar << " is undefined."));
+      }
 
-    if ( ( portDependencyType != _dependencyType ) && 
-        ( _dependencyType != CalciumTypes::SEQUENCE_DEPENDENCY ) ) 
-      throw CalciumException(CalciumTypes::CPITVR,
-                            LOC(OSS()<<"Le mode de dépendance de la variable " 
-                                << nomVar << ": " << portDependencyType 
-                                << " ne correspond pas au mode demandé."));
+    if ( ( portDependencyType != _dependencyType ) && ( _dependencyType != CalciumTypes::SEQUENCE_DEPENDENCY ) ) 
+      {
+        writeEvent("BEGIN_READ",containerName,componentName,nomVar.c_str(),CalciumTypes::CPIT,
+                   "Dependency mode is not the same as the required one");
+        throw CalciumException(CalciumTypes::CPITVR, LOC(OSS()<<"Dependency mode of variable " << nomVar << ": " 
+                                << portDependencyType << " is not the same as the required one."));
+      }
 
   
-    if ( _dependencyType == CalciumTypes::TIME_DEPENDENCY ) {
-      corbaData = port->get(ti,tf, 0);
+    std::stringstream msgout,msg;
+    if ( _dependencyType == CalciumTypes::TIME_DEPENDENCY ) 
+      {
+        double   tt=ti;
+        msg << "ti=" << ti << ", tf=" << tf ;
+        writeEvent("BEGIN_READ",containerName,componentName,nomVar.c_str(),0,msg.str().c_str());
+        corbaData = port->get(tt,tf, 0);
+        msgout << "read t=" << tt ;
 #ifdef MYDEBUG
-      std::cout << "-------- CalciumInterface(ecp_lecture) MARK 5 ------------------" << std::endl;
+        std::cout << "-------- CalciumInterface(ecp_lecture) MARK 5 ------------------" << std::endl;
 #endif
-    } 
-    else if ( _dependencyType == CalciumTypes::ITERATION_DEPENDENCY ) {
-      corbaData = port->get(0, i);
+      } 
+    else if ( _dependencyType == CalciumTypes::ITERATION_DEPENDENCY ) 
+      {
+        msg << "i=" << i ;
+        writeEvent("BEGIN_READ",containerName,componentName,nomVar.c_str(),0,msg.str().c_str());
+        corbaData = port->get(0, i);
+        msgout << "read i=" << i ;
 #ifdef MYDEBUG
-      std::cout << "-------- CalciumInterface(ecp_lecture) MARK 6 ------------------" << std::endl;
+        std::cout << "-------- CalciumInterface(ecp_lecture) MARK 6 ------------------" << std::endl;
 #endif
-    } else {
-      // Lecture en séquence
+      } 
+    else 
+      {
+        // Sequential read
 #ifdef MYDEBUG
-      std::cout << "-------- CalciumInterface(ecp_lecture) MARK 7 ------------------" << std::endl;
+        std::cout << "-------- CalciumInterface(ecp_lecture) MARK 7 ------------------" << std::endl;
 #endif
-      corbaData = port->next(ti,i);
-    }
+        writeEvent("BEGIN_READ",containerName,componentName,nomVar.c_str(),0,"Sequential read");
+        corbaData = port->next(ti,i);
+        msgout << "read ";
+        if(i==0)msgout<< "t=" <<ti;
+        else msgout<< "i=" <<i;
+      }
  
 #ifdef MYDEBUG
     std::cout << "-------- CalciumInterface(ecp_lecture) MARK 8 ------------------" << std::endl;
@@ -254,95 +300,98 @@ namespace CalciumInterface {
 #endif
    
     // Vérifie si l'utilisateur demande du 0 copie
-    if ( data == NULL ) {
-      if ( bufferLength != 0 ) {
-       MESSAGE("bufferLength devrait valoir 0 pour l'utilisation du mode sans copie (data==NULL)");
-      }
-      nRead = corbaDataSize;
-      // Si les types T1 et InnerType sont différents, il faudra effectuer tout de même une recopie
-      if (!IsSameType<T1,InnerType>::value) data = new T1[nRead];
+    if ( data == NULL ) 
+      {
+        if ( bufferLength != 0 ) 
+          {
+            MESSAGE("bufferLength devrait valoir 0 pour l'utilisation du mode sans copie (data==NULL)");
+          }
+        nRead = corbaDataSize;
+        // Si les types T1 et InnerType sont différents, il faudra effectuer tout de même une recopie
+        if (!IsSameType<T1,InnerType>::value) data = new T1[nRead];
 #ifdef MYDEBUG
-      std::cout << "-------- CalciumInterface(ecp_lecture) MARK 9 ------------------" << std::endl;
+        std::cout << "-------- CalciumInterface(ecp_lecture) MARK 9 ------------------" << std::endl;
 #endif
-      // On essaye de faire du 0 copy si les types T1 et InnerType sont les mêmes.
-      // Copy2UserSpace : 
-      // La raison d'être du foncteur Copy2UserSpace est qu'il n'est pas possible de compiler
-      // une expression d'affectation sur des types incompatibles ; même 
-      // si cette expression se trouve dans une branche non exécuté d'un test
-      // portant sur la compatibilité des types.
-      // En utilisant le foncteur Copy2UserSpace, seule la spécialisation en adéquation
-      // avec la compatibilité des types sera compilée 
-      Copy2UserSpace< IsSameType<T1,InnerType>::value, DataManipulator >::apply(data,corbaData,nRead);
+        // On essaye de faire du 0 copy si les types T1 et InnerType sont les mêmes.
+        // Copy2UserSpace : 
+        // La raison d'être du foncteur Copy2UserSpace est qu'il n'est pas possible de compiler
+        // une expression d'affectation sur des types incompatibles ; même 
+        // si cette expression se trouve dans une branche non exécuté d'un test
+        // portant sur la compatibilité des types.
+        // En utilisant le foncteur Copy2UserSpace, seule la spécialisation en adéquation
+        // avec la compatibilité des types sera compilée 
+        Copy2UserSpace< IsSameType<T1,InnerType>::value, DataManipulator >::apply(data,corbaData,nRead);
 #ifdef MYDEBUG
-      std::cout << "-------- CalciumInterface(ecp_lecture) MARK 10 ------------------" << std::endl;
+        std::cout << "-------- CalciumInterface(ecp_lecture) MARK 10 ------------------" << std::endl;
 #endif
-      // Attention : Seul CalciumCouplingPolicy via eraseDataId doit décider de supprimer ou non
-      // la donnée corba associée à un DataId ! Ne pas effectuer la desallocation suivante :
-      // DataManipulator::delete_data(corbaData); 
-      // ni DataManipulator::getPointer(corbaData,true); qui détruit la sequence lorsque l'on
-      // prend la propriété du buffer
-      //  old : Dans les deux cas la structure CORBA n'est plus utile 
-      //  old : Si !IsSameType<T1,InnerType>::value l'objet CORBA est détruit avec son contenu
-      //  old : Dans l'autre cas seul la coquille CORBA est détruite 
-      //  L'utilisateur devra appeler ecp_free qui déterminera s'il est necessaire
-      //  de désallouer un buffer intermédiaire ( types différents) ou de rendre la propriété
-   } else {
-      nRead = std::min < size_t > (corbaDataSize,bufferLength);
+        // Attention : Seul CalciumCouplingPolicy via eraseDataId doit décider de supprimer ou non
+        // la donnée corba associée à un DataId ! Ne pas effectuer la desallocation suivante :
+        // DataManipulator::delete_data(corbaData); 
+        // ni DataManipulator::getPointer(corbaData,true); qui détruit la sequence lorsque l'on
+        // prend la propriété du buffer
+        //  old : Dans les deux cas la structure CORBA n'est plus utile 
+        //  old : Si !IsSameType<T1,InnerType>::value l'objet CORBA est détruit avec son contenu
+        //  old : Dans l'autre cas seul la coquille CORBA est détruite 
+        //  L'utilisateur devra appeler ecp_free qui déterminera s'il est necessaire
+        //  de désallouer un buffer intermédiaire ( types différents) ou de rendre la propriété
+      }
+    else 
+      {
+        nRead = std::min < size_t > (corbaDataSize,bufferLength);
 #ifdef MYDEBUG
-      std::cout << "-------- CalciumInterface(ecp_lecture) MARK 11 ------------------" << std::endl;
+        std::cout << "-------- CalciumInterface(ecp_lecture) MARK 11 ------------------" << std::endl;
 #endif
-      Copy2UserSpace<false, DataManipulator >::apply(data,corbaData,nRead);
-      //Déjà fait ci-dessus : 
-      //DataManipulator::copy(corbaData,data,nRead);
-    
+        Copy2UserSpace<false, DataManipulator >::apply(data,corbaData,nRead);
+        //Déjà fait ci-dessus : 
+        //DataManipulator::copy(corbaData,data,nRead);
 #ifdef MYDEBUG
-      std::cout << "-------- CalciumInterface(ecp_lecture) MARK 12 ------------------" << std::endl;
+        std::cout << "-------- CalciumInterface(ecp_lecture) MARK 12 ------------------" << std::endl;
 #endif
-   }
+      }
 #ifdef MYDEBUG
     std::cout << "-------- CalciumInterface(ecp_lecture), Valeur de data : " << std::endl;
     std::copy(data,data+nRead,std::ostream_iterator<T1>(std::cout," "));
     std::cout << "Ptr :" << data << std::endl;
-
     std::cout << "-------- CalciumInterface(ecp_lecture) MARK 13 ------------------" << std::endl;
 #endif
-  
+    writeEvent("END_READ",containerName,componentName,nomVar.c_str(),CalciumTypes::CPOK,msgout.str().c_str());
     return;
   }
 
-  // T1 est le type de données
+  // T1 is the data type
   template <typename T1 > static void
   ecp_lecture ( Superv_Component_i & component,
-              int    const      & dependencyType,
-              double            & ti,
-              double const      & tf,
-              long              & i,
-              const std::string & nomVar, 
-              size_t              bufferLength,
-              size_t            & nRead, 
-              T1                * &data )
+               int    const      & dependencyType,
+               double            & ti,
+               double const      & tf,
+               long              & i,
+               const std::string & nomVar, 
+               size_t              bufferLength,
+               size_t            & nRead, 
+               T1                * &data )
   {
     ecp_lecture<T1,T1> (component,dependencyType,ti,tf,
-                       i,nomVar,bufferLength,nRead,data);
+                        i,nomVar,bufferLength,nRead,data);
   
   }
 
-  /********************* INTERFACES D'ECRITURE *****************/
+  /********************* WRITING INTERFACE *****************/
 
   // T1 : DataType
   // T2 : PortType
   template <typename T1, typename T2> static void
   ecp_ecriture ( Superv_Component_i & component,
-                int    const      & dependencyType,
-                double const      & t,
-                long   const      & i,
-                const std::string & nomVar, 
-                size_t              bufferLength,
-                T1                  const  & data ) 
+                 int    const      & dependencyType,
+                 double const      & t,
+                 long   const      & i,
+                 const std::string & nomVar, 
+                 size_t              bufferLength,
+                 T1                  const  & data ) 
   {
     
     assert(&component);
+    CORBA::String_var componentName=component.instanceName();
+    std::string containerName=component.getContainerName();
 
     //typedef typename StarTrait<TT>::NonStarType                    T;
     typedef typename boost::remove_all_extents< T1 >::type           T1_without_extent;
@@ -357,14 +406,17 @@ namespace CalciumInterface {
     
     T1_without_extent const & _data = data;
 
-    CalciumTypes::DependencyType _dependencyType=              
+    CalciumTypes::DependencyType _dependencyType=                
       static_cast<CalciumTypes::DependencyType>(dependencyType);
 
 #ifdef MYDEBUG
     std::cerr << "-------- CalciumInterface(ecriture) MARK 1 ------------------" << std::endl;
 #endif
-    if ( nomVar.empty() ) throw CalciumException(CalciumTypes::CPNMVR,
-                                                   LOC("Le nom de la variable est <nul>"));
+    if ( nomVar.empty() )
+      {
+        writeEvent("WRITE",containerName,componentName,"",CalciumTypes::CPNMVR,"");
+        throw CalciumException(CalciumTypes::CPNMVR, LOC("Empty variable name"));
+      }
     UsesPortType * port;
 #ifdef MYDEBUG
     std::cout << "-------- CalciumInterface(ecriture) MARK 2 ---"<<typeid(port).name()<<"---------------" << std::endl;
@@ -374,22 +426,29 @@ namespace CalciumInterface {
     std::cout << "-------- CalciumInterface(ecriture) MARK 2b2 -----" << typeid(t2).name() << "-------------" << std::endl;
 #endif
 
-    try {
-      port  = component.Superv_Component_i::get_port< UsesPortType > (nomVar.c_str());
+    try 
+      {
+        port  = component.Superv_Component_i::get_port< UsesPortType > (nomVar.c_str());
 #ifdef MYDEBUG
-      std::cout << "-------- CalciumInterface(ecriture) MARK 3 ------------------" << std::endl;
+        std::cout << "-------- CalciumInterface(ecriture) MARK 3 ------------------" << std::endl;
 #endif
-    } catch ( const Superv_Component_i::PortNotDefined & ex) {
-      MESSAGE(ex.what());
-      throw (CalciumException(CalciumTypes::CPNMVR,ex));
-    } catch ( const Superv_Component_i::PortNotConnected & ex) {
-      MESSAGE(ex.what());
-      throw (CalciumException(CalciumTypes::CPLIEN,ex)); 
-      // VERIFIER LES CAS DES CODES : CPINARRET, CPSTOPSEQ, CPCTVR, CPLIEN
-    } catch ( const Superv_Component_i::BadCast & ex) {
-      MESSAGE(ex.what());
-      throw (CalciumException(CalciumTypes::CPTPVR,ex));
-    }
+      }
+    catch ( const Superv_Component_i::PortNotDefined & ex) 
+      {
+        writeEvent("WRITE",containerName,componentName,nomVar.c_str(),CalciumTypes::CPNMVR,ex.what());
+        throw (CalciumException(CalciumTypes::CPNMVR,ex));
+      }
+    catch ( const Superv_Component_i::PortNotConnected & ex) 
+      {
+        writeEvent("WRITE",containerName,componentName,nomVar.c_str(),CalciumTypes::CPLIEN,ex.what());
+        throw (CalciumException(CalciumTypes::CPLIEN,ex)); 
+        // VERIFIER LES CAS DES CODES : CPINARRET, CPSTOPSEQ, CPCTVR, CPLIEN
+      }
+    catch ( const Superv_Component_i::BadCast & ex) 
+      {
+        writeEvent("WRITE",containerName,componentName,nomVar.c_str(),CalciumTypes::CPTPVR,ex.what());
+        throw (CalciumException(CalciumTypes::CPTPVR,ex));
+      }
  
     // mode == mode du port 
     // On pourrait créer la méthode CORBA dans le mode de Couplage CALCIUM.
@@ -405,14 +464,18 @@ namespace CalciumInterface {
 //     }
 
     if ( _dependencyType == CalciumTypes::UNDEFINED_DEPENDENCY )
-      throw CalciumException(CalciumTypes::CPIT,
-                               LOC(OSS()<<"Le mode de dépendance demandé pour la variable " 
-                                   << nomVar << " est indéfini."));
+      {
+        writeEvent("WRITE",containerName,componentName,nomVar.c_str(),CalciumTypes::CPIT,"Dependency mode is undefined");
+        throw CalciumException(CalciumTypes::CPIT, LOC(OSS()<<"Dependency mode of variable " << nomVar << " is undefined."));
+      }
 
     if ( _dependencyType == CalciumTypes::SEQUENCE_DEPENDENCY )
-      throw CalciumException(CalciumTypes::CPIT,
-                               LOC(OSS()<<"Le mode de dépendance SEQUENCE_DEPENDENCY pour la variable " 
-                                   << nomVar << " est impossible en écriture."));
+      {
+        writeEvent("WRITE",containerName,componentName,nomVar.c_str(),CalciumTypes::CPIT,
+                   "SEQUENCE_DEPENDENCY mode is not possible when writing");
+        throw CalciumException(CalciumTypes::CPIT, LOC(OSS()<<"Dependency mode SEQUENCE_DEPENDENCY for variable " << nomVar 
+                               << " is not possible when writing."));
+      }
 
     // Il faudrait que le port provides génère une exception si le mode donnée n'est pas
     // le bon. La seule façon de le faire est d'envoyer -1 en temps si on n'est en itération
@@ -421,20 +484,20 @@ namespace CalciumInterface {
     // ---->
 //     if ( portDependencyType != _dependencyType ) 
 //       throw CalciumException(CalciumTypes::CPITVR,
-//                             LOC(OSS()<<"Le mode de dépendance de la variable " 
-//                                 << nomVar << " ne correspond pas au mode demandé."));
+//                                 LOC(OSS()<<"Le mode de dépendance de la variable " 
+//                                     << nomVar << " ne correspond pas au mode demandé."));
 
   
     if ( bufferLength < 1 )
-      throw CalciumException(CalciumTypes::CPNTNULL,
-                               LOC(OSS()<<"Le buffer a envoyer est de taille nulle "));
-
+      {
+        writeEvent("WRITE",containerName,componentName,nomVar.c_str(),CalciumTypes::CPNTNULL,"Buffer to send is empty");
+        throw CalciumException(CalciumTypes::CPNTNULL, LOC(OSS()<<"Buffer to send is empty"));
+      }
 
     CorbaDataType corbaData;
 #ifdef MYDEBUG
     std::cout << "-------- CalciumInterface(ecriture) MARK 4 ------------------" << std::endl;
 #endif
-
     
     // Si les types Utilisateurs et CORBA sont différents
     // il faut effectuer une recopie sinon on utilise directement le
@@ -465,36 +528,45 @@ namespace CalciumInterface {
 
     Copy2CorbaSpace<IsSameType<T1_without_extent,InnerType>::value, DataManipulator >::apply(corbaData,_data,bufferLength);
  
-    //TODO : GERER LES EXCEPTIONS ICI : ex le port n'est pas connecté
-    if ( _dependencyType == CalciumTypes::TIME_DEPENDENCY ) {
-      try
+    //TODO : GERER LES EXCEPTIONS ICI : ex le port n'est pas connecte
+    if ( _dependencyType == CalciumTypes::TIME_DEPENDENCY ) 
       {
-        port->put(*corbaData,t, -1); 
-      }
-      catch ( const DSC_Exception & ex) 
-      {
-        throw (CalciumException(CalciumTypes::CPATAL,ex.what()));
-      }
-      //Le -1 peut être traité par le cst DataIdContainer et transformé en 0 
-      //Etre obligé de mettre une étoile ds (*corbadata) va poser des pb pour les types <> seq
+        try
+          {
+            port->put(*corbaData,t, -1); 
+            std::stringstream msg;
+            msg << "t=" << t ;
+            writeEvent("WRITE",containerName,componentName,nomVar.c_str(),CalciumTypes::CPOK,msg.str().c_str());
+          }
+        catch ( const DSC_Exception & ex) 
+          {
+            writeEvent("WRITE",containerName,componentName,nomVar.c_str(),CalciumTypes::CPATAL,ex.what());
+            throw (CalciumException(CalciumTypes::CPATAL,ex.what()));
+          }
+        //Le -1 peut être traité par le cst DataIdContainer et transformé en 0 
+        //Etre obligé de mettre une étoile ds (*corbadata) va poser des pb pour les types <> seq
 #ifdef MYDEBUG
-      std::cout << "-------- CalciumInterface(ecriture) MARK 5 ------------------" << std::endl;
+        std::cout << "-------- CalciumInterface(ecriture) MARK 5 ------------------" << std::endl;
 #endif
-    } 
-    else if ( _dependencyType == CalciumTypes::ITERATION_DEPENDENCY ) {
-      try
-      {
-        port->put(*corbaData,-1, i);
-      }
-      catch ( const DSC_Exception & ex) 
+      } 
+    else if ( _dependencyType == CalciumTypes::ITERATION_DEPENDENCY ) 
       {
-        throw (CalciumException(CalciumTypes::CPATAL,ex.what()));
-      }
+        try
+          {
+            port->put(*corbaData,-1, i);
+            std::stringstream msg;
+            msg << "i=" << i ;
+            writeEvent("WRITE",containerName,componentName,nomVar.c_str(),CalciumTypes::CPOK,msg.str().c_str());
+          }
+        catch ( const DSC_Exception & ex) 
+          {
+            writeEvent("WRITE",containerName,componentName,nomVar.c_str(),CalciumTypes::CPATAL,ex.what());
+            throw (CalciumException(CalciumTypes::CPATAL,ex.what()));
+          }
 #ifdef MYDEBUG
-      std::cout << "-------- CalciumInterface(ecriture) MARK 6 ------------------" << std::endl;
+        std::cout << "-------- CalciumInterface(ecriture) MARK 6 ------------------" << std::endl;
 #endif
-    } 
-
+      } 
     
 #ifdef MYDEBUG
     std::cout << "-------- CalciumInterface(ecriture), Valeur de corbaData : " << std::endl;
@@ -515,12 +587,13 @@ namespace CalciumInterface {
   
   template <typename T1> static void
   ecp_ecriture ( Superv_Component_i & component,
-                int    const  & dependencyType,
-                double const  & t,
-                long   const  & i,
-                const std::string  & nomVar, 
-                size_t bufferLength,
-                T1 const & data ) {
+                 int    const  & dependencyType,
+                 double const  & t,
+                 long   const  & i,
+                 const std::string  & nomVar, 
+                 size_t bufferLength,
+                 T1 const & data ) 
+  {
     ecp_ecriture<T1,T1> (component,dependencyType,t,i,nomVar,bufferLength,data); 
   };
 
index f42338ea9f5b47e9a337691f3d78ce6a928dcc2c..8524723df5299ec5fab72bd4efd3b5523ed73ac6 100644 (file)
@@ -53,7 +53,9 @@ CalciumGenericUsesPort< DataManipulator,CorbaPortType, repositoryName >::disconn
   for(int i = 0; i < this->_my_ports->length(); i++) {
     CorbaPortTypePtr port = CorbaPortType::_narrow((*this->_my_ports)[i]);
     try {
+#ifdef MYDEBUG
       std::cerr << "-------- CalciumGenericUsesPort<>::disconnect: "<< i << std::endl;
+#endif
 
       port->disconnect(provideLastGivenValue);
     } catch(const CORBA::SystemException& ex){
index d819f95dac583da5866cfc18995ed709bdf57ff8..999619c1bcc1c0baf89a38416dac5d5062a48052 100644 (file)
@@ -33,105 +33,116 @@ Id          : $Id$
 
 
 /****** CALCIUM_C2CPP_INTERFACE_HXX_ :                                  ******/
-/****** Déclaration de ecp_lecture_... , ecp_ecriture_..., ecp_free_... ******/
+/****** Declarations: ecp_lecture_... , ecp_ecriture_..., ecp_free_... ******/
 
-#define CALCIUM_C2CPP_INTERFACE_HXX_(_name,_porttype,_type,_qual)                      \
-  extern "C" CalciumTypes::InfoType ecp_lecture_##_name (void * component, int dependencyType, \
-                                                        CalTimeType< _type _qual >::TimeType * ti, \
-                                                        CalTimeType< _type _qual >::TimeType * tf, long * i, \
-                                                        const char * const nomvar, size_t bufferLength, \
-                                                        size_t * nRead, _type _qual ** data ); \
-                                                                       \
-                                                                       \
-  extern "C" void ecp_lecture_##_name##_free ( _type _qual * data);    \
-                                                                       \
-                                                                       \
-  extern "C" CalciumTypes::InfoType ecp_ecriture_##_name (void * component, int dependencyType, \
-                                                         CalTimeType< _type _qual >::TimeType *t, \
-                                                         long  i,      \
-                                                         const char * const nomvar, size_t bufferLength, \
-                                                         _type _qual * data ); \
+#define CALCIUM_C2CPP_INTERFACE_HXX_(_name,_porttype,_type,_qual)                                                 \
+  extern "C" CalciumTypes::InfoType ecp_lecture_##_name (void * component, int dependencyType,                    \
+                                                         CalTimeType< _type _qual >::TimeType * ti,               \
+                                                         CalTimeType< _type _qual >::TimeType * tf, long * i,     \
+                                                         const char * const nomvar, size_t bufferLength,          \
+                                                         size_t * nRead, _type _qual ** data );                   \
+                                                                                                                  \
+                                                                                                                  \
+  extern "C" void ecp_lecture_##_name##_free ( _type _qual * data);                                               \
+                                                                                                                  \
+                                                                                                                  \
+  extern "C" CalciumTypes::InfoType ecp_ecriture_##_name (void * component, int dependencyType,                   \
+                                                          CalTimeType< _type _qual >::TimeType *t,                \
+                                                          long  i,                                                \
+                                                          const char * const nomvar, size_t bufferLength,         \
+                                                          _type _qual * data );                                   \
   
 
 
 
-                                                                       
-/****** CALCIUM_C2CPP_INTERFACE_CXX_ :                                ******/                                                                  
-/******Définition de ecp_lecture_... , ecp_ecriture_..., ecp_free_... ******/
-#define CALCIUM_C2CPP_INTERFACE_CXX_(_name,_porttype,_type,_qual)                      \
-  extern "C" CalciumTypes::InfoType ecp_lecture_##_name (void * component, int dependencyType, \
-                                                        CalTimeType< _type _qual >::TimeType * ti, \
-                                                        CalTimeType< _type _qual >::TimeType * tf, long * i, \
-                                                        const char * const nomvar, size_t bufferLength, \
-                                                        size_t * nRead, _type _qual ** data ) { \
-    Superv_Component_i * _component = static_cast<Superv_Component_i *>(component); \
-    double         _ti=*ti;                                            \
-    double         _tf=*tf;                                            \
-    size_t         _nRead=0;                                           \
-    size_t         _bufferLength=bufferLength;                         \
-                                                                       \
-    if ( IsSameType< _porttype , cplx >::value ) _bufferLength*=2;             \
-    DEBTRACE( "-------- CalciumInterface(lecture Inter Part) MARK 1 ------------------" ) \
-      try {                                                            \
-      CalciumInterface::ecp_lecture< _type,_porttype >( *_component,   \
-                                                       dependencyType, \
-                                                       _ti, _tf, *i,   \
-                                                       nomvar,         \
-                                                       _bufferLength, _nRead, *data); \
-    } catch ( const CalciumException & ex) {                           \
-      DEBTRACE( ex.what() );                                           \
-      return ex.getInfo();                                             \
-    } catch ( ... ) {                                                  \
-      DEBTRACE( "Unexpected exception ") ;             \
-      return CalciumTypes::CPATAL;                                     \
-    }                                                                  \
-    if ( IsSameType< _porttype , cplx >::value ) { *nRead=_nRead/2;            \
-      DEBTRACE( "-------- CalciumInterface(lecture Inter Part) IsSameType cplx -------------" ) \
-       DEBTRACE( "-------- CalciumInterface(lecture Inter Part) _nRead  : " << _nRead ) \
-       DEBTRACE( "-------- CalciumInterface(lecture Inter Part) *nRead  : " << *nRead ) \
-       } else *nRead = _nRead;                                         \
-    if (dependencyType == CalciumTypes::CP_SEQUENTIEL ) \
-      *ti=(CalTimeType< _type _qual >::TimeType)(_ti);                 \
-    DEBTRACE( "-------- CalciumInterface(lecture Inter Part), Data Ptr :" << *data ) \
-      return CalciumTypes::CPOK;                                               \
-  };                                                                   \
-                                                                       \
-                                                                       \
-  extern "C" void ecp_lecture_##_name##_free ( _type _qual * data) {   \
-    CalciumInterface::ecp_free< _type, _porttype >(data);                      \
-  };                                                                   \
-                                                                       \
-                                                                       \
-  extern "C" CalciumTypes::InfoType ecp_ecriture_##_name (void * component, int dependencyType, \
-                                                         CalTimeType< _type _qual >::TimeType *t, \
-                                                         long  i,      \
-                                                         const char * const nomvar, size_t bufferLength, \
-                                                         _type _qual * data ) { \
-    DEBTRACE( "-------- CalciumInterface(ecriture Inter Part) MARK 0 ------------------" ) \
-    Superv_Component_i * _component = static_cast<Superv_Component_i *>(component); \
-    /* Je ne sais pas pourquoi, je n'arrive pas à passer t par valeur : corruption de la pile*/ \
-    double         _t=*t;                                              \
-    size_t         _bufferLength=bufferLength;                         \
-    if ( IsSameType< _porttype , cplx >::value ) _bufferLength=_bufferLength*2; \
-    fprintf(stderr,"Beginning of ecp_ecriture_" #_name " : %s %ld %e\n",nomvar,i,_t); \
-    DEBTRACE( "-------- CalciumInterface(ecriture Inter Part) MARK 1 ------------------" ) \
-      try {                                                            \
-      /*printf("-------- CalciumInterface(ecriture Inter Part), cp_name : Nom de la var. de type %s : %s\n",#_type,nomvar);*/ \
-      DEBTRACE( "----------->-" << nomvar )                            \
-       CalciumInterface::ecp_ecriture< _type, _porttype >( *_component,        \
-                                                       dependencyType, \
-                                                       _t,i,nomvar,_bufferLength,*data); \
-    } catch ( const CalciumException & ex) {                           \
-      DEBTRACE( ex.what() );                           \
-      return ex.getInfo();                                             \
-    } catch ( ... ) {                          \
-      DEBTRACE("Unexpected exception " ); \
-      return CalciumTypes::CPATAL;                                             \
-    }                                                                  \
-    fprintf(stderr,"End of ecp_ecriture_" #_name " : %s %ld %e\n",nomvar,i,_t); \
-    DEBTRACE( "-------- CalciumInterface(ecriture Inter Part), Valeur de data :" << data ) \
-      return CalciumTypes::CPOK;                                       \
-  };                                                                   \
+                                                                        
+/****** CALCIUM_C2CPP_INTERFACE_CXX_ :                                ******/                                                                        
+/******Definitions: ecp_lecture_... , ecp_ecriture_..., ecp_free_... ******/
+#define CALCIUM_C2CPP_INTERFACE_CXX_(_name,_porttype,_type,_qual)                                                \
+  extern "C" CalciumTypes::InfoType ecp_lecture_##_name (void * component, int dependencyType,                   \
+                                                         CalTimeType< _type _qual >::TimeType * ti,              \
+                                                         CalTimeType< _type _qual >::TimeType * tf, long * i,    \
+                                                         const char * const nomvar, size_t bufferLength,         \
+                                                         size_t * nRead, _type _qual ** data )                   \
+  {                                                                                                              \
+    Superv_Component_i * _component = static_cast<Superv_Component_i *>(component);                              \
+    double         _ti=*ti;                                                                                      \
+    double         _tf=*tf;                                                                                      \
+    size_t         _nRead=0;                                                                                     \
+    size_t         _bufferLength=bufferLength;                                                                   \
+                                                                                                                 \
+    if ( IsSameType< _porttype , cplx >::value ) _bufferLength*=2;                                               \
+    DEBTRACE( "-------- CalciumInterface(lecture Inter Part) MARK 1 ------------------" )                        \
+    try                                                                                                          \
+      {                                                                                                          \
+        CalciumInterface::ecp_lecture< _type,_porttype >( *_component, dependencyType, _ti, _tf, *i, nomvar,     \
+                                                          _bufferLength, _nRead, *data);                         \
+      }                                                                                                          \
+    catch ( const CalciumException & ex)                                                                         \
+      {                                                                                                          \
+        DEBTRACE( ex.what() );                                                                                   \
+        return ex.getInfo();                                                                                     \
+      }                                                                                                          \
+    catch ( ... )                                                                                                \
+      {                                                                                                          \
+        DEBTRACE( "Unexpected exception ") ;                                                                     \
+        return CalciumTypes::CPATAL;                                                                             \
+      }                                                                                                          \
+    if ( IsSameType< _porttype , cplx >::value )                                                                 \
+      {                                                                                                          \
+        *nRead=_nRead/2;                                                                                         \
+        DEBTRACE( "-------- CalciumInterface(lecture Inter Part) IsSameType cplx -------------" )                \
+        DEBTRACE( "-------- CalciumInterface(lecture Inter Part) _nRead  : " << _nRead )                         \
+        DEBTRACE( "-------- CalciumInterface(lecture Inter Part) *nRead  : " << *nRead )                         \
+      }                                                                                                          \
+    else                                                                                                         \
+      *nRead = _nRead;                                                                                           \
+    if (dependencyType == CalciumTypes::CP_SEQUENTIEL )                                                          \
+      *ti=(CalTimeType< _type _qual >::TimeType)(_ti);                                                           \
+    DEBTRACE( "-------- CalciumInterface(lecture Inter Part), Data Ptr :" << *data )                             \
+    return CalciumTypes::CPOK;                                                                                   \
+  };                                                                                                             \
+                                                                                                                 \
+                                                                                                                 \
+  extern "C" void ecp_lecture_##_name##_free ( _type _qual * data)                                               \
+  {                                                                                                              \
+    CalciumInterface::ecp_free< _type, _porttype >(data);                                                        \
+  };                                                                                                             \
+                                                                                                                 \
+                                                                                                                 \
+  extern "C" CalciumTypes::InfoType ecp_ecriture_##_name (void * component, int dependencyType,           \
+                                                          CalTimeType< _type _qual >::TimeType *t,        \
+                                                          long  i,                                        \
+                                                          const char * const nomvar, size_t bufferLength, \
+                                                          _type _qual * data )                            \
+  {                                                                                                       \
+    DEBTRACE( "-------- CalciumInterface(ecriture Inter Part) MARK 0 ------------------" )                \
+    Superv_Component_i * _component = static_cast<Superv_Component_i *>(component);                       \
+    /* Je ne sais pas pourquoi, je n'arrive pas à passer t par valeur : corruption de la pile*/           \
+    double         _t=*t;                                                                                 \
+    size_t         _bufferLength=bufferLength;                                                            \
+    if ( IsSameType< _porttype , cplx >::value ) _bufferLength=_bufferLength*2;                           \
+    DEBTRACE( "-------- CalciumInterface(ecriture Inter Part) MARK 1 ------------------" )                \
+    try                                                                                                   \
+      {                                                                                                   \
+        /*printf("-------- CalciumInterface(ecriture Inter Part), cp_name : Nom de la var. de type %s : %s\n",#_type,nomvar);*/ \
+        DEBTRACE( "----------->-" << nomvar )                                                             \
+        CalciumInterface::ecp_ecriture< _type, _porttype >( *_component, dependencyType,                  \
+                                                            _t,i,nomvar,_bufferLength,*data);             \
+      }                                                                                                   \
+    catch ( const CalciumException & ex)                                                                  \
+      {                                                                                                   \
+        DEBTRACE( ex.what() );                                                                            \
+        return ex.getInfo();                                                                              \
+      }                                                                                                   \
+    catch ( ... )                                                                                         \
+      {                                                                                                   \
+        DEBTRACE("Unexpected exception " );                                                               \
+        return CalciumTypes::CPATAL;                                                                      \
+      }                                                                                                   \
+    DEBTRACE( "-------- CalciumInterface(ecriture Inter Part), Valeur de data :" << data )                \
+    return CalciumTypes::CPOK;                                                                            \
+  };                                                                                                      \
 
 
 #endif
index 328e50910f424b370f886fa669ce201b620a93c2..24e8934477aeb4242bd3159bab8325ad514d647f 100644 (file)
@@ -35,11 +35,11 @@ namespace CalciumTypes {
   const float EPSILON =  1.e-6;
 
 
-  /* Type de dependance des variables  */
-  const int    CP_TEMPS        =       40;
-  const int    CP_ITERATION    =       41;
-  const int    CP_SEQUENTIEL   =       42;
-  /* Mode de dependance inconnu                */
+  /* Type de dependance des variables */
+  const int CP_TEMPS = 40;
+  const int CP_ITERATION = 41;
+  const int CP_SEQUENTIEL = 42;
+  /* Mode de dependance inconnu  */
   const int     CPIT   = 6;
 
   /* Directive de continuation d'une instance  */
@@ -65,144 +65,144 @@ namespace CalciumTypes {
   typedef int  InfoType ;
   const   int  UNLIMITED_STORAGE_LEVEL = CP_ILLIMITE;
   typedef enum {UNDEFINED_DEPENDENCY=CPIT,TIME_DEPENDENCY=CP_TEMPS,
-               ITERATION_DEPENDENCY=CP_ITERATION,
-               // TYPE uniquement utilisé ds CalciumInterface 
-               SEQUENCE_DEPENDENCY =CP_SEQUENTIEL 
+                ITERATION_DEPENDENCY=CP_ITERATION,
+                // TYPE uniquement utilisé ds CalciumInterface 
+                SEQUENCE_DEPENDENCY =CP_SEQUENTIEL 
                                                    }                        DependencyType;
   typedef enum {TI_SCHEM=TI,TF_SCHEM=TF,ALPHA_SCHEM}                        DateCalSchem;
   typedef enum {L0_SCHEM=CP_ESCALIER,L1_SCHEM=CP_LINEAIRE}                  InterpolationSchem;
   typedef enum {UNDEFINED_EXTRA_SCHEM,E0_SCHEM,E1_SCHEM}                    ExtrapolationSchem;
   typedef enum {UNDEFINED_DIRECTIVE=0,CONTINUE=CP_CONT,STOP=CP_ARRET}       DisconnectDirective;
 
-  /* Codes d'erreur                    */
+  /* Codes d'erreur   */
 
-  /* Pas d'erreur                      */
+  /* Pas d'erreur          */
   const int CPOK   = 0;
 
-  /* Emetteur inconnu                  */
+  /* Emetteur inconnu   */
   const int CPERIU = 1;
 
-  /* Nom de variable inconnu           */
+  /* Nom de variable inconnu  */
   const int CPNMVR = 2;
   
-  /* Type entree/sortie incompatible   */
+  /* Type entree/sortie incompatible */
   const int CPIOVR = 3;
   
-  /* Type inconnu                              */
+  /* Type inconnu    */
   const int CPTP   = 4;
   
-  /* Type de variable incompatible     */
+  /* Type de variable incompatible */
   const int CPTPVR = 5;
   
-  /* Mode de dependance inconnu                */
+  /* Mode de dependance inconnu  */
   // Déclaré au dessus 
   // const int CPIT   = 6;
 
-  /* Mode dependance incompatible              */
+  /* Mode dependance incompatible  */
   const int CPITVR = 7;
 
-  /* Requete non autorisee             */
+  /* Requete non autorisee  */
   const int CPRENA = 8;
 
-  /* Type de deconnexion incorrect     */
+  /* Type de deconnexion incorrect */
   const int CPDNTP = 9;
 
-  /* Directive de deconnexion incorrecte       */
+  /* Directive de deconnexion incorrecte */
   const int CPDNDI = 10;
 
-  /* Nom de code inconnu                       */
+  /* Nom de code inconnu   */
   const int CPNMCD = 11;
 
-  /* Nom d'instance inconnu            */
+  /* Nom d'instance inconnu  */
   const int CPNMIN = 12;
 
-  /* Attente                           */
+  /* Attente    */
   const int CPATTENTE = 13;
 
-  /* Blocage                           */
+  /* Blocage    */
   const int CPBLOC    = 14;
 
-  /* Nombre de valeurs transmises egal a zero  */
+  /* Nombre de valeurs transmises egal a zero */
   const int CPNTNULL  = 15;
 
-  /* Longueur de variable insuffisante */
+  /* Longueur de variable insuffisante */
   const int CPLGVR    = 16;
 
-  /* L'instance doit s'arreter         */
+  /* L'instance doit s'arreter  */
   const int CPSTOP    = 17;
 
-  /* Arret anormal                     */
+  /* Arret anormal   */
   const int CPATAL    = 18;
 
-  /* Coupleur absent                   */
+  /* Coupleur absent   */
   const int CPNOCP    = 19;
 
-  /* Variable sortante non connectee   */
+  /* Variable sortante non connectee */
   const int CPCTVR    = 20;
 
-  /* Nombre de pas a executer egal a zero      */
+  /* Nombre de pas a executer egal a zero */
   const int CPPASNULL = 21;
 
-  /* Machine inconnue                  */
+  /* Machine inconnue   */
   const int CPMACHINE = 22;
 
-  /* COUPLAGE_GROUPE non positionnee   */
+  /* COUPLAGE_GROUPE non positionnee */
   const int CPGRNU    = 23;
 
-  /* Groupe d'instances incorrect              */
+  /* Groupe d'instances incorrect  */
   const int CPGRIN    = 24;
 
-  /* Fin du fichier d'entree           */
+  /* Fin du fichier d'entree  */
   const int CPFINFICH = 25;
 
-  /* Erreur de format dans un fichier  */
+  /* Erreur de format dans un fichier */
   const int CPERRFICH = 26;
 
-  /* Requete d'avance de n pas annulee */
-  /* par passage en mode NORMAL                */
+  /* Requete d'avance de n pas annulee */
+  /* par passage en mode NORMAL  */
   const int CPNORERR  = 27;
 
-  /* Coupleur en mode NORMAL pour une  */
-  /* requete RUN_N_PAS ou DEF_*                */
+  /* Coupleur en mode NORMAL pour une */
+  /* requete RUN_N_PAS ou DEF_*  */
   const int CPRUNERR  = 28;
 
-  /* Option inconnue                   */
+  /* Option inconnue   */
   const int CPOPT     = 29;
 
-  /* Valeur d'option inconnue          */
+  /* Valeur d'option inconnue  */
   const int CPVALOPT  = 30;
 
-  /* Ecriture impossible par effacement        */
+  /* Ecriture impossible par effacement */
   const int CPECREFF  = 31;
 
-  /* Lecture d'une variable non connectee      */
-  /* ou n'appartenant pas a un lien VAS        */
-  /* ou VAV s'il s'agit d'une sortante */
+  /* Lecture d'une variable non connectee */
+  /* ou n'appartenant pas a un lien VAS */
+  /* ou VAV s'il s'agit d'une sortante */
   const int CPLIEN    = 32;
 
   /* Lecture d'une variable d'une instance*/
-  /* deconnectee avec directive CP_ARRET       */
+  /* deconnectee avec directive CP_ARRET */
   const int CPINARRET = 33;
 
-  /* Les lectures sequentielles ne pourront plus       */
-  /* etre satisfaites : instance productrice arretee   */
+  /* Les lectures sequentielles ne pourront plus */
+  /* etre satisfaites : instance productrice arretee */
   const int CPSTOPSEQ = 34;
 
-  /* Erreur dans la chaine de declaration      */
+  /* Erreur dans la chaine de declaration */
   const int CPDECL    = 35;
 
   /* Erreur dans l'execution de l'instance ajoutee */
   const int CPINEXEC  = 36;
 
-  /* Erreur PVM                                */
+  /* Erreur PVM    */
   //   const int CPPVM = 37;
   //   const int CPCOM = 37;
   /* Erreur detectee au niveau de l'int CPERRINST = 38;
 
-  /* Mode d'execution non defini               */
+  /* Mode d'execution non defini  */
   //   const int CPMODE    = 39;
 
-  /* Instance deconnectee                      */
+  /* Instance deconnectee   */
   const int CPINSTDEC = 40;
 
 }
index ef082a8b679d322c289f6fde0313b2b5ad47be90..eb8dcb082dacd7c008de006ac3118f880e6b92bc 100644 (file)
@@ -109,6 +109,7 @@ libSalomeCalcium_la_SOURCES  = calcium_port_factory.cxx \
                               calcium_repository_types.cxx \
                               CalciumCouplingPolicy.cxx \
                               CorbaTypes2CalciumTypes.cxx \
+                              CalciumCxxInterface.cxx \
                               CalciumTypes2CorbaTypes.cxx \
                                CalciumCInterface.cxx \
                               CalciumProvidesPort.cxx \
index e64fbd99a84ba828ee4520a001956b44eb04ef0a..9fde53f1de06702291843b0283e46941123121a8 100644 (file)
 #ifndef __CONST_H
 #define __CONST_H
 
-#ifndef        TrueOrFalse
-#define        TrueOrFalse     int
-#define        TRUE    1
-#define        FALSE   0
+#ifndef        TrueOrFalse
+#define        TrueOrFalse        int
+#define        TRUE        1
+#define        FALSE        0
 #endif
 
-/* Definition d'un type de donnes pour le stockage du  */
-/* des pas de temps                                    */
+/* Definition d'un type de donnes pour le stockage du        */
+/* des pas de temps                                        */
 #ifdef CRAY
-#define        Temps           float
-#define        FORMAT_TEMPS    "%lf"
+#define        Temps                float
+#define        FORMAT_TEMPS        "%lf"
 #else
-#define Temps          double
-#define        FORMAT_TEMPS    "%lg"
+#define Temps                double
+#define        FORMAT_TEMPS        "%lg"
 #endif
 
 /* Precision relative pour tests d'egalite sur les temps */
 #define EPSILON  1.e-6
 
-/* Tailles utilisees lors des transmissions des noms   */
-#define                VERSION_LEN     144
-#define                CODE_LEN        72
-#define                VARIABLE_LEN    144
-#define                INSTANCE_LEN    72
-#define                DRIVER_LEN      72
-
-
-/* Tailles maximums                                    */
-#define                ARCHI_LEN               64
-#define                ENV_VAR_LEN             256
-#define                ACCC_LEN                256
-#define                PVM_LEN                 256
-#define                USER_LEN                256
-#define                MACHINE_LEN             256
-#define                COMMAND_LEN             256
-#define                MAX_LEN                 256
-#define                FICHIER_LEN             256
-
-/* Nombre de lignes dans une page du fichier erreur    *
- * de trace                                            */
-#define                NB_LIGNE_ERREUR         45
-#define                NB_LIGNE_TRACE          45
-
-
-
-/* Type d'arret d'une instance                         */
-#define                CP_NORMALE              10
-#define                CP_ANORMALE             11
-
-/* Directive de continuation d'une instance            */
-#define                CP_CONT                 20
-#define                CP_ARRET                21
-
-/* Etat d'une instance                                 */
-#define                CP_INITIAL              22
-#define                CP_NON_CONNECTE         23
-#define                CP_ATTENTE              24
-#define                CP_EXECUTION            25
-#define                CP_DECONNECTE           26
-#define                CP_TERMINE              27
-
-/* Type de variables                                   */
-#define                CP_ENTIER               30
-#define                CP_REEL                 31
-#define                CP_DREEL                32
-#define                CP_COMPLEXE             33
-#define                CP_LOGIQUE              34
-#define                CP_CHAINE               35
-
-/* Type de dependance des variables                    */
-#define                CP_TEMPS                40
-#define                CP_ITERATION            41
-#define                CP_SEQUENTIEL           42
-
-/* Send des variables                                  */
-#define                CP_IN                   50
-#define                CP_OUT                  51
-
-/* Type des instances                                  */
-#define                CP_NORMAL               60
-#define                CP_ESPION               62
-
-/* Niveaux                                             */
-#define                CP_ILLIMITE             -70
-#define                CP_AUTESP               -71
-
-/* Mode de trace                                       */
-#define                CP_SANS                 80
-#define                CP_SUCCINCT             81
-#define                CP_DETAILLE             82
-
-
-/* Mode d'execution                                    */
-/* La valeur CP_NORMAL definie pour les types          */
-/* est aussi utilisee                                  */
-#define                CP_PAUSE                91
-
-
-/* Type d'interpolation                                        */
-#define                CP_LINEAIRE             100
-#define                CP_ESCALIER             101
-
-
-/* Repere dans cycle de temps                          */
-#define                TI                      110
-#define                TF                      111
-
-/* Mode de nettoyage des donnees d'un lien             */
-#define                CP_TOUTES               120
-#define                CP_AUCUNE               121
-#define                CP_PAS                  122
-
-/* Options configurables                               */
-#define                CP_ROUTE                131
-#define                CP_ERREURS              132
-
-/* Valeurs pour l'option CP_ROUTE                      */
-#define                CP_ROUTE_NORMAL         133
-#define                CP_ROUTE_DIRECT         134
-
-/* Valeurs pour l'option Comportement en cas d'erreur  */
-#define                CP_AUTO                 135
-#define                CP_BLOCAGE              136
-#define                CP_MANUEL               137
-
-/* Type de requete de lecture                          */
-/* La valeur CP_ATTENTE define pour l'etat d'une       */
-/* instance est aussi utilisee                         */
-#define                CP_IMMEDIATE            141
-
-/* Definition des types de lien                                */
-#define CPLVAV                         151
-#define CPLVAF                         152
-#define CPLVAS                         153
-#define CPLCAV                         154
-#define CPLFAV                         155
-
-/* Codes des entetes des messages (Evenemet *)         */
-#define                ERREUR                          1000
-#define                CONNEXION                       1001
-#define                EMISSION                        1002
-#define                DECONNEXION                     1003
-#define                LECTURE_VARIABLE                1004
-#define                ECRITURE_VARIABLE               1005
-#define                FIN_DE_PAS                      1006
-#define                AUIN_FIN_DE_PAS                 1007
-#define                EFFACEMENT                      1008
-#define                MODE_EXEC                       1009
-#define                RUN_N_PAS                       1010
-#define                DEF_CODE                        1011
-#define                DEF_INSTANCE                    1012
-#define                DEF_LIEN                        1013
-#define                DEM_VERSION                     1014
-#define                SET_OPTION                      1015
-#define                DEM_OPTION                      1016
-#define                DEM_CODES                       1017
-#define                DEM_INSTS_DE_CODE               1018
-#define                DEM_VARIABLES                   1019
-#define                DEM_VARS_DE_CODE                1020
-#define                DEM_VARS_DE_INST                1021
-#define                DEM_CARS_DE_VARIABLE            1022
-#define                DEM_CARS_DE_LIEN                1023
-#define                ENV_VALEURS_VARIABLE            1024
-#define                ENV_OPTION                      1025
-#define                ENV_CODES                       1026
-#define                ENV_INSTS_DE_CODE               1027
-#define                ENV_VARIABLES                   1028
-#define                ENV_VARS_DE_CODE                1029
-#define                ENV_VARS_DE_INST                1030
-#define                ENV_CARS_DE_VARIABLE            1031
-#define                ENV_CARS_DE_LIEN                1032
+/* Tailles utilisees lors des transmissions des noms        */
+#define                VERSION_LEN        144
+#define                CODE_LEN        72
+#define                VARIABLE_LEN        144
+#define                INSTANCE_LEN        72
+#define                DRIVER_LEN        72
+
+
+/* Tailles maximums                                         */
+#define                ARCHI_LEN                64
+#define                ENV_VAR_LEN                256
+#define                ACCC_LEN                256
+#define                PVM_LEN                        256
+#define                USER_LEN                256
+#define                MACHINE_LEN                256
+#define                COMMAND_LEN                256
+#define                MAX_LEN                        256
+#define                FICHIER_LEN                256
+
+/* Nombre de lignes dans une page du fichier erreur         *
+ * de trace                                                */
+#define                NB_LIGNE_ERREUR                45
+#define                NB_LIGNE_TRACE                45
+
+
+
+/* Type d'arret d'une instance                                */
+#define                CP_NORMALE                10
+#define                CP_ANORMALE                11
+
+/* Directive de continuation d'une instance                */
+#define                CP_CONT                        20
+#define                CP_ARRET                21
+
+/* Etat d'une instance                                        */
+#define                CP_INITIAL                22
+#define                CP_NON_CONNECTE                23
+#define                CP_ATTENTE                24
+#define                CP_EXECUTION                25
+#define                CP_DECONNECTE                26
+#define                CP_TERMINE                27
+
+/* Type de variables                                        */
+#define                CP_ENTIER                30
+#define                CP_REEL                        31
+#define                CP_DREEL                32
+#define                CP_COMPLEXE                33
+#define                CP_LOGIQUE                34
+#define                CP_CHAINE                35
+
+/* Type de dependance des variables                        */
+#define                CP_TEMPS                40
+#define                CP_ITERATION                41
+#define                CP_SEQUENTIEL                42
+
+/* Send des variables                                        */
+#define                CP_IN                        50
+#define                CP_OUT                        51
+
+/* Type des instances                                        */
+#define                CP_NORMAL                60
+#define                CP_ESPION                62
+
+/* Niveaux                                                */
+#define                CP_ILLIMITE                -70
+#define                CP_AUTESP                -71
+
+/* Mode de trace                                        */
+#define                CP_SANS                        80
+#define                CP_SUCCINCT                81
+#define                CP_DETAILLE                82
+
+
+/* Mode d'execution                                        */
+/* La valeur CP_NORMAL definie pour les types                */
+/* est aussi utilisee                                        */
+#define                CP_PAUSE                91
+
+
+/* Type d'interpolation                                        */
+#define                CP_LINEAIRE                100
+#define                CP_ESCALIER                101
+
+
+/* Repere dans cycle de temps                                */
+#define                TI                        110
+#define                TF                        111
+
+/* Mode de nettoyage des donnees d'un lien                */
+#define                CP_TOUTES                120
+#define                CP_AUCUNE                121
+#define                CP_PAS                   122
+
+/* Options configurables                                */
+#define                CP_ROUTE                131
+#define                CP_ERREURS                132
+
+/* Valeurs pour l'option CP_ROUTE                        */
+#define                CP_ROUTE_NORMAL                133
+#define                CP_ROUTE_DIRECT                134
+
+/* Valeurs pour l'option Comportement en cas d'erreur        */
+#define                CP_AUTO                        135
+#define                CP_BLOCAGE                136
+#define                CP_MANUEL                137
+
+/* Type de requete de lecture                                */
+/* La valeur CP_ATTENTE define pour l'etat d'une        */
+/* instance est aussi utilisee                                */
+#define                CP_IMMEDIATE                141
+
+/* Definition des types de lien                                */
+#define CPLVAV                                151
+#define CPLVAF                                152
+#define CPLVAS                                153
+#define CPLCAV                                154
+#define CPLFAV                                155
+
+/* Codes des entetes des messages (Evenemet *)                */
+#define                ERREUR                                1000
+#define                CONNEXION                        1001
+#define                EMISSION                        1002
+#define                DECONNEXION                        1003
+#define                LECTURE_VARIABLE                1004
+#define                ECRITURE_VARIABLE                1005
+#define                FIN_DE_PAS                        1006
+#define                AUIN_FIN_DE_PAS                        1007
+#define                EFFACEMENT                        1008
+#define                MODE_EXEC                        1009
+#define                RUN_N_PAS                        1010
+#define                DEF_CODE                        1011
+#define                DEF_INSTANCE                        1012
+#define                DEF_LIEN                        1013
+#define                DEM_VERSION                        1014
+#define                SET_OPTION                        1015
+#define                DEM_OPTION                        1016
+#define                DEM_CODES                        1017
+#define                DEM_INSTS_DE_CODE                1018
+#define                DEM_VARIABLES                        1019
+#define                DEM_VARS_DE_CODE                1020
+#define                DEM_VARS_DE_INST                1021
+#define                DEM_CARS_DE_VARIABLE                1022
+#define                DEM_CARS_DE_LIEN                1023
+#define                ENV_VALEURS_VARIABLE                1024
+#define                ENV_OPTION                        1025
+#define                ENV_CODES                        1026
+#define                ENV_INSTS_DE_CODE                1027
+#define                ENV_VARIABLES                        1028
+#define                ENV_VARS_DE_CODE                1029
+#define                ENV_VARS_DE_INST                1030
+#define                ENV_CARS_DE_VARIABLE                1031
+#define                ENV_CARS_DE_LIEN                1032
 #define         ENV_TOPOLOGY                    1033
 #define         R_ENV_TOPOLOGY                  1034
 #define         ENV_MACHINE                     1035
 
 
 
-/* Message PVM                                         */
-#define                P_HOST_DELETE                   2000
-#define                P_TASK_EXIT                     2001
+/* Message PVM                                                */
+#define                P_HOST_DELETE                        2000
+#define                P_TASK_EXIT                        2001
 
 
 
 
 
-/* Codes d'erreur                                      */
+/* Codes d'erreur                                        */
 
-/* Pas d'erreur                                */
-#define                CPOK                    0
+/* Pas d'erreur                                */
+#define                CPOK                        0
 
-/* Emetteur inconnu                    */
-#define                CPERIU                  1
+/* Emetteur inconnu                        */
+#define                CPERIU                        1
 
-/* Nom de variable inconnu             */
-#define                CPNMVR                  2
+/* Nom de variable inconnu                */
+#define                CPNMVR                        2
 
-/* Type entree/sortie incompatible     */
-#define                CPIOVR                  3
+/* Type entree/sortie incompatible        */
+#define                CPIOVR                        3
 
-/* Type inconnu                                */
-#define                CPTP                    4
+/* Type inconnu                                */
+#define                CPTP                        4
 
-/* Type de variable incompatible       */
-#define                CPTPVR                  5
+/* Type de variable incompatible        */
+#define                CPTPVR                        5
 
-/* Mode de dependance inconnu          */
-#define                CPIT                    6
+/* Mode de dependance inconnu                */
+#define                CPIT                        6
 
-/* Mode dependance incompatible                */
-#define                CPITVR                  7
+/* Mode dependance incompatible                */
+#define                CPITVR                        7
 
-/* Requete non autorisee               */
-#define                CPRENA                  8
+/* Requete non autorisee                */
+#define                CPRENA                        8
 
-/* Type de deconnexion incorrect       */
-#define                CPDNTP                  9
+/* Type de deconnexion incorrect        */
+#define                CPDNTP                        9
 
-/* Directive de deconnexion incorrecte */
-#define                CPDNDI                  10
+/* Directive de deconnexion incorrecte        */
+#define                CPDNDI                        10
 
-/* Nom de code inconnu                 */
-#define                CPNMCD                  11
+/* Nom de code inconnu                        */
+#define                CPNMCD                        11
 
-/* Nom d'instance inconnu              */
-#define                CPNMIN                  12
+/* Nom d'instance inconnu                */
+#define                CPNMIN                        12
 
-/* Attente                             */
-#define                CPATTENTE               13
+/* Attente                                */
+#define                CPATTENTE                13
 
-/* Blocage                             */
-#define                CPBLOC                  14
+/* Blocage                                */
+#define                CPBLOC                        14
 
-/* Nombre de valeurs transmises egal a zero    */
-#define                CPNTNULL                15
+/* Nombre de valeurs transmises egal a zero        */
+#define                CPNTNULL                15
 
-/* Longueur de variable insuffisante   */
-#define                CPLGVR                  16
+/* Longueur de variable insuffisante        */
+#define                CPLGVR                        16
 
-/* L'instance doit s'arreter           */
-#define                CPSTOP                  17
+/* L'instance doit s'arreter                */
+#define                CPSTOP                        17
 
-/* Arret anormal                       */
-#define                CPATAL                  18
+/* Arret anormal                        */
+#define                CPATAL                        18
 
-/* Coupleur abscent                    */
-#define                CPNOCP                  19
+/* Coupleur abscent                        */
+#define                CPNOCP                        19
 
-/* Variable sortante non connectee     */
-#define                CPCTVR                  20
+/* Variable sortante non connectee        */
+#define                CPCTVR                        20
 
-/* Nombre de pas a executer egal a zero        */
-#define                CPPASNULL               21
+/* Nombre de pas a executer egal a zero        */
+#define                CPPASNULL                21
 
-/* Machine inconnue                    */
-#define                CPMACHINE               22
+/* Machine inconnue                        */
+#define                CPMACHINE                22
 
-/* COUPLAGE_GROUPE non positionnee     */
-#define                CPGRNU                  23
+/* COUPLAGE_GROUPE non positionnee        */
+#define                CPGRNU                        23
 
-/* Groupe d'instances incorrect                */
-#define                CPGRIN                  24
+/* Groupe d'instances incorrect                */
+#define                CPGRIN                        24
 
-/* Fin du fichier d'entree             */
-#define                CPFINFICH               25
+/* Fin du fichier d'entree                */
+#define                CPFINFICH                25
 
-/* Erreur de format dans un fichier    */
-#define                CPERRFICH               26
+/* Erreur de format dans un fichier        */
+#define                CPERRFICH                26
 
-/* Requete d'avance de n pas annullee  */
-/* par passage en mode NORMAL          */
-#define                CPNORERR                27
+/* Requete d'avance de n pas annullee        */
+/* par passage en mode NORMAL                */
+#define                CPNORERR                27
 
-/* Coupleur en mode NORMAL pour une    */
-/* requete RUN_N_PAS ou DEF_*          */
-#define                CPRUNERR                28
+/* Coupleur en mode NORMAL pour une        */
+/* requete RUN_N_PAS ou DEF_*                */
+#define                CPRUNERR                28
 
-/* Option inconnue                     */
-#define                CPOPT                   29
+/* Option inconnue                        */
+#define                CPOPT                        29
 
-/* Valeur d'option inconnue            */
-#define                CPVALOPT                30
+/* Valeur d'option inconnue                */
+#define                CPVALOPT                30
 
-/* Ecriture impossible par effacement  */
-#define                CPECREFF                31
+/* Ecriture impossible par effacement        */
+#define                CPECREFF                31
 
-/* Lecture d'une variable non connectee        */
-/* ou n'appartenant pas a un lien VAS  */
-/* ou VAV s'il s'agit d'une sortante   */
-#define                CPLIEN                  32
+/* Lecture d'une variable non connectee        */
+/* ou n'appartenant pas a un lien VAS        */
+/* ou VAV s'il s'agit d'une sortante        */
+#define                CPLIEN                        32
 
 /* Lecture d'une variable d'une instance*/
-/* deconnectee avec directive CP_ARRET */
-#define                CPINARRET               33
+/* deconnectee avec directive CP_ARRET        */
+#define                CPINARRET                33
 
-/* Les lectures sequentielles ne pourront plus         */
-/* etre satisfaites : instance productrice arretee     */
-#define                CPSTOPSEQ               34
+/* Les lectures sequentielles ne pourront plus                */
+/* etre satisfaites : instance productrice arretee        */
+#define                CPSTOPSEQ                34
 
-/* Erreur dans la chaine de declaration        */
-#define                CPDECL                  35
+/* Erreur dans la chaine de declaration        */
+#define                CPDECL                        35
 
 /* Erreur dans l'execution de l'instance ajoutee */
-#define                CPINEXEC                36
+#define                CPINEXEC                36
 
-/* Erreur PVM                          */
-#define                CPPVM                   37
+/* Erreur PVM                                */
+#define                CPPVM                        37
 
-/* Erreur detectee au niveau de l'interface de couplage        */
-#define                CPERRINST               38
+/* Erreur detectee au niveau de l'interface de couplage        */
+#define                CPERRINST                38
 
 
 /* IDM : les deux define suivants ont ete rajoutes a la main*/
 
 /* Erreur de mode d'execution non defini */
-#define                CPMODE                  39
+#define                CPMODE                        39
 
 /* Erreur d'instance deconnectee */
-#define        CPINSTDEC               40
+#define         CPINSTDEC                40
 
-/* Codes des evenements pour le fichier de trace       */
+/* Codes des evenements pour le fichier de trace        */
 
-/* Debut du couplage                                   */
-#define                DEBUT_COUPLAGE          0
+/* Debut du couplage                                        */
+#define                DEBUT_COUPLAGE                0
 
-/* Fin du couplage                                     */
-#define                FIN_COUPLAGE            1
+/* Fin du couplage                                        */
+#define                FIN_COUPLAGE                1
 
-/* Execution d'une instance par Oacc                   */
-#define                EXEC                    2
+/* Execution d'une instance par Oacc                        */
+#define                EXEC                        2
 
-/* Connexion d'une instance                            */
-#define                CPCD                    3
+/* Connexion d'une instance                                */
+#define                CPCD                        3
 
-/* Permission d'emettre accordee a l'instance          */
-#define                CPALLOW                 4
+/* Permission d'emettre accordee a l'instance                */
+#define                CPALLOW                        4
 
-/* Requete d'ecriture                                  */
-#define                CPECRI                  5
+/* Requete d'ecriture                                        */
+#define                CPECRI                        5
 
-/* Requete de lecture                                  */
-#define                DEB_LECT                6
+/* Requete de lecture                                        */
+#define                DEB_LECT                6
 
-/* Envoi des donnees suite a une requete de lecture    */
-#define                FIN_LECT                7
+/* Envoi des donnees suite a une requete de lecture        */
+#define                FIN_LECT                7
 
-/* Deconnexion d'une instance                          */
-#define                CPFIN                   8
+/* Deconnexion d'une instance                                */
+#define                CPFIN                        8
 
-/* Requete de fin de pas                               */
-#define                CPFINP                  9
+/* Requete de fin de pas                                */
+#define                CPFINP                        9
 
-/* Requete d'autorisation de fin de pas                        */
-#define                CPAUFP                  10
+/* Requete d'autorisation de fin de pas                        */
+#define                CPAUFP                        10
 
-/* Requete d'interdiction de fin de pas                        */
-#define                CPINFP                  11
+/* Requete d'interdiction de fin de pas                        */
+#define                CPINFP                        11
 
-/* Requete d'effacement                                        */
-#define                CPEFF                   12
+/* Requete d'effacement                                        */
+#define                CPEFF                        12
 
-/* Signal d'arret d'une instance                       */
-#define                STOP                    13
+/* Signal d'arret d'une instance                        */
+#define                STOP                        13
 
-/* Avis de blocage suite a une requete de lecture      */
-#define                BLOCAGE                 14
+/* Avis de blocage suite a une requete de lecture        */
+#define                BLOCAGE                        14
 
-/* Requete de passage en mode pause                    */
-#define                CPPAUSE                 15
+/* Requete de passage en mode pause                        */
+#define                CPPAUSE                        15
 
-/* Requete de passage en mode normal                   */
-#define                CPNORMAL                16
+/* Requete de passage en mode normal                        */
+#define                CPNORMAL                16
 
-/* Requete d'execution de n pas                                */
-#define                CPNPAS                  17
+/* Requete d'execution de n pas                                */
+#define                CPNPAS                        17
 
-/* Requete de definition d'un code                     */
-#define                CPADCD                  18
+/* Requete de definition d'un code                        */
+#define                CPADCD                        18
 
-/* Requete de definition d'une instance                        */
-#define                CPADINCD                19
+/* Requete de definition d'une instance                        */
+#define                CPADINCD                19
 
-/* Requete de definition d'un lien                     */
-#define                CPADLN                  20
+/* Requete de definition d'un lien                        */
+#define                CPADLN                        20
 
-/* Requete d'identification de version                 */
-#define                CPIVERS                 21
+/* Requete d'identification de version                        */
+#define                CPIVERS                        21
 
-/* Requete de demande de la liste des codes            */
-#define                CPICD                   22
+/* Requete de demande de la liste des codes                */
+#define                CPICD                        22
 
-/* Requete de demande des instances d'un code          */
-#define                CPIINCD                 23
+/* Requete de demande des instances d'un code                */
+#define                CPIINCD                        23
 
 /* Requete de demande de la liste des variables globales*/
-#define                CPIVR                   24
+#define                CPIVR                        24
 
-/* Requete de demande des variables d'un code          */
-#define                CPIVRCD                 25
+/* Requete de demande des variables d'un code                */
+#define                CPIVRCD                        25
 
-/* Requete de demande des variables d'une instance     */
-#define                CPIVRIN                 26
+/* Requete de demande des variables d'une instance        */
+#define                CPIVRIN                        26
 
-/* Requete de demande d'info sur une variable globale  */
-#define                CPICAVR                 27
+/* Requete de demande d'info sur une variable globale        */
+#define                CPICAVR                        27
 
-/* Requete de demande des caracteristiques d'un lien   */
-#define                CPIILIEN                28
+/* Requete de demande des caracteristiques d'un lien        */
+#define                CPIILIEN                28
 
-/* Requete de modification d'une option                        */
-#define                CPSETOPT                29
+/* Requete de modification d'une option                        */
+#define                CPSETOPT                29
 
-/* Requete de consultation d'une option                        */
-#define                CPGETOPT                30
+/* Requete de consultation d'une option                        */
+#define                CPGETOPT                30
 
-/* Terminaison d'une tache PVM                         */
-#define                TASK_EXIT               31
+/* Terminaison d'une tache PVM                                */
+#define                TASK_EXIT                31
 
-/* Deconnexion d'une machine                           */
-#define                HOST_DELETE             32
+/* Deconnexion d'une machine                                */
+#define                HOST_DELETE                32
 
 
 #ifdef PRG_MAIN
-/*     Fichier principal de la bibliotheque de couplage */
-
-
-char * CPMESSAGE[] =   {
-  "Pas d'erreur",
-  "Emetteur inconnu",
-  "Nom de la variable inconnu",
-  "Code entree/sortie differents dans le coupleur et dans le code",
-  "Type de variable inconnu",
-  "Types de variable differents dans le coupleur et dans le code",
-  "Mode de dependance inconnu",
-  "Modes de dependance differents dans le coupleur et dans le code",
-  "Requete non autorisee",
-  "Type de deconnexion incorrect",
-  "Directive de deconnexion incorrecte",
-  "Nom de code inconnu",
-  "Nom d'instance inconnu",
-  "Requete en attente",
-  "Cas de blocage",
-  "Nombre de valeurs transmises egal a zero",
-  "Longueur de variable insuffisante",
-  "L'instance doit s'arreter",
-  "Arret anormal d'une instance",
-  "Coupleur abscent, execution manuelle",
-  "Variable sortante non connectee",
-  "Nombre de pas a executer egal a zero",
-  "Machine non declaree",
-  "La variable d'environnement COUPLAGE_GROUPE n'est pas positionnee",
-  "Le groupe d'instances indique par COUPLAGE_GROUPE est incorrect",
-  "Fin du fichier d'entree",
-  "Erreur de format dans le fichier d'entree",
-  "Requete annulee a cause du passage en mode NORMAL",
-  "Le coupleur est en mode d'execution normal",
-  "Option inconnue",
-  "Valeur d'option incorrecte",
-  "Ecriture impossible a cause d'une requete d'effacement",
-  "Lecture d'une variable incorrectement connectee",
-  "Lecture d'une variable d'une instance deconnectee avec CP_ARRET",
-  "Lectures sequentielles plus satisfaites",
-  "Erreur dans la chaine de declaration",
-  "Erreur dans le lancement de l'instance ajoutee",
-  "Erreur PVM",
-  "Erreur detectee au niveau de l'instance",
-                       };
+/*        Fichier principal de la bibliotheque de couplage */
+  const char *  CPMESSAGE[] = {
+    "",
+    "Emitter unknown",
+    "Variable name unknown",
+    "Different input/output codes in code and supervisor",
+    "Variable type unknown",
+    "Different variable types in code and supervisor",
+    "Dependency mode unknown",
+    "Different dependency modes in code and supervisor",
+    "Unauthorized request",
+    "Unauthorized disconnection request type",
+    "Unauthorized disconnection directive",
+    "Code name unknown",
+    "Instance name unknown",
+    "Waiting request",
+    "Blocking",
+    "Zero value number",
+    "Insufficient variable length",
+    "Instance is going to stop",
+    "Unexpected instance stop",
+    "Manuel execution",
+    "Output variable not connected",
+    "Number of steps to execute is nul",
+    "Non declared computer",
+    "Environment variable COUPLAGE_GROUPE is not set",
+    "Instance group given by COUPLAGE_GROUPE is wrong",
+    "End of input file",
+    "Format error in input file",
+    "Request ignored because of switching to NORMAL mode",
+    "Supervisor is in normal execution mode",
+    "Unknown option",
+    "Option value is wrong",
+    "Impossible to write because of an erasing request",
+    "Reading of a variable wrongly connected",
+    "Reading of a variable of an instance disconnected with CP_ARRET",
+    "Sequential reading no more possible",
+    "Error in declaration",
+    "Error in instance launching",
+    "Communication error",
+    "Error in the instance",
+    "Environnement variable CAL_MODE is not set",
+    "Disconnected instance",
+  };
 
 #else
 
-extern char * CPMESSAGE[];
+extern const char * CPMESSAGE[];
 
 #endif
 
 
-/* Type de variables                                   */
-#define                ENTIER          30
-#define                REEL            31
-#define                DREEL           32
-#define                COMPLEXE        33
-#define                LOGIQUE         34
-#define                CHAINE          35
+/* Type de variables        */
+#define        ENTIER        30
+#define        REEL          31
+#define        DREEL         32
+#define        COMPLEXE      33
+#define        LOGIQUE       34
+#define        CHAINE        35
 
 /* Macro minuscule majuscule */
-#define                TOUPPER(string) \
+#define                TOUPPER(string)        \
 {\
   int i, number = strlen(string);\
   for (i = 0; i < number; i++) string[i] = toupper(string[i]); \
 }
 
 /* Macro inferieur */
-#define                INF(a,b) (a <= b ? a : b)
+#define                INF(a,b) (a <= b ? a : b)
 
 /* Macro superieur */
-#define                SUP(a,b) (a >= b ? a : b)
+#define                SUP(a,b) (a >= b ? a : b)
 
 
 #endif
index 18e4ec5dee2b0878aa1f3f93ad2c67ec0121fd5f..3fa9d62951892ba9473c201691e67e01dc661864 100644 (file)
@@ -62,7 +62,7 @@ static char * fstr1(char *nom,cal_int nnom)
   return cnom;
 }
 
-static char * free_str1(char *nom)
+static void free_str1(char *nom)
 {
   free(nom);
 }
@@ -71,6 +71,9 @@ static char * free_str1(char *nom)
 /*  INTERFACES DE DÉBUT ET DE FIN DE COUPLAGE */
 /**********************************************/
 
+void F_FUNC(cpcd,CPCD)(long *compo,STR_PSTR(nom),cal_int *info STR_PLEN(nom));
+void F_FUNC(cpfin,CPFIN)(long *compo,cal_int *dep,cal_int *err);
+
 void F_FUNC(cpcd,CPCD)(long *compo,STR_PSTR(nom),cal_int *info STR_PLEN(nom))
 {
   /* nom is OUT argument */
@@ -81,7 +84,6 @@ void F_FUNC(cpcd,CPCD)(long *compo,STR_PSTR(nom),cal_int *info STR_PLEN(nom))
 
 void F_FUNC(cpfin,CPFIN)(long *compo,cal_int *dep,cal_int *err)
 {
-  fprintf(stderr,"CPFIN: \n");
   *err=cp_fin((void *)*compo,(int)*dep);
 }
 
@@ -89,13 +91,28 @@ void F_FUNC(cpfin,CPFIN)(long *compo,cal_int *dep,cal_int *err)
 /* INTERFACES DE LECTURE              */
 /**************************************/
 
+void F_FUNC(cplin,CPLIN)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
+                        cal_int *max,cal_int *n, int *tab,cal_int *err STR_PLEN(nom));
+void F_FUNC(cpllg,CPLLG)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
+            cal_int *max,cal_int *n, long *tab,cal_int *err STR_PLEN(nom));
+void F_FUNC(cplen,CPLEN)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
+            cal_int *max,cal_int *n, cal_int *tab,cal_int *err STR_PLEN(nom));
+void F_FUNC(cpllo,CPLLO)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
+            cal_int *max,cal_int *n, int *tab,cal_int *err STR_PLEN(nom));
+void F_FUNC(cpldb,CPLDB)(long *compo,cal_int *dep,double *ti,double *tf,cal_int *iter,STR_PSTR(nom),
+            cal_int *max,cal_int *n, double *tab,cal_int *err STR_PLEN(nom));
+void F_FUNC(cplre,CPLRE)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
+            cal_int *max,cal_int *n, float *tab,cal_int *err STR_PLEN(nom));
+void F_FUNC(cplcp,CPLCP)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
+            cal_int *max,cal_int *n, float *tab,cal_int *err STR_PLEN(nom));
+void F_FUNC(cplch,CPLCH)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
+            cal_int *max,cal_int *n, char *tab,cal_int *err STR_PLEN(nom) STR_PLEN(tab) );
 
 
 void F_FUNC(cplin,CPLIN)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
                         cal_int *max,cal_int *n, int *tab,cal_int *err STR_PLEN(nom))
 {
   char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
-  fprintf(stderr,"CPLIN: %s %f %f\n",cnom,*ti,*tf);
 
 #if   !SIZEOF_INT
 #error "The macro SIZEOF_INT must be defined."    
@@ -105,7 +122,6 @@ void F_FUNC(cplin,CPLIN)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *i
   fprintf(stderr,"End of CPLIN: %s : Can't use fortran INTEGER*4 because int C is not 32bits long on this machine.\n",
          cnom);
 #endif
-  fprintf(stderr,"End of CPLIN: %s \n",cnom);
   free_str1(cnom);
 }
 
@@ -113,7 +129,6 @@ void F_FUNC(cpllg,CPLLG)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *i
             cal_int *max,cal_int *n, long *tab,cal_int *err STR_PLEN(nom))
 {
   char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
-  fprintf(stderr,"CPLLG: %s %f %f\n",cnom,*ti,*tf);
 #if   !SIZEOF_LONG
 #error "The macro SIZEOF_LONG must be defined."    
 #elif SIZEOF_LONG == 8
@@ -122,7 +137,6 @@ void F_FUNC(cpllg,CPLLG)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *i
   fprintf(stderr,"End of CPLLG: %s : Can't use fortran INTEGER*8 because long C is not 64bits long on this machine.\n",
          cnom);
 #endif
-  fprintf(stderr,"End of CPLLG: %s \n",cnom);
   free_str1(cnom);
 }
 
@@ -130,9 +144,7 @@ void F_FUNC(cplen,CPLEN)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *i
             cal_int *max,cal_int *n, cal_int *tab,cal_int *err STR_PLEN(nom))
 {
   char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
-  fprintf(stderr,"CPLEN: %s %f %f\n",cnom,*ti,*tf);
-   *err=cp_len_fort_((void *)*compo,*dep,ti,tf,iter,cnom,*max,n,tab);
-  fprintf(stderr,"End of CPLEN: %s \n",cnom);
+  *err=cp_len_fort_((void *)*compo,*dep,ti,tf,iter,cnom,*max,n,tab);
   free_str1(cnom);
 }
 
@@ -141,9 +153,7 @@ void F_FUNC(cpllo,CPLLO)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *i
             cal_int *max,cal_int *n, int *tab,cal_int *err STR_PLEN(nom))
 {
   char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
-  fprintf(stderr,"CPLLO: %s %f %f\n",cnom,*ti,*tf);
   *err=cp_llo_fort_((void *)*compo,*dep,ti,tf,iter,cnom,*max,n,tab);
-  fprintf(stderr,"End of CPLLO: %s \n",cnom);
   free_str1(cnom);
 }
 
@@ -151,9 +161,7 @@ void F_FUNC(cpldb,CPLDB)(long *compo,cal_int *dep,double *ti,double *tf,cal_int
             cal_int *max,cal_int *n, double *tab,cal_int *err STR_PLEN(nom))
 {
   char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
-  fprintf(stderr,"CPLDB: %s %f %f \n",cnom, *ti,*tf);
   *err=cp_ldb_fort_((void *)*compo,*dep,ti,tf,iter,cnom,*max,n,tab);
-  fprintf(stderr,"End of CPLDB: %s %f %f \n",cnom,*ti,*tf);
   free_str1(cnom);
 }
 
@@ -161,9 +169,7 @@ void F_FUNC(cplre,CPLRE)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *i
             cal_int *max,cal_int *n, float *tab,cal_int *err STR_PLEN(nom))
 {
   char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
-  fprintf(stderr,"CPLRE: %s %f %f \n",cnom, *ti,*tf);
   *err=cp_lre_fort_((void *)*compo,*dep,ti,tf,iter,cnom,*max,n,tab);
-  fprintf(stderr,"End of CPLRE: %s %f %f \n",cnom,*ti,*tf);
   free_str1(cnom);
 }
 
@@ -171,9 +177,7 @@ void F_FUNC(cplcp,CPLCP)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *i
             cal_int *max,cal_int *n, float *tab,cal_int *err STR_PLEN(nom))
 {
   char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
-  fprintf(stderr,"CPLCP: %s %f %f \n",cnom, *ti,*tf);
   *err=cp_lcp_fort_((void *)*compo,*dep,ti,tf,iter,cnom,*max,n,tab);
-  fprintf(stderr,"End of CPLCP: %s %f %f \n",cnom,*ti,*tf);
   free_str1(cnom);
 }
 
@@ -183,7 +187,6 @@ void F_FUNC(cplch,CPLCH)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *i
   char **tabChaine = NULL;
   cal_int    index = 0;
   char*      cnom = fstr1(STR_PTR(nom),STR_LEN(nom));
-  fprintf(stderr,"CPLCH: %s %f %f \n",cnom, *ti,*tf);
 
   tabChaine = (char **) malloc(sizeof(char *) * (*max));
   for (index = 0; index < *max; index++)
@@ -194,7 +197,6 @@ void F_FUNC(cplch,CPLCH)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *i
   for (index = 0; index < *n; index++)
     strncpy(&tab[index * STR_LEN(tab)], tabChaine[index], strlen(tabChaine[index]));
 
-  fprintf(stderr,"End of CPLCH: %s %f %f \n",cnom,*ti,*tf);
   if (tabChaine != (char **) NULL)  {
     for (index = 0; index < *n; index++)
       free(tabChaine[index]);
@@ -207,6 +209,15 @@ void F_FUNC(cplch,CPLCH)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *i
 /***************************/
 /*  INTERFACES D'ECRITURE  */
 /***************************/
+void F_FUNC(cpech,CPECH)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, char *tab,cal_int *err 
+                        STR_PLEN(nom) STR_PLEN(tab));
+void F_FUNC(cpedb,CPEDB)(long *compo,cal_int *dep,double *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, double *tab,cal_int *err STR_PLEN(nom));
+void F_FUNC(cpere,CPERE)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, float *tab,cal_int *err STR_PLEN(nom));
+void F_FUNC(cpecp,CPECP)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, float *tab,cal_int *err STR_PLEN(nom));
+void F_FUNC(cpein,CPEIN)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, int *tab,cal_int *err STR_PLEN(nom));
+void F_FUNC(cpelg,CPELG)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, long *tab,cal_int *err STR_PLEN(nom));
+void F_FUNC(cpeen,CPEEN)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, cal_int *tab,cal_int *err STR_PLEN(nom));
+void F_FUNC(cpelo,CPELO)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, int *tab,cal_int *err STR_PLEN(nom));
 
 void F_FUNC(cpech,CPECH)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, char *tab,cal_int *err 
                         STR_PLEN(nom) STR_PLEN(tab))
@@ -214,7 +225,6 @@ void F_FUNC(cpech,CPECH)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PS
   char ** tabChaine=NULL;
   cal_int     index=0,index2=0;
   char*   cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
-  fprintf(stderr,"CPECH: %s %f \n",cnom, *ti);
 
   tabChaine = (char **) malloc(sizeof(char *) * *n);
   for (index = 0; index < *n; index++) {
@@ -231,7 +241,6 @@ void F_FUNC(cpech,CPECH)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PS
 
   *err=cp_ech_fort_((void *)*compo,*dep,*ti,*iter,cnom,*n,tabChaine,STR_LEN(tab) );
 
-  fprintf(stderr,"End of CPECH: %s %f \n",cnom, *ti);
   if (tabChaine != (char **) NULL) {
     for (index = 0; index < *n; index++)
       free(tabChaine[index]);
@@ -244,27 +253,21 @@ void F_FUNC(cpech,CPECH)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PS
 void F_FUNC(cpedb,CPEDB)(long *compo,cal_int *dep,double *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, double *tab,cal_int *err STR_PLEN(nom))
 {
   char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
-  fprintf(stderr,"CPEDB: %s %f \n",cnom, *ti);
   *err=cp_edb_fort_((void *)*compo,*dep,*ti,*iter,cnom,*n,tab);
-  fprintf(stderr,"End of CPEDB: %s %f \n",cnom, *ti);
   free_str1(cnom);
 }
 
 void F_FUNC(cpere,CPERE)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, float *tab,cal_int *err STR_PLEN(nom))
 {
   char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
-  fprintf(stderr,"CPERE: %s %f \n",cnom, *ti);
   *err=cp_ere_fort_((void *)*compo,*dep,*ti,*iter,cnom,*n,tab);
-  fprintf(stderr,"End of CPERE: %s %f \n",cnom, *ti);
   free_str1(cnom);
 }
 
 void F_FUNC(cpecp,CPECP)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, float *tab,cal_int *err STR_PLEN(nom))
 {
   char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
-  fprintf(stderr,"CPECP: %s %f \n",cnom, *ti);
   *err=cp_ecp_fort_((void *)*compo,*dep,*ti,*iter,cnom,*n,tab);
-  fprintf(stderr,"End of CPECP: %s %f \n",cnom, *ti);
   free_str1(cnom);
 }
 
@@ -273,7 +276,6 @@ void F_FUNC(cpein,CPEIN)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PS
 {
 
   char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
-  fprintf(stderr,"CPEIN: %s %f %d\n",cnom, *ti,*iter);
 #if   !SIZEOF_INT
 #error "The macro SIZEOF_INT must be defined."    
 #elif SIZEOF_INT == 4
@@ -282,7 +284,6 @@ void F_FUNC(cpein,CPEIN)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PS
   fprintf(stderr,"CPEIN: %s %f %d : Can't use fortran INTEGER*4 because int C is not 32bits long on this machine.\n",
          cnom, *ti,*iter);
 #endif
-  fprintf(stderr,"End of CPIN: %s %f \n",cnom,*ti);
   free_str1(cnom);
 }
 
@@ -290,7 +291,6 @@ void F_FUNC(cpelg,CPELG)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PS
 {
 
   char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
-  fprintf(stderr,"CPELG: %s %f %d\n",cnom, *ti,*iter);
 #if   !SIZEOF_LONG
 #error "The macro SIZEOF_LONG must be defined."    
 #elif SIZEOF_LONG == 8
@@ -299,25 +299,20 @@ void F_FUNC(cpelg,CPELG)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PS
   fprintf(stderr,"CPELG: %s %f %d : Can't use fortran INTEGER*8 because long C is not 64bits long on this machine.\n",
          cnom, *ti,*iter);
 #endif
-  fprintf(stderr,"End of CPELG: %s %f \n",cnom,*ti);
   free_str1(cnom);
 }
 
 void F_FUNC(cpeen,CPEEN)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, cal_int *tab,cal_int *err STR_PLEN(nom))
 {
   char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
-  fprintf(stderr,"CPEEN: %s %f %d\n",cnom, *ti,*iter);
-    *err=cp_een_fort_((void *)*compo,*dep,*ti,*iter,cnom,*n,tab);
-  fprintf(stderr,"End of CPEEN: %s %f \n",cnom,*ti);
+  *err=cp_een_fort_((void *)*compo,*dep,*ti,*iter,cnom,*n,tab);
   free_str1(cnom);
 }
 
 void F_FUNC(cpelo,CPELO)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, int *tab,cal_int *err STR_PLEN(nom))
 {
   char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
-  fprintf(stderr,"CPELO: %s %f %d\n",cnom, *ti,*iter);
   *err=cp_elo_fort_((void *)*compo,*dep,*ti,*iter,cnom,*n,tab);
-  fprintf(stderr,"End of CPELO: %s %f \n",cnom,*ti);
   free_str1(cnom);
 }
 
index 4372c9dfb301998725f46fe8004b8eb6fb12c021..9a3a5d58d00115172d1932ecafa4c267212cf0f9 100644 (file)
@@ -67,7 +67,7 @@ public:
 
   template <typename TimeType,typename TagType> void     put(CorbaInDataType data,  TimeType time, TagType tag);
   template <typename TimeType,typename TagType> DataType get(TimeType time, TagType tag);
-  template <typename TimeType,typename TagType> DataType get(TimeType ti, TimeType tf, TagType tag = 0);
+  template <typename TimeType,typename TagType> DataType get(TimeType& ti, TimeType tf, TagType tag = 0);
   template <typename TimeType,typename TagType> DataType next(TimeType &t, TagType  &tag );
   void      close (PortableServer::POA_var poa, PortableServer::ObjectId_var id);
   void wakeupWaiting();
@@ -308,7 +308,9 @@ void GenericPort<DataManipulator, COUPLING_POLICY>::put(CorbaInDataType dataPara
       // Pb2 : également si deux attentes de DataIds même différents car on n'en stocke qu'un !
       // Conclusion : Pour l'instant on ne gère pas un service multithreadé qui effectue
       // des lectures simultanées sur le même port !
-      MESSAGE("-------- Put : new datas available ------------------");
+#ifdef MYDEBUG
+      std::cerr << "-------- Put : new datas available ------------------" << std::endl;
+#endif
       fflush(stdout);fflush(stderr);
       cond_instance.signal();
     }
@@ -515,11 +517,11 @@ GenericPort<DataManipulator, COUPLING_POLICY>::get(TimeType time,
 template < typename DataManipulator, typename COUPLING_POLICY >
 template < typename TimeType,typename TagType>
 typename DataManipulator::Type 
-GenericPort<DataManipulator, COUPLING_POLICY>::get(TimeType ti,
+GenericPort<DataManipulator, COUPLING_POLICY>::get(TimeType& ti,
                                                   TimeType tf, 
                                                   TagType  tag ) {
-  TimeType t = COUPLING_POLICY::getEffectiveTime(ti,tf);
-  return get(t,tag);
+  ti = COUPLING_POLICY::getEffectiveTime(ti,tf);
+  return get(ti,tag);
 }
 
 
index 25cd00348463d08fe932cc164c4952bc0dfff5f6..351388554c3c654d4c2155205ffd7541f655eaad 100644 (file)
@@ -107,7 +107,9 @@ GenericUsesPort< DataManipulator,CorbaPortType, repositoryName, UsesPort  >::put
     CorbaPortTypeVar port = CorbaPortType::_narrow((*_my_ports)[i]);
     //if (i) { PB1
     //OLD :   copyOfData = DataManipulator::clone(data);
-    MESSAGE("-------- GenericUsesPort::put -------- " );
+#ifdef MYDEBUG
+    std::cerr << "-------- GenericUsesPort::put -------- " << std::endl;
+#endif
     //} PB1
     try {
       port->put(data,time,tag);
@@ -135,7 +137,9 @@ GenericUsesPort< DataManipulator, CorbaPortType, repositoryName, UsesPort
 {
   if (_my_ports) delete _my_ports;
 
-  MESSAGE("GenericUsesPort::uses_port_changed");
+#ifdef MYDEBUG
+  std::cerr << "GenericUsesPort::uses_port_changed" << std::endl;
+#endif
   _my_ports = new_uses_port;
 }
 
index acbd47875cb41e54fb0536802fe98761a18512be..0eede3e6432139cb2cb3b7cf513c4c509a7f91b7 100644 (file)
@@ -116,7 +116,7 @@ Superv_Component_i::create_provides_data_port(const std::string& port_fab_type)
   }
 
   if (rtn_port == NULL)
-    throw  BadFabType( LOC(OSS()<< "Impossible d'accéder à la fabrique "
+    throw  BadFabType( LOC(OSS()<< "No way to get the port factory "
                           <<port_fab_type));
 
   return rtn_port;
@@ -141,7 +141,7 @@ throw (BadFabType)
   }
   
   if (rtn_proxy == NULL)
-   throw BadFabType( LOC(OSS()<< "Impossible d'accéder à la fabrique "
+   throw BadFabType( LOC(OSS()<< "No way to get the port factory "
                          <<port_fab_type));
 
   return rtn_proxy;
@@ -173,7 +173,7 @@ Superv_Component_i::add_port(const char * port_fab_type,
     add_port(port, port_name);
   }
   else
-    throw BadType( LOC(OSS()<< "Le port_type doit être soit 'provides' soit 'uses' not "
+    throw BadType( LOC(OSS()<< "port_type must be either 'provides' either 'uses' not "
                       << port_type));
 
 }
@@ -200,14 +200,14 @@ Superv_Component_i::add_port(provides_port * port,
 
   } 
   catch (const Engines::DSC::PortAlreadyDefined&) {
-    throw PortAlreadyDefined( LOC(OSS()<< "Le port provides "
-                                 << provides_port_name <<" existe déjà."));
+    throw PortAlreadyDefined( LOC(OSS()<< "provides port "
+                                 << provides_port_name <<" already exist."));
   } 
   catch (const Engines::DSC::NilPort&) {
-    throw NilPort( LOC(OSS()<< "Le pointeur sur port provides est nul."));
+    throw NilPort( LOC(OSS()<< "provides port pointer is nul."));
   }
   catch (const Engines::DSC::BadProperty&) {
-    throw BadProperty( LOC(OSS()<< "La propriété est mal définie"));
+    throw BadProperty( LOC(OSS()<< "Property is not well defined"));
   }
 }
 
@@ -229,14 +229,14 @@ Superv_Component_i::add_port(uses_port * port,
     my_superv_ports[uses_port_name] = new_superv_port;
   } 
   catch (const Engines::DSC::PortAlreadyDefined&) {
-    throw PortAlreadyDefined( LOC(OSS()<< "Le port uses " 
-                                 << uses_port_name <<" existe déjà."));
+    throw PortAlreadyDefined( LOC(OSS()<< "uses port " 
+                                 << uses_port_name <<" already exists."));
   } 
   catch (const Engines::DSC::NilPort&) {
-    throw NilPort( LOC(OSS()<< "Le pointeur sur port uses est nul."));
+    throw NilPort( LOC(OSS()<< "uses port pointer is nul."));
   }
   catch (const Engines::DSC::BadProperty&) {
-    throw BadProperty( LOC(OSS()<< "La propriété est mal définie"));
+    throw BadProperty( LOC(OSS()<< "Property is not well defined"));
   }
 }
 
@@ -251,11 +251,11 @@ Superv_Component_i::get_port(provides_port *& port,
     Ports::Port_var portref=Engines_DSC_interface::get_provides_port(provides_port_name, false);
     port = my_superv_ports[provides_port_name]->p_ref;
   } catch (const Engines::DSC::PortNotDefined&) {
-    throw PortNotDefined( LOC(OSS()<< "Le port provides  "
-                             << provides_port_name <<" n'existe pas."));
+    throw PortNotDefined( LOC(OSS()<< "provides  port "
+                             << provides_port_name <<" does not exist."));
   } catch (const Engines::DSC::PortNotConnected&) {
-    throw PortNotConnected( LOC(OSS()<< "Le port provides " << provides_port_name 
-                               << " n'est pas connecté."));
+    throw PortNotConnected( LOC(OSS()<< "provides port " << provides_port_name 
+                               << " is not connected."));
   }
 }
 
@@ -271,11 +271,11 @@ Superv_Component_i::get_port(uses_port *& port,
     delete portseq;
     port = my_superv_ports[uses_port_name]->u_ref;
   } catch (const Engines::DSC::PortNotDefined&) {    
-    throw PortNotDefined( LOC(OSS()<< "Le port uses  "
-                             << uses_port_name <<" n'existe pas."));
+    throw PortNotDefined( LOC(OSS()<< "uses port "
+                             << uses_port_name <<" does not exist."));
   } catch (const Engines::DSC::PortNotConnected&) {
-    throw PortNotConnected( LOC(OSS()<< "Le port uses " << uses_port_name 
-                               << " n'est pas connecté."));
+    throw PortNotConnected( LOC(OSS()<< "uses port " << uses_port_name 
+                               << " is not connected."));
   }
 }
 
index 29f8483f3d465aa011865cbd7383ec4161ca703e..6c7b1590ec2d0c9301d76428121ae867f9eff7bb 100644 (file)
@@ -268,7 +268,18 @@ private:
     ~superv_port_t()
     {
       if(u_ref)delete u_ref;
-      if(p_ref)delete p_ref;
+      if(p_ref)
+        {
+          // do not delete CORBA servant : deactivate it and then call _remove_ref or delete
+          PortableServer::ServantBase* servant=dynamic_cast<PortableServer::ServantBase*>(p_ref);
+          if(servant)
+            {
+              PortableServer::POA_var poa =servant->_default_POA();
+              PortableServer::ObjectId_var oid = poa->servant_to_id(servant);
+              poa->deactivate_object(oid);
+              servant->_remove_ref();
+            }
+        }
     };
     // For uses ports.
     uses_port * u_ref;
@@ -308,7 +319,7 @@ Superv_Component_i::add_port(const char * port_fab_type,
     add_port(port, port_name);
     retPort = dynamic_cast<SpecificPortType *>(port);
     if ( retPort == NULL ) { delete port;  
-      throw BadCast( LOC("La conversion vers le type de port demandé n'est pas possible " ));
+      throw BadCast( LOC("Can't cast to asked port type " ));
     }
   }
   else if (s_port_type == "uses") {
@@ -323,11 +334,11 @@ Superv_Component_i::add_port(const char * port_fab_type,
     std::cout << "---- Superv_Component_i::add_port :  Mark 2 ----  " << retPort << "----" << std::endl;
 #endif
     if ( retPort == NULL ) { delete port;  
-      throw BadCast( LOC("La conversion vers le type de port demandé n'est pas possible " ));
+      throw BadCast( LOC("Can't cast to asked port type " ));
     }
   }
   else
-    throw BadType(LOC(OSS()<< "Le port_type doit être soit 'provides' soit 'uses' not "
+    throw BadType(LOC(OSS()<< "port_type must be either 'provides' either 'uses' not "
                      << port_type));
   
   return retPort;
@@ -364,17 +375,17 @@ Superv_Component_i::get_port( const char * port_name)
     
     }
   } catch (const Engines::DSC::PortNotDefined&) {
-    throw PortNotDefined( LOC(OSS()<< "Le port "
-                             << port_name <<" n'existe pas."));
+    throw PortNotDefined( LOC(OSS()<< "port "
+                             << port_name <<" does not exist."));
   } catch (const Engines::DSC::PortNotConnected&) {
-    throw PortNotConnected( LOC(OSS()<< "Le port " << port_name 
-                               << " n'est pas connecté."));
+    throw PortNotConnected( LOC(OSS()<< "port " << port_name 
+                               << " is not connected."));
   }
   
   retPort = dynamic_cast<SpecificPortType *>(port);
   if ( retPort == NULL ) {
     delete port; 
-    throw BadCast( LOC("La conversion vers le type de port demandé n'est pas possible " ));
+    throw BadCast( LOC("Can't cast to asked port type " ));
   }
 
   return retPort;
index 791a3a208f3eda21d529e5672128cb2736cb7948..b66ba734a7ca0a6eb4ee4a99c0319ef5a27886e4 100644 (file)
@@ -20,6 +20,7 @@
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "base_port.hxx"
+#include <omniORB4/CORBA.h>
 
 
 base_port::base_port() 
@@ -29,7 +30,11 @@ base_port::base_port()
 
 base_port::~base_port() 
 {
-  delete default_properties;
+  //do not call delete on corba servant: deactivate it and then call _remove_ref or delete
+  PortableServer::POA_var poa =default_properties->_default_POA();
+  PortableServer::ObjectId_var oid = poa->servant_to_id(default_properties);
+  poa->deactivate_object(oid);
+  default_properties->_remove_ref();
 }
 
 Ports::PortProperties_ptr