Salome HOME
Correction du BUG (non retour des lectures sequentiels) sur appel cp_fin
authorfayolle <fayolle>
Wed, 25 Apr 2007 16:19:21 +0000 (16:19 +0000)
committerfayolle <fayolle>
Wed, 25 Apr 2007 16:19:21 +0000 (16:19 +0000)
13 files changed:
src/DSC/DSC_User/DSC_Exception.hxx
src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.cxx
src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.hxx
src/DSC/DSC_User/Datastream/Calcium/CalciumException.hxx [new file with mode: 0644]
src/DSC/DSC_User/Datastream/Calcium/CalciumInterface.hxx
src/DSC/DSC_User/Datastream/Calcium/CalciumTypes.hxx
src/DSC/DSC_User/Datastream/Calcium/Makefile.am
src/DSC/DSC_User/Datastream/Calcium/test_DataIdContainer.cxx
src/DSC/DSC_User/Datastream/DatastreamException.hxx [deleted file]
src/DSC/DSC_User/Datastream/GenericPort.hxx
src/DSC/DSC_User/Datastream/GenericUsesPort.hxx
src/DSC/DSC_User/Datastream/Makefile.am
src/DSC/DSC_User/Datastream/lambda.hpp [deleted file]

index 542bff0993c2dad2662b3a068329ab14cda48c11..46bd5ab0307033ffa89c188e2130cdf64bcc0c1d 100644 (file)
@@ -141,6 +141,8 @@ struct DSC_Exception : public SALOME_Exception {
   // sinon pb avec nos attributs de type pointeur.
   virtual ~DSC_Exception(void) throw() {};
 
+  virtual const std::string & getExceptionName() const {return _exceptionName;};
+
 private:
 
   std::string setFileFuncName(const char * fileName, const char * funcName) {
index c9628f4ddb5e0760297b29eeebdb4aa706e14808..2a18b69e328aa5a1b6d16de6901ee1350be1b63f 100644 (file)
@@ -39,13 +39,13 @@ CalciumTypes::DependencyType CalciumCouplingPolicy::getDependencyType () const
  
 void   CalciumCouplingPolicy::setStorageLevel   (size_t         storageLevel)   {
   if ( storageLevel < 1 && (storageLevel != CalciumTypes::UNLIMITED_STORAGE_LEVEL)  )
-    throw DATASTREAM_EXCEPTION(LOC("Un niveau < 1 n'est pas autorisé"));
+    throw CalciumException(CalciumTypes::CPRENA,LOC("Un niveau < 1 n'est pas autorisé"));
   _storageLevel = storageLevel;
 }
 size_t CalciumCouplingPolicy::getStorageLevel   () const                        {return _storageLevel;}
 void   CalciumCouplingPolicy::setDateCalSchem   (CalciumTypes::DateCalSchem   dateCalSchem)   {
   if ( _dependencyType != CalciumTypes::TIME_DEPENDENCY )
-    throw DATASTREAM_EXCEPTION(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("Il est impossible de positionner un schéma temporel sur un port qui n'est pas en dépendance temporelle"));
   _dateCalSchem = dateCalSchem;
 }
 
@@ -53,33 +53,33 @@ CalciumTypes::DateCalSchem CalciumCouplingPolicy::getDateCalSchem () const   { r
 
 void CalciumCouplingPolicy::setAlpha(double alpha) {
   if ( _dependencyType != CalciumTypes::TIME_DEPENDENCY )
-    throw DATASTREAM_EXCEPTION(LOC("Il est impossible de positionner alpha sur un port qui n'est pas en dépendance temporelle"));
+    throw CalciumException(CalciumTypes::CPITVR,LOC("Il est impossible de positionner alpha sur un port qui n'est pas en dépendance temporelle"));
   
   if ( 0 <= alpha <= 1 ) _alpha = alpha; 
   else 
-    throw DATASTREAM_EXCEPTION(LOC("Le paramètre alpha doit être compris entre [0,1]"));
+    throw CalciumException(CalciumTypes::CPRENA,LOC("Le paramètre alpha doit être compris entre [0,1]"));
 }
 
 double CalciumCouplingPolicy::getAlpha() const   { return _alpha; }
 
 void CalciumCouplingPolicy::setDeltaT(double deltaT ) {
   if ( _dependencyType != CalciumTypes::TIME_DEPENDENCY )
-    throw DATASTREAM_EXCEPTION(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("Le paramètre deltaT sur un port qui n'est pas en dépendance temporelle n'a pas de sens"));
   if ( 0 <= deltaT <= 1 ) _deltaT = deltaT; 
   else 
-    throw(DATASTREAM_EXCEPTION(LOC("Le paramètre deltaT doit être compris entre [0,1]")));
+    throw(CalciumException(CalciumTypes::CPRENA,LOC("Le paramètre deltaT doit être compris entre [0,1]")));
 }
 double CalciumCouplingPolicy::getDeltaT() const  {return _deltaT;}
 
 void CalciumCouplingPolicy::setInterpolationSchem (CalciumTypes::InterpolationSchem interpolationSchem) {
   if ( _dependencyType != CalciumTypes::TIME_DEPENDENCY )
-    throw DATASTREAM_EXCEPTION(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("Le paramètre InterpolationSchem sur un port qui n'est pas en dépendance temporelle n'a pas de sens"));
   _interpolationSchem=interpolationSchem;
 }
 
 void CalciumCouplingPolicy::setExtrapolationSchem (CalciumTypes::ExtrapolationSchem extrapolationSchem) {
   if ( _dependencyType != CalciumTypes::TIME_DEPENDENCY )
-    throw DATASTREAM_EXCEPTION(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("Le paramètre ExtrapolationSchem sur un port qui n'est pas en dépendance temporelle n'a pas de sens"));
 _extrapolationSchem=extrapolationSchem;
 }
 
index 9de1849c8229fd6b081569a6bae0406bfcc26a58..2a2ce98285cec7f37d1a0ae7bdb21783f179bde1 100644 (file)
 
 #include <vector>
 #include <map>
+#include <boost/lambda/lambda.hpp>
+
 #include "DisplayPair.hxx"
 #include "CouplingPolicy.hxx"
 #include "AdjacentFunctor.hxx"
-#include "lambda.hpp"
 #include "CalciumTypes.hxx"
-#include "DSC_Exception.hxx"
-typedef DSC_Exception DATASTREAM_EXCEPTION;
+#include "CalciumException.hxx"
 
 class CalciumCouplingPolicy : public CouplingPolicy  {
 
@@ -150,7 +150,7 @@ struct CalciumCouplingPolicy::InternalDataIdContainer : public std::vector< std:
       this->push_back(DataId(0,dataId.second));
       break;
     default:
-      throw(DATASTREAM_EXCEPTION(LOC("The dependency type must be set by setDependencyType before calling DataIdContainer contructor")));
+      throw(CalciumException(CalciumTypes::CPIT,LOC("The dependency type must be set by setDependencyType before calling DataIdContainer contructor")));
       break;
     }
   };
@@ -295,11 +295,11 @@ bool CalciumCouplingPolicy::isDataIdConveniant( AssocContainer & storedDatas, co
   return isEqual || isBounded;
 }
 
-// PAS ENCORE TESTE AVEC UN NIVEAU POSITIONNE
+// TODO :PAS ENCORE TESTE AVEC UN NIVEAU POSITIONNE
 // Supprime les DataId et les données associées
-// du container associative quand le nombre
+// du container associatif quand le nombre
 // de données stockées dépasse le niveau CALCIUM.
-// Cette méthode est appelée de GenericPort::Ge
+// Cette méthode est appelée de GenericPort::get et GenericPort::nex
 // TODO : Elle devrait également être appelée dans GenericPort::Put
 // mais il faut étudier les interactions avec GenericPort::Get et GenericPort::next
 template < typename DataManipulator > 
@@ -332,9 +332,9 @@ struct CalciumCouplingPolicy::EraseDataIdProcessor {
       }
       // Si l'itérateur pointait sur une valeur que l'on vient de supprimer
       if (dist < s ) {
-       throw(DATASTREAM_EXCEPTION(LOC(OSS()<< "La gestion du niveau CALCIUM " 
-                                      << _couplingPolicy._storageLevel << 
-                                      " vient d'entraîner la suppression de la donnée à renvoyer")));
+       throw(CalciumException(CalciumTypes::CPNTNULL,LOC(OSS()<< "La gestion du niveau CALCIUM " 
+                                           << _couplingPolicy._storageLevel << 
+                                           " vient d'entraîner la suppression de la donnée à renvoyer")));
       }
     }
     std::cout << "-------- CalciumCouplingPolicy::eraseDataId, new storedDatasSize : " << storedDatas.size() << std::endl;
@@ -344,11 +344,13 @@ struct CalciumCouplingPolicy::EraseDataIdProcessor {
 };
 
 
-// Lorsque cette méthode est appelée l'expectedDataId n'a pas été trouvé
-// et n'est pas non plus encadrée (en mode temporel)
-// Si l'on effectue pas de traitement particulier la méthode renvoie false
-// Si le port a reçu une directive STOP une exception est levée
-// Si le port a reçu une directive CONTINUE, on localise l'expected
+// Lorsque cette méthode est appelée depuis GenericPort::Get 
+// l'expectedDataId n'a pas été trouvé et n'est pas non plus 
+// encadré (en mode temporel).
+// Si apply n'effectue pas de traitement particulier la méthode renvoie false
+// Si le port a déjà reçu une directive de deconnexion STOP une exception est levée
+// Si le port a déjà reçu une directive de deconnexion CONTINUE, 
+// on donne la dernière valeur connu et on renvoie true.
 template < typename DataManipulator > 
 struct CalciumCouplingPolicy::DisconnectProcessor {
 
@@ -372,16 +374,18 @@ struct CalciumCouplingPolicy::DisconnectProcessor {
   
     std::cout << "-------- CalciumCouplingPolicy::DisconnectProcessor MARK2 --------" << std::endl;
 
+    // TODO : Ds GenericPort::next il faut convertir en CPSTOPSEQ
     if ( _couplingPolicy._disconnectDirective == CalciumTypes::CP_ARRET )
-      throw(DATASTREAM_EXCEPTION(LOC(OSS()<< "La directive CP_ARRET" 
-                                    << " provoque l'interruption de toute lecture de données")));
+      throw(CalciumException(CalciumTypes::CPINARRET,LOC(OSS()<< "La directive CP_ARRET" 
+                                          << " provoque l'interruption de toute lecture de données")));
     std::cout << "-------- CalciumCouplingPolicy::DisconnectProcessor MARK3 --------" << std::endl;
 
 
     // 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(DATASTREAM_EXCEPTION(LOC(OSS()<< "La directive CP_CONT" 
-                                    << " est active mais aucune donnée n'est disponible.")));
+      throw(CalciumException(CalciumTypes::CPNTNULL,LOC(OSS()<< "La directive CP_CONT" 
+                                         << " est active mais aucune donnée n'est disponible.")));
     
     // 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
@@ -396,9 +400,10 @@ struct CalciumCouplingPolicy::DisconnectProcessor {
       std::cout <<" "<<(*it).first ;
     std::cout <<std::endl;
 
+    // TODO : Il faut en fait renvoyer le plus proche cf IT ou DT
     if (it1 == storedDatas.end())
-      throw(DATASTREAM_EXCEPTION(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()<< "La directive CP_CONT" 
+                                         << " est active mais le dataId demandé est inférieur ou égal au dernier reçu.")));
   
     std::cout << "-------- CalciumCouplingPolicy::DisconnectProcessor MARK6 " << std::endl;
 
diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumException.hxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumException.hxx
new file mode 100644 (file)
index 0000000..7ace098
--- /dev/null
@@ -0,0 +1,68 @@
+//  Copyright (C) 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   : CalciumException.hxx
+//  Author : Eric Fayolle (EDF)
+//  Module : KERNEL
+// Modified by : $LastChangedBy$
+// Date        : $LastChangedDate: 2007-02-06 17:20:28 +0100 (mar, 06 fév 2007) $
+// Id          : $Id$
+
+#ifndef CALCIUM_EXCEPTION_HXX
+#define CALCIUM_EXCEPTION_HXX
+
+#include "DSC_Exception.hxx"
+#include "CalciumTypes.hxx"
+#include <string>
+
+struct CalciumException  : public DSC_Exception {
+
+  CalciumException( const CalciumTypes::InfoType info,
+                   const std::string &     text, 
+                   const char        *fileName, 
+                   const unsigned int lineNumber,
+                   const char        *funcName):
+    DSC_Exception(text,fileName,lineNumber,funcName),
+    _info(info),_exceptionName("CalciumException")
+  {};
+
+
+  CalciumException( const CalciumTypes::InfoType info,
+                      const std::string & text ):
+    DSC_Exception(text),_info(info),_exceptionName("CalciumException")
+  {};
+
+  CalciumException(CalciumTypes::InfoType info, const DSC_Exception & ex ):
+    DSC_Exception(ex),_info(info),_exceptionName("CalciumException") 
+  {};
+  virtual ~CalciumException() throw() {};
+  CalciumTypes::InfoType getInfo() const { return _info;}
+  void setInfo(CalciumTypes::InfoType info) {_info=info;}
+  virtual const std::string & getExceptionName() const {return _exceptionName;};
+
+protected:
+  CalciumTypes::InfoType _info;
+  std::string   _exceptionName;
+};
+
+
+#endif /* CALCIUM_EXCEPTION_HXX */
index ad33a0d3a5d95029d234fb6e7ccb4bc4d09a4ed8..4669d6461c2e1654efb9179cca18972fd58affbc 100644 (file)
@@ -33,7 +33,7 @@
 #include <vector>
 #include <iostream>
 #include "Superv_Component_i.hxx"
-#include "DatastreamException.hxx"
+#include "CalciumException.hxx"
 #include "CalciumTypes.hxx"
 #include "CalciumGenericUsesPort.hxx"
 #include "Copy2UserSpace.hxx"
@@ -71,39 +71,43 @@ public :
     
     //récupérer le type de réel du port est un peu difficile
     //car l'interface nous donne aucune indication
-    uses_port *myUsesPort;
-    
+
+    //     uses_port *myUsesPort;
+    calcium_uses_port* myCalciumUsesPort;
+      
     for (it=usesPortNames.begin(); it != usesPortNames.end(); ++it) {
       try {
-       component.Superv_Component_i::get_port(myUsesPort,(*it).c_str());
-       calcium_uses_port* myCalciumUsesPort=
-         dynamic_cast<calcium_uses_port*>(myUsesPort);
+
+       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);
+
        std::cerr << "-------- CalciumInterface(ecp_fin) MARK 1 -|"<< *it <<"|----"<< 
-         typeid(myUsesPort).name() <<"-------------" <<
+         //      typeid(myUsesPort).name() <<"-------------" <<
          typeid(myCalciumUsesPort).name() <<"-------------" << std::endl;
-       if ( !myCalciumUsesPort )
-         throw Superv_Component_i::BadCast(LOC(OSS()<<"Impossible de convertir le port "
-                                               << *it << " en port de type calcium_uses_port." ));
+       
+//     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::PortNotDefined & ex) {
-       std::cerr << ex.what() << std::endl;
-       //throw (DatastreamException(CalciumTypes::CPNMVR,ex));
-       // On continue à traiter la deconnexion des autres ports uses
-      } catch ( const Superv_Component_i::PortNotConnected & ex) {
-       std::cerr << ex.what() << std::endl;
-       // throw (DatastreamException(CalciumTypes::CPLIEN,ex)); 
-       // On continue à traiter la deconnexion des autres ports uses
+
       } catch ( const Superv_Component_i::BadCast & ex) {
        std::cerr << ex.what() << std::endl;
-       throw (DatastreamException(CalciumTypes::CPTPVR,ex));
-      }  catch ( const DSC_Exception & ex) {
-       // exception venant  du port uses
+       throw (CalciumException(CalciumTypes::CPTPVR,ex));
+      } catch ( const DSC_Exception & ex) {
        std::cerr << ex.what() << std::endl;
+       // Exception venant de SupervComponent :
+       //   PortNotDefined(CPNMVR), PortNotConnected(CPLIEN)  
+       // ou du port uses : Dsc_Exception
        // On continue à traiter la deconnexion des autres ports uses
-      } catch (...) {// On laisse passer les autres exceptions
-       std::cout << "ecp_fin : Exception innatendue " <<std::endl;
-       throw;
-       }
+      } catch (...) {
+       throw (CalciumException(CalciumTypes::CPATAL,"Exception innatendue"));
+       // En fonction du mode de gestion des erreurs throw;
+      }
     }
   }
 
@@ -170,7 +174,7 @@ public :
     std::cerr << "-------- CalciumInterface(ecp_lecture) MARK 1 ------------------" << std::endl;
 
     if (nomVar.empty())
-      throw DatastreamException(CalciumTypes::CPNMVR,
+      throw CalciumException(CalciumTypes::CPNMVR,
                                LOC("Le nom de la variable est <nul>"));
     PortType * port;
     std::cout << "-------- CalciumInterface(ecp_lecture) MARK 2 ------------------" << std::endl;
@@ -180,36 +184,29 @@ public :
       std::cout << "-------- CalciumInterface(ecp_lecture) MARK 3 ------------------" << std::endl;
     } catch ( const Superv_Component_i::PortNotDefined & ex) {
       std::cerr << ex.what() << std::endl;
-      throw (DatastreamException(CalciumTypes::CPNMVR,ex));
+      throw (CalciumException(CalciumTypes::CPNMVR,ex));
     } catch ( const Superv_Component_i::PortNotConnected & ex) {
       std::cerr << ex.what() << std::endl;;
-      throw (DatastreamException(CalciumTypes::CPLIEN,ex)); 
+      throw (CalciumException(CalciumTypes::CPLIEN,ex)); 
       // VERIFIER LES CAS DES CODES : CPINARRET, CPSTOPSEQ, CPCTVR, CPLIEN
     } catch ( const Superv_Component_i::BadCast & ex) {
       std::cerr << ex.what() << std::endl;
-      throw (DatastreamException(CalciumTypes::CPTPVR,ex));
+      throw (CalciumException(CalciumTypes::CPTPVR,ex));
     }
   
     // mode == mode du port 
-    CalciumTypes::DependencyType portDependencyType;
-    try {
-      portDependencyType = port->getDependencyType();
-      std::cout << "-------- CalciumInterface(ecp_lecture) MARK 4 ------------------" << std::endl;
-    } catch ( const DSC_Exception & ex ) {
-      std::cerr << ex.what() << std::endl;;
-      throw (DatastreamException(CalciumTypes::CPIT,ex));
-    }
+    CalciumTypes::DependencyType portDependencyType = port->getDependencyType();
 
     if ( portDependencyType == CalciumTypes::UNDEFINED_DEPENDENCY )
-      throw DatastreamException(CalciumTypes::CPIT,
-                               LOC(OSS()<<"Le mode de dépendance de la variable " 
-                                   << nomVar << " est indéfini."));
+      throw CalciumException(CalciumTypes::CPIT,
+                            LOC(OSS()<<"Le mode de dépendance de la variable " 
+                                << nomVar << " est indéfini."));
 
     if ( ( portDependencyType != dependencyType ) && 
         ( dependencyType != CalciumTypes::SEQUENCE_DEPENDENCY ) ) 
-      throw DatastreamException(CalciumTypes::CPITVR,
-                               LOC(OSS()<<"Le mode de dépendance de la variable " 
-                                   << nomVar << " ne correspond pas au mode demandé."));
+      throw CalciumException(CalciumTypes::CPITVR,
+                            LOC(OSS()<<"Le mode de dépendance de la variable " 
+                                << nomVar << " ne correspond pas au mode demandé."));
 
   
     if ( dependencyType == CalciumTypes::TIME_DEPENDENCY ) {
@@ -300,8 +297,8 @@ public :
     typedef typename DataManipulator::Type                CorbaDataType; // Attention != T1
     typedef typename DataManipulator::InnerType           InnerType;
 
-      std::cerr << "-------- CalciumInterface(ecriture) MARK 1 ------------------" << std::endl;
-    if ( nomVar.empty() ) throw DatastreamException(CalciumTypes::CPNMVR,
+    std::cerr << "-------- CalciumInterface(ecriture) MARK 1 ------------------" << std::endl;
+    if ( nomVar.empty() ) throw CalciumException(CalciumTypes::CPNMVR,
                                                    LOC("Le nom de la variable est <nul>"));
     PortType * port;
     std::cout << "-------- CalciumInterface(ecriture) MARK 2 ------------------" << std::endl;
@@ -311,14 +308,14 @@ public :
       std::cout << "-------- CalciumInterface(ecriture) MARK 3 ------------------" << std::endl;
     } catch ( const Superv_Component_i::PortNotDefined & ex) {
       std::cerr << ex.what() << std::endl;
-      throw (DatastreamException(CalciumTypes::CPNMVR,ex));
+      throw (CalciumException(CalciumTypes::CPNMVR,ex));
     } catch ( const Superv_Component_i::PortNotConnected & ex) {
       std::cerr << ex.what() << std::endl;;
-      throw (DatastreamException(CalciumTypes::CPLIEN,ex)); 
+      throw (CalciumException(CalciumTypes::CPLIEN,ex)); 
       // VERIFIER LES CAS DES CODES : CPINARRET, CPSTOPSEQ, CPCTVR, CPLIEN
     } catch ( const Superv_Component_i::BadCast & ex) {
       std::cerr << ex.what() << std::endl;
-      throw (DatastreamException(CalciumTypes::CPTPVR,ex));
+      throw (CalciumException(CalciumTypes::CPTPVR,ex));
     }
  
     // mode == mode du port 
@@ -331,16 +328,16 @@ public :
 //       std::cout << "-------- CalciumInterface(ecriture) MARK 4 ------------------" << std::endl;
 //     } catch ( const DSC_Exception & ex ) {
 //       std::cerr << ex.what() << std::endl;;
-//       throw (DatastreamException(CalciumTypes::CPIT,ex));
+//       throw (CalciumException(CalciumTypes::CPIT,ex));
 //     }
 
     if ( dependencyType == CalciumTypes::UNDEFINED_DEPENDENCY )
-      throw DatastreamException(CalciumTypes::CPIT,
+      throw CalciumException(CalciumTypes::CPIT,
                                LOC(OSS()<<"Le mode de dépendance demandé pour la variable " 
                                    << nomVar << " est indéfini."));
 
     if ( dependencyType == CalciumTypes::SEQUENCE_DEPENDENCY )
-      throw DatastreamException(CalciumTypes::CPIT,
+      throw CalciumException(CalciumTypes::CPIT,
                                LOC(OSS()<<"Le mode de dépendance SEQUENCE_DEPENDENCY pour la variable " 
                                    << nomVar << " est impossible en écriture."));
 
@@ -350,13 +347,13 @@ public :
     // modifier l'interface IDL pour y ajouter un mode de dépendance !
     // ---->
 //     if ( portDependencyType != dependencyType ) 
-//       throw DatastreamException(CalciumTypes::CPITVR,
+//       throw CalciumException(CalciumTypes::CPITVR,
 //                             LOC(OSS()<<"Le mode de dépendance de la variable " 
 //                                 << nomVar << " ne correspond pas au mode demandé."));
 
   
     if ( bufferLength < 1 )
-      throw DatastreamException(CalciumTypes::CPNTNULL,
+      throw CalciumException(CalciumTypes::CPNTNULL,
                                LOC(OSS()<<"Le buffer a envoyer est de taille nulle "));
 
 
@@ -438,7 +435,7 @@ ecp_fin_ (void * component, int code) {
   try {                                                                        
     CalciumInterface::ecp_fin( *_component,                            
                               provideLastGivenValue); 
-  } catch ( const DatastreamException & ex) { //tester l'arrêt par exception
+  } catch ( const CalciumException & ex) { //tester l'arrêt par exception
     std::cerr << ex.what() << std::endl;                               
     return ex.getInfo();                                               
   }                                                                    
@@ -457,9 +454,9 @@ ecp_fin_ (void * component, int code) {
     double         _tf=*tf;                                            \
     size_t         _nRead=0;                                           \
     size_t         _bufferLength=bufferLength;                         \
-    CalciumTypes::DependencyType _dependencyType=     \
-          static_cast<CalciumTypes::DependencyType>(dependencyType);                                                   \
-                                                                                  \
+    CalciumTypes::DependencyType _dependencyType=                      \
+      static_cast<CalciumTypes::DependencyType>(dependencyType);       \
+                                                                       \
     if ( IsSameType< _name , cplx >::value ) _bufferLength*=2;         \
     std::cout << "-------- CalciumInterface(lecture Inter Part) MARK 1 ------------------" << std::endl; \
     try {                                                              \
@@ -468,8 +465,10 @@ ecp_fin_ (void * component, int code) {
                                                     _ti, _tf, *i,      \
                                                     nomvar,            \
                                                     _bufferLength, _nRead, *data); \
-    } catch ( const DatastreamException & ex) {                                \
+    } catch ( const CalciumException & ex) {                           \
+      std::cout << "-------- CalciumInterface(lecture Inter Part) MARK 1b ------------------" << std::endl; \
       std::cerr << ex.what() << std::endl;                             \
+      std::cout << "-------- CalciumInterface(lecture Inter Part) MARK 1ter ------------------" << std::endl; \
       return ex.getInfo();                                             \
     }                                                                  \
     if ( IsSameType< _name , cplx >::value ) { *nRead=_nRead/2;                \
@@ -506,7 +505,7 @@ ecp_fin_ (void * component, int code) {
       CalciumInterface::ecp_ecriture< _type, _name >( *_component,     \
                                                      static_cast<CalciumTypes::DependencyType>(dependencyType), \
                                                      _t,i,nomvar,_bufferLength,*data); \
-    } catch ( const DatastreamException & ex) {                                \
+    } catch ( const CalciumException & ex) {                           \
       std::cerr << ex.what() << std::endl;                             \
       return ex.getInfo();                                             \
     }                                                                  \
index af1cf7d4fc82af68904c357c385d470d240b4fed..987ed26b10324c4c77a19ca0cf849a94f15848db 100644 (file)
@@ -198,8 +198,9 @@ namespace CalciumTypes {
   //   const int CPPVM = 37;
   //   const int CPCOM = 37;
   /* Erreur detectee au niveau de l'int CPERRINST = 38;
+
   /* Mode d'execution non defini               */
-  const int CPMODE    = 39;
+  //   const int CPMODE    = 39;
 
   /* Instance deconnectee                      */
   const int CPINSTDEC = 40;
index 07c26096a36d941e29db9e58635595cd4cfeedac..144095e2bad0561b3f05b695b5a19a99620d9063 100644 (file)
@@ -47,6 +47,7 @@ salomeinclude_HEADERS = calcium_port_factory.hxx \
                        calcium_logical_port_uses.hxx \
                        calcium_complex_port_uses.hxx \
                        CalciumCouplingPolicy.hxx \
+                       CalciumException.hxx \
                        CalciumTypes.hxx \
                        CalciumInterface.hxx \
                        Copy2UserSpace.hxx \
@@ -71,7 +72,8 @@ COMMON_CPPFLAGS= -I$(top_srcdir)/src/DSC/DSC_User \
                 -I$(top_srcdir)/src/Utils \
                 -I$(top_builddir)/salome_adm/unix \
                 -I$(top_builddir)/idl \
-                @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
+                @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ \
+                @BOOST_CPPFLAGS@
 
 # This local variable defines the list of dependant libraries common to all target in this package.
 COMMON_LIBS = @CORBA_LIBS@
index 8428f25ee09d6df490015834112790028ce0fea1..4cee34b9409d401d2aa7f9ea21f4f0141cf10b44 100644 (file)
@@ -29,7 +29,7 @@
 #include "CalciumCouplingPolicy.hxx"
 
 #include "CalciumProvidesPort.hxx"
-#include "DatastreamException.hxx"
+#include "CalciumException.hxx"
 
 using namespace CalciumTypes;
 
@@ -55,7 +55,7 @@ public:
          std::cout << "(*dataIdIt) must be equal to given dataId parameter : " << *dataIdIt;
          std::cout << " == " << dataId << " : " << (ret = (*dataIdIt == dataId)) << std::endl;
        }
-    } catch(const DATASTREAM_EXCEPTION & ex) {
+    } catch(const CalciumException & ex) {
       ret=1;
       std::cout << ex.what() << std::endl;
     }
diff --git a/src/DSC/DSC_User/Datastream/DatastreamException.hxx b/src/DSC/DSC_User/Datastream/DatastreamException.hxx
deleted file mode 100644 (file)
index 1529659..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-//  Copyright (C) 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   : DatastreamException.hxx
-//  Author : Eric Fayolle (EDF)
-//  Module : KERNEL
-// Modified by : $LastChangedBy$
-// Date        : $LastChangedDate: 2007-02-06 17:20:28 +0100 (mar, 06 fév 2007) $
-// Id          : $Id$
-
-#ifndef DATASTREAM_EXCEPTION_HXX
-#define DATASTREAM_EXCEPTION_HXX
-
-#include "DSC_Exception.hxx"
-#include "CalciumTypes.hxx"
-
-struct DatastreamException  : public DSC_Exception {
-
-  DatastreamException( const CalciumTypes::InfoType info,
-                      const string &     text, 
-                      const char        *fileName, 
-                      const unsigned int lineNumber,
-                      const char        *funcName):
-  DSC_Exception(text,fileName,lineNumber,funcName),_info(info)
-  {};
-
-
-  DatastreamException( const CalciumTypes::InfoType info,
-                      const string & text ):
-    DSC_Exception(text),_info(info)
-  {};
-
-  DatastreamException(CalciumTypes::InfoType info, const DSC_Exception & ex ):
-    DSC_Exception(ex),_info(info) {};
-  virtual ~DatastreamException() throw() {};
-  CalciumTypes::InfoType getInfo() const { return _info;}
-  void setInfo(CalciumTypes::InfoType info) {_info=info;}
-
-private:
-  CalciumTypes::InfoType _info;
-};
-
-
-#endif /* DATASTREAM_EXCEPTION_HXX */
index 2c01d54f5a3d29003ca8765b254ce0fc69b7241e..cc9a7e7eb5f0fd2cfe80e7a4a67904b83cc69baa 100644 (file)
@@ -288,7 +288,6 @@ void GenericPort<DataManipulator, COUPLING_POLICY>::put(CorbaInDataType dataPara
   catch ( const SALOME_Exception & ex ) {
     // On évite de laisser un  mutex
     storedDatas_mutex.unlock();
-    
     std::cerr << ex;
     THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR);
   }
@@ -429,6 +428,7 @@ GenericPort<DataManipulator, COUPLING_POLICY>::get(TimeType time,
     }
 
   } catch (...) {
+    waitingForConvenientDataId = true;
     storedDatas_mutex.unlock();
     throw;
   }
index 95d23f2807211397b51e488bfe88b83ccfb1c8e4..43357dc2efa43d11ecca3473d1fcb2e6813ff495 100644 (file)
@@ -42,7 +42,8 @@
 
 //ex : GENERATE_USES_PORT(Ports::Data_Short_Port,data_short_port);
 
-template <typename DataManipulator, typename CorbaPortType, char * repositoryName, typename UsesPort=uses_port> 
+template <typename DataManipulator, typename CorbaPortType, char * repositoryName, 
+         typename UsesPort=uses_port > 
 class GenericUsesPort : public UsesPort
 {
 public :
index 9aa857d5ef6d271ce7b4b432ab0c0ef93e10174a..1f6d0a12ea35d8041db1baf24d6b03e2739b58eb 100644 (file)
@@ -43,9 +43,7 @@ salomeinclude_HEADERS = GenericPort.hxx \
                        FindKeyPredicate.hxx \
                        AdjacentFunctor.hxx \
                        IteratorTraits.hxx \
-                       ConstTraits.hxx \
-                       lambda.hpp \
-                       DatastreamException.hxx
+                       ConstTraits.hxx
 
 #
 # ===============================================================
diff --git a/src/DSC/DSC_User/Datastream/lambda.hpp b/src/DSC/DSC_User/Datastream/lambda.hpp
deleted file mode 100644 (file)
index c44aa85..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-// -- lambda.hpp -- Boost Lambda Library -----------------------------------
-// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
-//
-// Distributed under the Boost Software License, Version 1.0. (See
-// accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-//
-// For more information, see http://lambda.cs.utu.fi 
-
-#ifndef BOOST_LAMBDA_LAMBDA_HPP
-#define BOOST_LAMBDA_LAMBDA_HPP
-
-
-#include "boost/lambda/core.hpp"
-
-#ifdef BOOST_NO_FDECL_TEMPLATES_AS_TEMPLATE_TEMPLATE_PARAMS
-#include <istream>
-#include <ostream>
-#endif
-
-#include "boost/lambda/detail/operator_actions.hpp"
-#include "boost/lambda/detail/operator_lambda_func_base.hpp"
-#include "boost/lambda/detail/operator_return_type_traits.hpp"
-
-
-#include "boost/lambda/detail/operators.hpp"
-
-#ifndef BOOST_LAMBDA_FAILS_IN_TEMPLATE_KEYWORD_AFTER_SCOPE_OPER
-// sorry, member ptr does not work with gcc2.95
-#include "boost/lambda/detail/member_ptr.hpp"
-#endif
-
-
-#endif