]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Ajout des properties
authorfayolle <fayolle>
Thu, 22 Mar 2007 14:24:04 +0000 (14:24 +0000)
committerfayolle <fayolle>
Thu, 22 Mar 2007 14:24:04 +0000 (14:24 +0000)
Création de la classe calcium_provides_port (pour appeler directement les
méthodes de paramétrage des ports calcium)

29 files changed:
src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.cxx
src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.hxx
src/DSC/DSC_User/Datastream/Calcium/CalciumGenericProvidesPort.hxx
src/DSC/DSC_User/Datastream/Calcium/CalciumProvidesPort.cxx [new file with mode: 0644]
src/DSC/DSC_User/Datastream/Calcium/CalciumProvidesPort.hxx [new file with mode: 0644]
src/DSC/DSC_User/Datastream/Calcium/CalciumTypes.hxx
src/DSC/DSC_User/Datastream/Calcium/CalciumTypes2CorbaTypes.cxx [new file with mode: 0644]
src/DSC/DSC_User/Datastream/Calcium/CalciumTypes2CorbaTypes.hxx [new file with mode: 0644]
src/DSC/DSC_User/Datastream/Calcium/CorbaTypes2CalciumTypes.cxx [new file with mode: 0644]
src/DSC/DSC_User/Datastream/Calcium/CorbaTypes2CalciumTypes.hxx [new file with mode: 0644]
src/DSC/DSC_User/Datastream/Calcium/Makefile.am
src/DSC/DSC_User/Datastream/Calcium/calcium_destructors_port_provides.cxx [deleted file]
src/DSC/DSC_User/Datastream/Calcium/calcium_port_factory.hxx
src/DSC/DSC_User/Datastream/Calcium/calcium_port_provides.hxx [deleted file]
src/DSC/DSC_User/Datastream/Calcium/calcium_provides_port.cxx [new file with mode: 0644]
src/DSC/DSC_User/Datastream/Calcium/calcium_provides_port.hxx [new file with mode: 0644]
src/DSC/DSC_User/Datastream/Calcium/test_DataIdContainer.cxx
src/DSC/DSC_User/Datastream/GenericPort.hxx
src/DSC/DSC_User/Datastream/GenericProvidesPort.hxx [new file with mode: 0644]
src/DSC/DSC_User/Datastream/GenericUsesPort.hxx
src/DSC/DSC_User/Datastream/Makefile.am
src/DSC/DSC_User/Makefile.am
src/DSC/DSC_User/Superv_Component_i.hxx
src/DSC/DSC_User/base_port.cxx [new file with mode: 0644]
src/DSC/DSC_User/base_port.hxx
src/DSC/DSC_User/provides_port.cxx
src/DSC/DSC_User/provides_port.hxx
src/DSC/DSC_User/uses_port.cxx
src/DSC/DSC_User/uses_port.hxx

index 1cd068ca14f97a583a92c655e9573fbf34646ab9..61693653437c541d6b40e574974da4553fc605f6 100644 (file)
@@ -35,50 +35,56 @@ CalciumCouplingPolicy::CalciumCouplingPolicy():_dependencyType(CalciumTypes::UND
                                               _disconnectDirective(CalciumTypes::UNDEFINED_DIRECTIVE){};
 
 void CalciumCouplingPolicy::setDependencyType (CalciumTypes::DependencyType dependencyType) {_dependencyType=dependencyType;}
-CalciumTypes::DependencyType CalciumCouplingPolicy::getDependencyType () const                        { return _dependencyType;}
+CalciumTypes::DependencyType CalciumCouplingPolicy::getDependencyType () const              { return _dependencyType;}
  
 void   CalciumCouplingPolicy::setStorageLevel   (size_t         storageLevel)   {
-  if ( storageLevel < 1  )
+  if ( storageLevel < 1 && (storageLevel != CalciumTypes::UNLIMITED_STORAGE_LEVEL)  )
     throw DATASTREAM_EXCEPTION(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 en dépendance itérative"));
+    throw DATASTREAM_EXCEPTION(LOC("Il est impossible de positionner un schéma temporel sur un port qui n'est pas en dépendance temporelle"));
   _dateCalSchem = dateCalSchem;
 }
 
-CalciumTypes::DateCalSchem CalciumCouplingPolicy::getDateCalSchem () const   {
-  if ( _dependencyType != CalciumTypes::TIME_DEPENDENCY )
-    throw DATASTREAM_EXCEPTION(LOC("Un schéma temporel sur un port en dépendance itérative n'a pas de sens"));
-  return _dateCalSchem;
-}
+CalciumTypes::DateCalSchem CalciumCouplingPolicy::getDateCalSchem () const   { return _dateCalSchem; }
 
 void CalciumCouplingPolicy::setAlpha(double alpha) {
   if ( _dependencyType != CalciumTypes::TIME_DEPENDENCY )
-    throw DATASTREAM_EXCEPTION(LOC("Il est impossible de positionner alpha sur un port en dépendance itérative"));
+    throw DATASTREAM_EXCEPTION(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]"));
 }
 
-double CalciumCouplingPolicy::getAlpha() const  {
-  if ( _dependencyType != CalciumTypes::TIME_DEPENDENCY )
-    throw DATASTREAM_EXCEPTION(LOC("Le paramètre alpha sur un port en dépendance itérative n'a pas de sens"));
-  return _alpha;
-}
+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"));
   if ( 0 <= deltaT <= 1 ) _deltaT = deltaT; 
   else 
     throw(DATASTREAM_EXCEPTION(LOC("Le paramètre deltaT doit être compris entre [0,1]")));
 }
-double CalciumCouplingPolicy::getdeltaT() const  {return _deltaT;}
+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"));
+  _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"));
+_extrapolationSchem=extrapolationSchem;
+}
 
-void CalciumCouplingPolicy::setInterpolationSchem (CalciumTypes::InterpolationSchem interpolationSchem) {_interpolationSchem=interpolationSchem;}
-void CalciumCouplingPolicy::setExtrapolationSchem (CalciumTypes::ExtrapolationSchem extrapolationSchem) {_extrapolationSchem=extrapolationSchem;}
+CalciumTypes::InterpolationSchem CalciumCouplingPolicy::getInterpolationSchem () const { return _interpolationSchem; };
+CalciumTypes::ExtrapolationSchem CalciumCouplingPolicy::getExtrapolationSchem () const { return _extrapolationSchem; };
 
 
 CalciumCouplingPolicy::TimeType 
@@ -92,6 +98,7 @@ CalciumCouplingPolicy::getEffectiveTime(CalciumCouplingPolicy::TimeType ti,
 }
 
 void CalciumCouplingPolicy::disconnect(bool provideLastGivenValue) {
+  // TODO Réveiller les ports en attente ! OU timeout ?
   if (provideLastGivenValue) {
     std::cout << "-------- CalciumCouplingPolicy::disconnect CP_CONT  ------------------" << std::endl;
     _disconnectDirective = CalciumTypes::CONTINUE;
@@ -99,4 +106,8 @@ void CalciumCouplingPolicy::disconnect(bool provideLastGivenValue) {
     std::cout << "-------- CalciumCouplingPolicy::disconnect CP_ARRET  ------------------" << std::endl;
     _disconnectDirective = CalciumTypes::STOP;
   }
+//   if (waitingForAnyDataId || waitingForConvenientDataId);
+//        cond_instance.signal();
+       
 }
index 3dd41f4dd1c199fb5f63df76ee25c2cee717a02f..f1f15d1186ec97abe52574c3aa4c41ee19398a9e 100644 (file)
@@ -79,10 +79,12 @@ public:
   double getAlpha() const ;
 
   void   setDeltaT(double deltaT );
-  double getdeltaT() const ;
+  double getDeltaT() const ;
 
   void setInterpolationSchem (InterpolationSchem interpolationSchem);
   void setExtrapolationSchem (ExtrapolationSchem extrapolationSchem);
+  InterpolationSchem getInterpolationSchem () const ;
+  ExtrapolationSchem getExtrapolationSchem () const ;
 
   // Classe DataId rassemblant les paramètres de la méthode PORT::put 
   // qui identifient l'instance d'une donnée pour Calcium
@@ -284,7 +286,7 @@ bool CalciumCouplingPolicy::isDataIdConveniant( AssocContainer & storedDatas, co
   return isEqual || isBounded;
 }
 
-
+// PAS ENCORE TESTE AVEC UN NIVEAU POSITIONNE
 // Supprime les DataId et les données associées
 // du container associative quand le nombre
 // de données stockées dépasse le niveau CALCIUM.
index f39310e709afb2534e4f1a8070b9cbf93b4ba1a4..e10e1dac3f46d85b20ed07e45cda45783f768067 100644 (file)
 #ifndef _CALCIUM_GENERIC_PROVIDES_PORT_HXX_
 #define _CALCIUM_GENERIC_PROVIDES_PORT_HXX_
 
-//include utile ? :
-#include "Calcium_Ports.hh"
+#include "PortProperties_i.hxx"
 
-#include "provides_port.hxx"
+#include "calcium_provides_port.hxx"
 
-#include "GenericPort.hxx"
+#include "GenericProvidesPort.hxx"
 #include "CalciumCouplingPolicy.hxx"
 
-// TODO: Creer un trait qui à partir de CorbaInterface déduit CorbaDataManipulator
+#include "CorbaTypes2CalciumTypes.hxx"
+#include "CalciumTypes2CorbaTypes.hxx"
+
+#include "DSC_Exception.hxx"
+#include <iostream>
+
+//
+// Cette macro CPP remplace une déclaration : template <typename CorbaInterface, typename CorbaDataManipulator > 
+// mais permet surtout de générer différentes classes (dont le nom est spécifié par specificPortName ) 
+//
+// Variante: Creer un trait qui à partir de CorbaInterface déduit CorbaDataManipulator
 // et simplifier la classe
 //
-//  Avant d'utiliser la macro : template <typename CorbaInterface, typename CorbaDataManipulator > 
-// 
-// utilisation de __VA_ARGS__ au lieu de CorbaDataManipulator car à l'appel de la
-// macro le token du troisième argument contient une virgule qui est considéré comme
-// séparateur d'argument par le PP 
-#define CALCIUM_GENERIC_PROVIDES_PORT(specificPortName,CorbaInterface,...) \
+// L'utilisation conjointe du paramètre ... et de __VA_ARGS__ au lieu d'un 'CorbaDataManipulator' permet
+// d'invoquer la macro avec un troisième token contenant une virgule 
+// (qui est considéré comme un séparateur d'argument par le PP ) 
+
+#define CALCIUM_GENERIC_PROVIDES_PORT_HXX(specificPortName,CorbaInterface,...) \
   class specificPortName :   public virtual CorbaInterface ,           \
-                            public virtual provides_port,              \
-                            public GenericPort< __VA_ARGS__ , CalciumCouplingPolicy > { \
+                            public virtual POA_Ports::PortProperties,  \
+                            public GenericProvidesPort< __VA_ARGS__ , CalciumCouplingPolicy, calcium_provides_port > { \
   public :                                                             \
     typedef  __VA_ARGS__               DataManipulator;                        \
     typedef  DataManipulator::Type     CorbaDataType;                  \
     typedef GenericPort< DataManipulator ,                             \
-      CalciumCouplingPolicy >                  Port;                   \
+      CalciumCouplingPolicy >          Port;                           \
                                                                        \
     virtual ~ specificPortName ();                                     \
                                                                        \
     inline void disconnect(bool provideLastGivenValue) {               \
       Port::disconnect(provideLastGivenValue);                         \
+    }                                                                  \
+    inline void setDependencyType(CalciumTypes::DependencyType dependencyType) { \
+      Port::setDependencyType(dependencyType);                         \
+    }                                                                  \
+    inline CalciumTypes::DependencyType getDependencyType () const {   \
+      return Port::getDependencyType();                                        \
+    }                                                                  \
+    inline void   setStorageLevel (size_t storageLevel) {              \
+      Port::setStorageLevel(storageLevel);                             \
+    }                                                                  \
+    inline size_t getStorageLevel () const {                           \
+      return Port::getStorageLevel();                                  \
+    }                                                                  \
+    inline void   setDateCalSchem (CalciumTypes::DateCalSchem   dateCalSchem) { \
+      Port::setDateCalSchem (dateCalSchem);                            \
+    }                                                                  \
+    inline CalciumTypes::DateCalSchem getDateCalSchem () const {       \
+      return Port::getDateCalSchem ();                                 \
+    }                                                                  \
+    inline void setAlpha(double alpha) {                               \
+      Port::setAlpha(alpha);                                           \
+    }                                                                  \
+    inline double getAlpha() const  {                                  \
+      return Port::getAlpha();                                         \
+    }                                                                  \
+    inline void   setDeltaT(double deltaT ) {                          \
+      Port::setDeltaT(deltaT);                                         \
+    }                                                                  \
+    inline double getDeltaT() const  {                                 \
+      return Port::getDeltaT();                                                \
+    }                                                                  \
+    inline void setInterpolationSchem (CalciumTypes::InterpolationSchem interpolationSchem) { \
+      Port::setInterpolationSchem(interpolationSchem);                 \
+    }                                                                  \
+    inline void setExtrapolationSchem (CalciumTypes::ExtrapolationSchem extrapolationSchem) { \
+      Port::setExtrapolationSchem(extrapolationSchem);                 \
+    }                                                                  \
+    inline CalciumTypes::InterpolationSchem getInterpolationSchem() const  { \
+      return Port::getInterpolationSchem();                            \
+    }                                                                  \
+    inline CalciumTypes::ExtrapolationSchem getExtrapolationSchem() const  { \
+      return Port::getExtrapolationSchem();                            \
     }                                                                  \
                                                                        \
     inline void put( DataManipulator::CorbaInType data,                        \
     inline Ports::Port_ptr get_port_ref() {                            \
       return _this();                                                  \
     }                                                                  \
+                                                                       \
+    Ports::PortProperties_ptr get_port_properties() {                  \
+      return POA_Ports::PortProperties::_this();                       \
+    }                                                                  \
+                                                                       \
+    virtual void set_property(const char * name, const CORBA::Any& value) \
+      throw (Ports::NotDefined, Ports::BadType, Ports::BadValue);      \
+                                                                       \
+    virtual CORBA::Any* get_property(const char* name)                 \
+      throw (Ports::NotDefined);                                       \
+                                                                       \
   };                                                                   \
   
 
+
+
+#define CALCIUM_GENERIC_PROVIDES_PORT_CXX(specificPortName)            \
+                                                                       \
+  specificPortName::~specificPortName(void) {};                                \
+                                                                       \
+  void specificPortName::set_property(const char * name,  const CORBA::Any& value) \
+    throw (Ports::NotDefined, Ports::BadType, Ports::BadValue) {       \
+                                                                       \
+    const std::string key(name);                                       \
+    CORBA::Long sl;                                                    \
+    CORBA::Double alpha,delta;                                         \
+    Ports::Calcium_Ports::DependencyType dt;                           \
+    Ports::Calcium_Ports::DateCalSchem  dcs;                           \
+    Ports::Calcium_Ports::InterpolationSchem is;                       \
+    Ports::Calcium_Ports::ExtrapolationSchem es;                       \
+    bool ok=false;                                                     \
+                                                                       \
+    try {                                                              \
+                                                                       \
+      if (key == "StorageLevel" )                                      \
+       {if ( ok=(value >>= sl)    ) Port::setStorageLevel(sl);}        \
+      else if (key == "Alpha"      )                                   \
+       {if ( ok=(value >>= alpha) ) Port::setAlpha(alpha);}            \
+      else if (key == "DeltaT"     )                                   \
+       {if ( ok=(value >>= delta) ) Port::setDeltaT(delta);}           \
+      else if (key == "DependencyType" )                               \
+       {if ( ok=( value >>= dt)   ) Port::setDependencyType(dependencyType[dt]);} \
+      else if (key == "DateCalSchem" )                                 \
+       {if ( ok=(value >>= dcs) )                                      \
+           Port::setDateCalSchem(dateCalSchem[dcs]);}                  \
+      else if (key == "InterpolationSchem")                            \
+       {if ( ok=(value >>= is) )                                       \
+           Port::setInterpolationSchem(interpolationSchem[is]);}       \
+      else if (key == "ExtrapolationSchem")                            \
+       {if ( ok=(value >>= es) )                                       \
+           Port::setExtrapolationSchem(extrapolationSchem[es]);}       \
+      else                                                             \
+       throw Ports::NotDefined();                                      \
+      if (!ok) throw Ports::BadType();                                 \
+                                                                       \
+    } catch ( const DSC_Exception & ex ) {                             \
+                                                                       \
+      std::cerr << ex.what() << std::endl;                             \
+      throw Ports::BadValue();                                         \
+    }                                                                  \
+  }                                                                    \
+                                                                       \
+                                                                       \
+  CORBA::Any* specificPortName::get_property(const char* name)         \
+    throw (Ports::NotDefined) {                                                \
+    const std::string key(name);                                       \
+    CORBA::Any* value=new CORBA::Any;                                  \
+    if (key == "StorageLevel"    )                                     \
+      { (*value) <<= static_cast<CORBA::Long>(Port::getStorageLevel()); } \
+    else if (key == "Alpha"      )                                     \
+      { *value <<= (CORBA::Double) Port::getAlpha();}                  \
+    else if (key == "DeltaT"     )                                     \
+      { *value <<= (CORBA::Double) Port::getDeltaT();}                 \
+    else if (key == "DependencyType" )                                 \
+      {  *value <<= corbaDependencyType[Port::getDependencyType()];}   \
+    else if (key == "DateCalSchem" )                                   \
+      { *value <<= corbaDateCalSchem[Port::getDateCalSchem()];}                \
+    else if (key == "InterpolationSchem")                              \
+      { *value <<= corbaInterpolationSchem[Port::getInterpolationSchem()];} \
+    else if (key == "ExtrapolationSchem")                              \
+      { *value <<= corbaExtrapolationSchem[Port::getExtrapolationSchem()];} \
+    else {                                                             \
+      delete value;                                                    \
+      throw Ports::NotDefined();                                       \
+    }                                                                  \
+    return value;                                                      \
+  };                                           
+                                                                       
+
 #endif
diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumProvidesPort.cxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumProvidesPort.cxx
new file mode 100644 (file)
index 0000000..6ada79b
--- /dev/null
@@ -0,0 +1,14 @@
+#include "CalciumProvidesPort.hxx"
+
+
+CALCIUM_GENERIC_PROVIDES_PORT_CXX(calcium_integer_port_provides)
+
+CALCIUM_GENERIC_PROVIDES_PORT_CXX(calcium_real_port_provides)  
+
+CALCIUM_GENERIC_PROVIDES_PORT_CXX(calcium_double_port_provides)
+
+CALCIUM_GENERIC_PROVIDES_PORT_CXX(calcium_complex_port_provides)
+
+CALCIUM_GENERIC_PROVIDES_PORT_CXX(calcium_logical_port_provides)
+
+CALCIUM_GENERIC_PROVIDES_PORT_CXX(calcium_string_port_provides)
diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumProvidesPort.hxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumProvidesPort.hxx
new file mode 100644 (file)
index 0000000..0751326
--- /dev/null
@@ -0,0 +1,38 @@
+// Eric Fayolle - EDF R&D
+// Modified by : $LastChangedBy$
+// Date        : $LastChangedDate: 2007-03-01 13:40:26 +0100 (Thu, 01 Mar 2007) $
+// Id          : $Id$
+
+#ifndef _CALCIUM_PORT_PROVIDES_HXX_
+#define _CALCIUM_PORT_PROVIDES_HXX_
+
+#include "Calcium_Ports.hh"
+#include "CalciumGenericProvidesPort.hxx"
+#include "CalciumCouplingPolicy.hxx"
+
+
+CALCIUM_GENERIC_PROVIDES_PORT_HXX(calcium_integer_port_provides,               \
+                             POA_Ports::Calcium_Ports::Calcium_Integer_Port, \
+                             seq_u_manipulation<Ports::Calcium_Ports::seq_long,CORBA::Long> ) \
+
+CALCIUM_GENERIC_PROVIDES_PORT_HXX(calcium_real_port_provides,          \
+                             POA_Ports::Calcium_Ports::Calcium_Real_Port, \
+                             seq_u_manipulation<Ports::Calcium_Ports::seq_float,CORBA::Float> ) \
+
+CALCIUM_GENERIC_PROVIDES_PORT_HXX(calcium_double_port_provides,                \
+                             POA_Ports::Calcium_Ports::Calcium_Double_Port, \
+                             seq_u_manipulation<Ports::Calcium_Ports::seq_double,CORBA::Double> ) \
+
+CALCIUM_GENERIC_PROVIDES_PORT_HXX(calcium_complex_port_provides,               \
+                             POA_Ports::Calcium_Ports::Calcium_Complex_Port, \
+                             seq_u_manipulation<Ports::Calcium_Ports::seq_float,CORBA::Float> ) \
+
+CALCIUM_GENERIC_PROVIDES_PORT_HXX(calcium_logical_port_provides,               \
+                             POA_Ports::Calcium_Ports::Calcium_Logical_Port, \
+                             seq_u_manipulation<Ports::Calcium_Ports::seq_boolean,CORBA::Boolean> ) \
+
+CALCIUM_GENERIC_PROVIDES_PORT_HXX(calcium_string_port_provides,                \
+                             POA_Ports::Calcium_Ports::Calcium_String_Port, \
+                             seq_u_manipulation<Ports::Calcium_Ports::seq_string,char *> ) \
+
+#endif
index 4e0c8dfefb2072977e1a6aaecc4b251fde35ebd2..62fdd86d6fcb4222a30e1c178357c14f7cc312f3 100644 (file)
@@ -66,7 +66,9 @@ namespace CalciumTypes {
   const   int  UNLIMITED_STORAGE_LEVEL = CP_ILLIMITE;
   typedef enum {UNDEFINED_DEPENDENCY=CPIT,TIME_DEPENDENCY=CP_TEMPS,
                ITERATION_DEPENDENCY=CP_ITERATION,
-               SEQUENCE_DEPENDENCY =CP_SEQUENTIEL }                        DependencyType;
+               // 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;
diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumTypes2CorbaTypes.cxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumTypes2CorbaTypes.cxx
new file mode 100644 (file)
index 0000000..0425a6b
--- /dev/null
@@ -0,0 +1,131 @@
+// Eric Fayolle - EDF R&D
+// Modified by : $LastChangedBy$
+// Date        : $LastChangedDate: 2007-03-01 13:40:26 +0100 (Thu, 01 Mar 2007) $
+// Id          : $Id$
+
+#include "CalciumTypes2CorbaTypes.hxx"
+#include <iostream>
+
+using namespace std;
+
+CORBA_DATE_CAL_SCHEM::CORBA_DATE_CAL_SCHEM() : map<CalciumTypes::DateCalSchem,
+                                                  Ports::Calcium_Ports::DateCalSchem>()
+{
+  map<CalciumTypes::DateCalSchem, 
+    Ports::Calcium_Ports::DateCalSchem > &
+    table  = ( map<CalciumTypes::DateCalSchem, 
+              Ports::Calcium_Ports::DateCalSchem > & ) *this ;
+
+table[CalciumTypes::TI_SCHEM ] = Ports::Calcium_Ports::TI_SCHEM ;
+table[CalciumTypes::TF_SCHEM ] = Ports::Calcium_Ports::TF_SCHEM ;
+table[CalciumTypes::ALPHA_SCHEM ] = Ports::Calcium_Ports::ALPHA_SCHEM ;
+}
+
+
+Ports::Calcium_Ports::DateCalSchem CORBA_DATE_CAL_SCHEM::operator[]( const CalciumTypes::DateCalSchem &c ) const
+{
+  map<CalciumTypes::DateCalSchem,
+    Ports::Calcium_Ports::DateCalSchem > &table = (map<CalciumTypes::DateCalSchem,
+                                                  Ports::Calcium_Ports::DateCalSchem >&)*this ;
+  assert( table.find( (CalciumTypes::DateCalSchem)c ) != table.end() ) ;
+  return table[ (CalciumTypes::DateCalSchem)c ] ;
+}
+
+const CORBA_DATE_CAL_SCHEM corbaDateCalSchem ;
+
+
+
+CORBA_DEPENDENCY_TYPE::CORBA_DEPENDENCY_TYPE() : map<CalciumTypes::DependencyType,
+                                                    Ports::Calcium_Ports::DependencyType >()
+{
+  map<CalciumTypes::DependencyType,
+    Ports::Calcium_Ports::DependencyType > &
+    table  = ( map<CalciumTypes::DependencyType,
+              Ports::Calcium_Ports::DependencyType > & ) *this ;
+
+table[CalciumTypes::TIME_DEPENDENCY ]      = Ports::Calcium_Ports::TIME_DEPENDENCY ;
+table[CalciumTypes::ITERATION_DEPENDENCY ] = Ports::Calcium_Ports::ITERATION_DEPENDENCY ;
+table[CalciumTypes::UNDEFINED_DEPENDENCY ] = Ports::Calcium_Ports::UNDEFINED_DEPENDENCY ;
+
+
+std::cout << "CORBA_DEPENDENCY_TYPE() : table["<<CalciumTypes::TIME_DEPENDENCY<<"] : "<< 
+  table[CalciumTypes::TIME_DEPENDENCY] << std::endl;
+std::cout << "CORBA_DEPENDENCY_TYPE() : table["<<CalciumTypes::ITERATION_DEPENDENCY<<"] : "<< 
+  table[CalciumTypes::ITERATION_DEPENDENCY] << std::endl;
+std::cout << "CORBA_DEPENDENCY_TYPE() : table["<<CalciumTypes::UNDEFINED_DEPENDENCY<<"] : "<< 
+  table[CalciumTypes::UNDEFINED_DEPENDENCY] << std::endl;
+}
+
+
+Ports::Calcium_Ports::DependencyType CORBA_DEPENDENCY_TYPE::operator[]( const CalciumTypes::DependencyType &c ) const
+{
+  map<CalciumTypes::DependencyType,
+    Ports::Calcium_Ports::DependencyType > &
+    table = (map<CalciumTypes::DependencyType,
+            Ports::Calcium_Ports::DependencyType >& ) *this ;
+
+std::cout << "CORBA_DEPENDENCY_TYPE() : ::operator["<<c<<"]: " << table[c] << std::endl;
+
+  assert( table.find( (CalciumTypes::DependencyType)c ) != table.end() ) ;
+  return table[ (CalciumTypes::DependencyType)c ] ;
+}
+
+const CORBA_DEPENDENCY_TYPE corbaDependencyType ;
+
+
+
+
+CORBA_INTERPOLATION_SCHEM::CORBA_INTERPOLATION_SCHEM() : map<CalciumTypes::InterpolationSchem,
+                                                            Ports::Calcium_Ports::InterpolationSchem > () 
+{
+  map<CalciumTypes::InterpolationSchem,
+    Ports::Calcium_Ports::InterpolationSchem > &
+    table  = ( map<CalciumTypes::InterpolationSchem,
+              Ports::Calcium_Ports::InterpolationSchem > & ) *this ;
+
+  table[CalciumTypes::L0_SCHEM ] = Ports::Calcium_Ports::L0_SCHEM ;
+  table[CalciumTypes::L1_SCHEM ] = Ports::Calcium_Ports::L1_SCHEM ;
+}
+
+
+Ports::Calcium_Ports::InterpolationSchem CORBA_INTERPOLATION_SCHEM::operator[]( const CalciumTypes::InterpolationSchem &c ) const
+{
+  map<CalciumTypes::InterpolationSchem,
+    Ports::Calcium_Ports::InterpolationSchem > &table = 
+    (map<CalciumTypes::InterpolationSchem,
+     Ports::Calcium_Ports::InterpolationSchem >& ) *this ;
+
+  assert( table.find( (CalciumTypes::InterpolationSchem)c ) != table.end() ) ;
+  return table[ (CalciumTypes::InterpolationSchem)c ] ;
+}
+
+const CORBA_INTERPOLATION_SCHEM corbaInterpolationSchem ;
+
+
+
+CORBA_EXTRAPOLATION_SCHEM::CORBA_EXTRAPOLATION_SCHEM() : map<CalciumTypes::ExtrapolationSchem,
+                                                            Ports::Calcium_Ports::ExtrapolationSchem > () 
+{
+  map<CalciumTypes::ExtrapolationSchem,
+    Ports::Calcium_Ports::ExtrapolationSchem > &
+    table  = ( map<CalciumTypes::ExtrapolationSchem,
+              Ports::Calcium_Ports::ExtrapolationSchem > & ) *this ;
+
+  table[CalciumTypes::E0_SCHEM ] = Ports::Calcium_Ports::E0_SCHEM ;
+  table[CalciumTypes::E1_SCHEM ] = Ports::Calcium_Ports::E1_SCHEM ;
+  table[CalciumTypes::UNDEFINED_EXTRA_SCHEM ] = Ports::Calcium_Ports::UNDEFINED_EXTRA_SCHEM ;
+}
+
+
+Ports::Calcium_Ports::ExtrapolationSchem CORBA_EXTRAPOLATION_SCHEM::operator[]( const CalciumTypes::ExtrapolationSchem &c ) const
+{
+  map<CalciumTypes::ExtrapolationSchem,
+    Ports::Calcium_Ports::ExtrapolationSchem > &table = 
+    (map<CalciumTypes::ExtrapolationSchem,
+     Ports::Calcium_Ports::ExtrapolationSchem >& ) *this ;
+
+  assert( table.find( (CalciumTypes::ExtrapolationSchem)c ) != table.end() ) ;
+  return table[ (CalciumTypes::ExtrapolationSchem)c ] ;
+}
+
+const CORBA_EXTRAPOLATION_SCHEM corbaExtrapolationSchem ;
diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumTypes2CorbaTypes.hxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumTypes2CorbaTypes.hxx
new file mode 100644 (file)
index 0000000..9f1d1f5
--- /dev/null
@@ -0,0 +1,62 @@
+// Eric Fayolle - EDF R&D
+// Modified by : $LastChangedBy$
+// Date        : $LastChangedDate: 2007-03-01 13:40:26 +0100 (Thu, 01 Mar 2007) $
+// Id          : $Id$
+
+#ifndef _CALCIUMTYPES_TO_CORBATYPES_HXX_
+#define _CALCIUMTYPES_TO_CORBATYPES_HXX_
+
+#include "Calcium_Ports.hh"
+#include "CalciumTypes.hxx"
+
+#include <map>
+#include <cassert>
+
+
+class CORBA_DATE_CAL_SCHEM : public std::map<CalciumTypes::DateCalSchem,
+                                            Ports::Calcium_Ports::DateCalSchem > 
+{
+public :
+
+  CORBA_DATE_CAL_SCHEM();
+  Ports::Calcium_Ports::DateCalSchem operator[]( const CalciumTypes::DateCalSchem &c ) const;
+};
+
+
+extern const CORBA_DATE_CAL_SCHEM corbaDateCalSchem ;
+
+class CORBA_DEPENDENCY_TYPE : public std::map<CalciumTypes::DependencyType,
+                                             Ports::Calcium_Ports::DependencyType>
+{
+public :
+
+  CORBA_DEPENDENCY_TYPE();
+  Ports::Calcium_Ports::DependencyType operator[]( const CalciumTypes::DependencyType  &c ) const;
+};
+
+extern const CORBA_DEPENDENCY_TYPE corbaDependencyType ;
+
+class CORBA_INTERPOLATION_SCHEM : public std::map<CalciumTypes::InterpolationSchem,
+                                                 Ports::Calcium_Ports::InterpolationSchem>
+{
+public :
+
+  CORBA_INTERPOLATION_SCHEM();
+  Ports::Calcium_Ports::InterpolationSchem operator[]( const CalciumTypes::InterpolationSchem &c ) const;
+} ;
+
+extern const CORBA_INTERPOLATION_SCHEM corbaInterpolationSchem ;
+
+class CORBA_EXTRAPOLATION_SCHEM : public std::map<CalciumTypes::ExtrapolationSchem,
+                                                 Ports::Calcium_Ports::ExtrapolationSchem>
+{
+public :
+
+  CORBA_EXTRAPOLATION_SCHEM();
+  Ports::Calcium_Ports::ExtrapolationSchem operator[]( const CalciumTypes::ExtrapolationSchem &c ) const;
+} ;
+
+extern const CORBA_EXTRAPOLATION_SCHEM corbaExtrapolationSchem ;
+
+
+#endif
diff --git a/src/DSC/DSC_User/Datastream/Calcium/CorbaTypes2CalciumTypes.cxx b/src/DSC/DSC_User/Datastream/Calcium/CorbaTypes2CalciumTypes.cxx
new file mode 100644 (file)
index 0000000..1789bcf
--- /dev/null
@@ -0,0 +1,130 @@
+// Eric Fayolle - EDF R&D
+// Modified by : $LastChangedBy$
+// Date        : $LastChangedDate: 2007-03-01 13:40:26 +0100 (Thu, 01 Mar 2007) $
+// Id          : $Id$
+
+#include "CorbaTypes2CalciumTypes.hxx"
+#include <iostream>
+
+using namespace std;
+
+DATE_CAL_SCHEM::DATE_CAL_SCHEM() : map<Ports::Calcium_Ports::DateCalSchem,
+                                  CalciumTypes::DateCalSchem>()
+{
+  map<Ports::Calcium_Ports::DateCalSchem,
+    CalciumTypes::DateCalSchem > &
+    table  = ( map<Ports::Calcium_Ports::DateCalSchem,
+              CalciumTypes::DateCalSchem > & ) *this ;
+
+table[Ports::Calcium_Ports::TI_SCHEM ] = CalciumTypes::TI_SCHEM ;
+table[Ports::Calcium_Ports::TF_SCHEM ] = CalciumTypes::TF_SCHEM ;
+table[Ports::Calcium_Ports::ALPHA_SCHEM ] = CalciumTypes::ALPHA_SCHEM ;
+}
+
+
+CalciumTypes::DateCalSchem DATE_CAL_SCHEM::operator[]( const Ports::Calcium_Ports::DateCalSchem &c ) const
+{
+  map<Ports::Calcium_Ports::DateCalSchem,
+    CalciumTypes::DateCalSchem> &table = (map<Ports::Calcium_Ports::DateCalSchem,
+                                           CalciumTypes::DateCalSchem>&)*this ;
+  assert( table.find( (Ports::Calcium_Ports::DateCalSchem)c ) != table.end() ) ;
+  return table[ (Ports::Calcium_Ports::DateCalSchem)c ] ;
+}
+
+const DATE_CAL_SCHEM dateCalSchem ;
+
+
+
+DEPENDENCY_TYPE::DEPENDENCY_TYPE() : map<Ports::Calcium_Ports::DependencyType,
+                                  CalciumTypes::DependencyType>()
+{
+  map<Ports::Calcium_Ports::DependencyType,
+    CalciumTypes::DependencyType > &
+    table  = ( map<Ports::Calcium_Ports::DependencyType,
+              CalciumTypes::DependencyType > & ) *this ;
+
+table[Ports::Calcium_Ports::TIME_DEPENDENCY ]      = CalciumTypes::TIME_DEPENDENCY ;
+table[Ports::Calcium_Ports::ITERATION_DEPENDENCY ] = CalciumTypes::ITERATION_DEPENDENCY ;
+table[Ports::Calcium_Ports::UNDEFINED_DEPENDENCY ] = CalciumTypes::UNDEFINED_DEPENDENCY ;
+
+
+std::cout << "DEPENDENCY_TYPE() : table["<<Ports::Calcium_Ports::TIME_DEPENDENCY<<"] : "<< 
+  table[Ports::Calcium_Ports::TIME_DEPENDENCY] << std::endl;
+std::cout << "DEPENDENCY_TYPE() : table["<<Ports::Calcium_Ports::ITERATION_DEPENDENCY<<"] : "<< 
+  table[Ports::Calcium_Ports::ITERATION_DEPENDENCY] << std::endl;
+std::cout << "DEPENDENCY_TYPE() : table["<<Ports::Calcium_Ports::UNDEFINED_DEPENDENCY<<"] : "<< 
+  table[Ports::Calcium_Ports::UNDEFINED_DEPENDENCY] << std::endl;
+}
+
+
+CalciumTypes::DependencyType DEPENDENCY_TYPE::operator[]( const Ports::Calcium_Ports::DependencyType &c ) const
+{
+  map<Ports::Calcium_Ports::DependencyType,
+    CalciumTypes::DependencyType> &table = (map<Ports::Calcium_Ports::DependencyType,
+                                           CalciumTypes::DependencyType>&)*this ;
+
+std::cout << "DEPENDENCY_TYPE() : ::operator["<<c<<"]: " << table[c] << std::endl;
+
+  assert( table.find( (Ports::Calcium_Ports::DependencyType)c ) != table.end() ) ;
+  return table[ (Ports::Calcium_Ports::DependencyType)c ] ;
+}
+
+const DEPENDENCY_TYPE dependencyType ;
+
+
+
+
+INTERPOLATION_SCHEM::INTERPOLATION_SCHEM() : map<Ports::Calcium_Ports::InterpolationSchem,
+                                                CalciumTypes::InterpolationSchem > () 
+{
+  map<Ports::Calcium_Ports::InterpolationSchem, 
+    CalciumTypes::InterpolationSchem > &
+    table  = ( map<Ports::Calcium_Ports::InterpolationSchem, 
+              CalciumTypes::InterpolationSchem > & ) *this ;
+
+  table[Ports::Calcium_Ports::L0_SCHEM ] = CalciumTypes::L0_SCHEM ;
+  table[Ports::Calcium_Ports::L1_SCHEM ] = CalciumTypes::L1_SCHEM ;
+}
+
+
+CalciumTypes::InterpolationSchem INTERPOLATION_SCHEM::operator[]( const Ports::Calcium_Ports::InterpolationSchem &c ) const
+{
+  map<Ports::Calcium_Ports::InterpolationSchem,
+    CalciumTypes::InterpolationSchem> &table = 
+    (map<Ports::Calcium_Ports::InterpolationSchem,
+     CalciumTypes::InterpolationSchem>& ) *this ;
+
+  assert( table.find( (Ports::Calcium_Ports::InterpolationSchem)c ) != table.end() ) ;
+  return table[ (Ports::Calcium_Ports::InterpolationSchem)c ] ;
+}
+
+const INTERPOLATION_SCHEM interpolationSchem ;
+
+
+
+EXTRAPOLATION_SCHEM::EXTRAPOLATION_SCHEM() : map<Ports::Calcium_Ports::ExtrapolationSchem,
+                                                CalciumTypes::ExtrapolationSchem > () 
+{
+  map<Ports::Calcium_Ports::ExtrapolationSchem, 
+    CalciumTypes::ExtrapolationSchem > &
+    table  = ( map<Ports::Calcium_Ports::ExtrapolationSchem, 
+              CalciumTypes::ExtrapolationSchem > & ) *this ;
+
+  table[Ports::Calcium_Ports::E0_SCHEM ] = CalciumTypes::E0_SCHEM ;
+  table[Ports::Calcium_Ports::E1_SCHEM ] = CalciumTypes::E1_SCHEM ;
+  table[Ports::Calcium_Ports::UNDEFINED_EXTRA_SCHEM ] = CalciumTypes::UNDEFINED_EXTRA_SCHEM ;
+}
+
+
+CalciumTypes::ExtrapolationSchem EXTRAPOLATION_SCHEM::operator[]( const Ports::Calcium_Ports::ExtrapolationSchem &c ) const
+{
+  map<Ports::Calcium_Ports::ExtrapolationSchem,
+    CalciumTypes::ExtrapolationSchem> &table = 
+    (map<Ports::Calcium_Ports::ExtrapolationSchem,
+     CalciumTypes::ExtrapolationSchem>& ) *this ;
+
+  assert( table.find( (Ports::Calcium_Ports::ExtrapolationSchem)c ) != table.end() ) ;
+  return table[ (Ports::Calcium_Ports::ExtrapolationSchem)c ] ;
+}
+
+const EXTRAPOLATION_SCHEM extrapolationSchem ;
diff --git a/src/DSC/DSC_User/Datastream/Calcium/CorbaTypes2CalciumTypes.hxx b/src/DSC/DSC_User/Datastream/Calcium/CorbaTypes2CalciumTypes.hxx
new file mode 100644 (file)
index 0000000..c970186
--- /dev/null
@@ -0,0 +1,62 @@
+// Eric Fayolle - EDF R&D
+// Modified by : $LastChangedBy$
+// Date        : $LastChangedDate: 2007-03-01 13:40:26 +0100 (Thu, 01 Mar 2007) $
+// Id          : $Id$
+
+#ifndef _CORBATYPES_TO_CALCIUMTYPES_HXX_
+#define _CORBATYPES_TO_CALCIUMTYPES_HXX_
+
+#include "Calcium_Ports.hh"
+#include "CalciumTypes.hxx"
+
+#include <map>
+#include <cassert>
+
+
+class DATE_CAL_SCHEM : public std::map<Ports::Calcium_Ports::DateCalSchem,
+                                      CalciumTypes::DateCalSchem> 
+{
+public :
+
+  DATE_CAL_SCHEM();
+  CalciumTypes::DateCalSchem  operator[]( const Ports::Calcium_Ports::DateCalSchem &c ) const;
+};
+
+
+extern const DATE_CAL_SCHEM dateCalSchem ;
+
+class DEPENDENCY_TYPE : public std::map<Ports::Calcium_Ports::DependencyType,
+                                       CalciumTypes::DependencyType>
+{
+public :
+
+  DEPENDENCY_TYPE();
+  CalciumTypes::DependencyType  operator[]( const Ports::Calcium_Ports::DependencyType &c ) const;
+};
+
+extern const DEPENDENCY_TYPE dependencyType ;
+
+class INTERPOLATION_SCHEM : public std::map<Ports::Calcium_Ports::InterpolationSchem,
+                                           CalciumTypes::InterpolationSchem>
+{
+public :
+
+  INTERPOLATION_SCHEM();
+  CalciumTypes::InterpolationSchem  operator[]( const Ports::Calcium_Ports::InterpolationSchem &c ) const;
+} ;
+
+extern const INTERPOLATION_SCHEM interpolationSchem ;
+
+class EXTRAPOLATION_SCHEM : public std::map<Ports::Calcium_Ports::ExtrapolationSchem,
+                                           CalciumTypes::ExtrapolationSchem>
+{
+public :
+
+  EXTRAPOLATION_SCHEM();
+  CalciumTypes::ExtrapolationSchem  operator[]( const Ports::Calcium_Ports::ExtrapolationSchem &c ) const;
+} ;
+
+extern const EXTRAPOLATION_SCHEM extrapolationSchem ;
+
+
+#endif
index 69587cb2d2b217a9a769109ae1093ccc274cb6e1..2b8416bb37a49723870d1d5864f638e252f8eb53 100644 (file)
@@ -33,10 +33,13 @@ include $(top_srcdir)/salome_adm/unix/make_common_starter.am
 #
 # header files  
 salomeinclude_HEADERS = calcium_port_factory.hxx \
+                       CorbaTypes2CalciumTypes.hxx \
+                       CalciumTypes2CorbaTypes.hxx \
                        CalciumGenericProvidesPort.hxx \
                        calcium_uses_port.hxx \
                        CalciumGenericUsesPort.hxx \
-                       calcium_port_provides.hxx \
+                       calcium_provides_port.hxx \
+                       CalciumProvidesPort.hxx \
                        calcium_integer_port_uses.hxx \
                        calcium_real_port_uses.hxx \
                        calcium_double_port_uses.hxx \
@@ -82,9 +85,12 @@ noinst_LTLIBRARIES = libSalomeCalcium.la
 
 libSalomeCalcium_la_SOURCES  = calcium_port_factory.cxx \
                               calcium_uses_port.cxx    \
+                              calcium_provides_port.cxx\
                               calcium_repository_types.cxx \
                               CalciumCouplingPolicy.cxx \
-                              calcium_destructors_port_provides.cxx \
+                              CorbaTypes2CalciumTypes.cxx \
+                              CalciumTypes2CorbaTypes.cxx \
+                              CalciumProvidesPort.cxx \
                               calcium_destructors_port_uses.cxx
 
 libSalomeCalcium_la_CXXFLAGS = $(COMMON_CPPFLAGS)
diff --git a/src/DSC/DSC_User/Datastream/Calcium/calcium_destructors_port_provides.cxx b/src/DSC/DSC_User/Datastream/Calcium/calcium_destructors_port_provides.cxx
deleted file mode 100644 (file)
index 841a210..0000000
+++ /dev/null
@@ -1,32 +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   : calcium_destructors_port_provides.cxx
-//  Author : Eric Fayolle (EDF)
-//  Module : KERNEL
-#include "calcium_port_provides.hxx"
-
-calcium_real_port_provides::~calcium_real_port_provides(void) {};
-calcium_double_port_provides::~calcium_double_port_provides(void) {};
-calcium_integer_port_provides::~calcium_integer_port_provides(void) {};
-calcium_logical_port_provides::~calcium_logical_port_provides(void) {};
-calcium_complex_port_provides::~calcium_complex_port_provides(void) {};
-calcium_string_port_provides::~calcium_string_port_provides(void) {};
index ccf076d3a230912ee612dc3b7aeaa15687f9a6da..a722cd966f25e21a6fff23da49055792266d797a 100644 (file)
@@ -34,7 +34,7 @@
 #include "provides_port.hxx"
 #include <string>
 
-#include "calcium_port_provides.hxx"
+#include "CalciumProvidesPort.hxx"
 
 #include "calcium_integer_port_uses.hxx"
 #include "calcium_real_port_uses.hxx"
diff --git a/src/DSC/DSC_User/Datastream/Calcium/calcium_port_provides.hxx b/src/DSC/DSC_User/Datastream/Calcium/calcium_port_provides.hxx
deleted file mode 100644 (file)
index 5c18fb0..0000000
+++ /dev/null
@@ -1,61 +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   : calcium_port_provides.hxx
-//  Author : Eric Fayolle (EDF)
-//  Module : KERNEL
-// Modified by : $LastChangedBy$
-// Date        : $LastChangedDate: 2007-03-01 13:40:26 +0100 (jeu, 01 mar 2007) $
-// Id          : $Id$
-
-#ifndef _CALCIUM_PORT_PROVIDES_HXX_
-#define _CALCIUM_PORT_PROVIDES_HXX_
-
-#include "Calcium_Ports.hh"
-#include "CalciumGenericProvidesPort.hxx"
-#include "CalciumCouplingPolicy.hxx"
-
-
-CALCIUM_GENERIC_PROVIDES_PORT(calcium_integer_port_provides,           \
-                             POA_Ports::Calcium_Ports::Calcium_Integer_Port, \
-                             seq_u_manipulation<Ports::Calcium_Ports::seq_long,CORBA::Long> ) \
-
-CALCIUM_GENERIC_PROVIDES_PORT(calcium_real_port_provides,              \
-                             POA_Ports::Calcium_Ports::Calcium_Real_Port, \
-                             seq_u_manipulation<Ports::Calcium_Ports::seq_float,CORBA::Float> ) \
-
-CALCIUM_GENERIC_PROVIDES_PORT(calcium_double_port_provides,            \
-                             POA_Ports::Calcium_Ports::Calcium_Double_Port, \
-                             seq_u_manipulation<Ports::Calcium_Ports::seq_double,CORBA::Double> ) \
-
-CALCIUM_GENERIC_PROVIDES_PORT(calcium_complex_port_provides,           \
-                             POA_Ports::Calcium_Ports::Calcium_Complex_Port, \
-                             seq_u_manipulation<Ports::Calcium_Ports::seq_float,CORBA::Float> ) \
-
-CALCIUM_GENERIC_PROVIDES_PORT(calcium_logical_port_provides,           \
-                             POA_Ports::Calcium_Ports::Calcium_Logical_Port, \
-                             seq_u_manipulation<Ports::Calcium_Ports::seq_boolean,CORBA::Boolean> ) \
-
-CALCIUM_GENERIC_PROVIDES_PORT(calcium_string_port_provides,            \
-                             POA_Ports::Calcium_Ports::Calcium_String_Port, \
-                             seq_u_manipulation<Ports::Calcium_Ports::seq_string,char *> ) \
-
-#endif
diff --git a/src/DSC/DSC_User/Datastream/Calcium/calcium_provides_port.cxx b/src/DSC/DSC_User/Datastream/Calcium/calcium_provides_port.cxx
new file mode 100644 (file)
index 0000000..6f34c26
--- /dev/null
@@ -0,0 +1,10 @@
+// Eric Fayolle - EDF R&D
+// Modified by : $LastChangedBy$
+// Date        : $LastChangedDate: 2007-02-28 15:26:32 +0100 (Wed, 28 Feb 2007) $
+// Id          : $Id$
+
+#include "calcium_provides_port.hxx"
+
+calcium_provides_port::calcium_provides_port() {}
+
+calcium_provides_port::~calcium_provides_port() {}
diff --git a/src/DSC/DSC_User/Datastream/Calcium/calcium_provides_port.hxx b/src/DSC/DSC_User/Datastream/Calcium/calcium_provides_port.hxx
new file mode 100644 (file)
index 0000000..52bf881
--- /dev/null
@@ -0,0 +1,48 @@
+// Eric Fayolle - EDF R&D
+// Modified by : $LastChangedBy$
+// Date        : $LastChangedDate: 2007-02-28 15:26:32 +0100 (Wed, 28 Feb 2007) $
+// Id          : $Id$
+
+#ifndef _CALCIUM_PROVIDES_PORT_HXX_
+#define _CALCIUM_PROVIDES_PORT_HXX_
+
+#include "provides_port.hxx"
+#include "CalciumTypes.hxx"
+
+class calcium_provides_port : public provides_port
+{
+public :
+
+  typedef CalciumTypes::DependencyType       DependencyType;
+  typedef CalciumTypes::DateCalSchem         DateCalSchem;
+  typedef CalciumTypes::InterpolationSchem   InterpolationSchem;
+  typedef CalciumTypes::ExtrapolationSchem   ExtrapolationSchem;
+  typedef CalciumTypes::DisconnectDirective  DisconnectDirective;  
+
+  calcium_provides_port();
+  virtual ~calcium_provides_port();
+
+  virtual void           setDependencyType (DependencyType dependencyType) =0;
+  virtual DependencyType getDependencyType () const =0;
+  virtual  void   setStorageLevel   (size_t storageLevel) =0;
+  virtual  size_t getStorageLevel   () const =0;
+
+  virtual  void         setDateCalSchem   (DateCalSchem   dateCalSchem) =0;
+  virtual  DateCalSchem getDateCalSchem () const =0;
+  
+  virtual  void   setAlpha(double alpha) =0;
+  virtual  double getAlpha() const  =0;
+
+  virtual  void   setDeltaT(double deltaT ) =0;
+  virtual  double getDeltaT() const  =0;
+
+  virtual  void setInterpolationSchem (InterpolationSchem interpolationSchem) =0;
+  virtual  void setExtrapolationSchem (ExtrapolationSchem extrapolationSchem) =0;
+  virtual  InterpolationSchem getInterpolationSchem () const  =0;
+  virtual  ExtrapolationSchem getExtrapolationSchem () const  =0;
+
+};
+
+#endif
+
index d09f9053bb29d1efda28e2730cff3b4d82e96e1b..8428f25ee09d6df490015834112790028ce0fea1 100644 (file)
@@ -28,7 +28,7 @@
 
 #include "CalciumCouplingPolicy.hxx"
 
-#include "calcium_port_provides.hxx"
+#include "CalciumProvidesPort.hxx"
 #include "DatastreamException.hxx"
 
 using namespace CalciumTypes;
index 8becd65c3973f570a4b0c41105654888a0a4edd3..bab981f0386d4879f3e9dc397aa48a25fc00b84b 100644 (file)
@@ -281,7 +281,7 @@ void GenericPort<DataManipulator, COUPLING_POLICY>::put(CorbaInDataType dataPara
 // ( n'effectue pas de recopie de la donnée trouvée dans storedDatas )
 // ( L'utilisateur devra être attentif à la politique de gestion de l'historique
 //   spécifique au mode de couplage car il peut y avoir une suppression potentielle 
-//   d'une donnée utilisée directement au code utilisateur )
+//   d'une donnée utilisée directement dans le code utilisateur )
 //  Le code doit prendre connaissance du transfert de propriété ou non des données
 //  auprès du mode de couplage choisi. 
 template < typename DataManipulator, typename COUPLING_POLICY >
@@ -416,8 +416,10 @@ GenericPort<DataManipulator, COUPLING_POLICY>::get(TimeType time,
   storedDatas_mutex.unlock();
   std::cout << "-------- Get : MARK 13 ------------------" << std::endl;
 
-  // dataToTransmit est positionné par la méthode put
-  // La propriété de la données est transmise à l'utilisateur
+  // La propriété de la données N'EST PAS transmise à l'utilisateur en mode CALCIUM
+  // Si l'utilisateur supprime la donnée, storedDataIds devient incohérent
+  // c'est eraseDataId qui choisi ou non de supprimer la donnée
+  // Du coup interaction potentielle entre le 0 copy et gestion des niveaux 
   return dataToTransmit; 
 
 }
diff --git a/src/DSC/DSC_User/Datastream/GenericProvidesPort.hxx b/src/DSC/DSC_User/Datastream/GenericProvidesPort.hxx
new file mode 100644 (file)
index 0000000..16da268
--- /dev/null
@@ -0,0 +1,26 @@
+// Eric Fayolle - EDF R&D
+// Modified by : $LastChangedBy$
+// Date        : $LastChangedDate: 2007-02-28 15:26:32 +0100 (Wed, 28 Feb 2007) $
+// Id          : $Id$
+
+#ifndef _GENERIC_PROVIDES_PORT_HXX_
+#define _GENERIC_PROVIDES_PORT_HXX_
+
+#include "provides_port.hxx"
+#include "GenericPort.hxx"
+
+
+template <typename DataManipulator, typename CouplingPolicy, typename ProvidesPort=provides_port> 
+class GenericProvidesPort : public ProvidesPort,
+                           public GenericPort< DataManipulator , CouplingPolicy > {
+public :
+  // Type de données manipulés 
+  typedef typename DataManipulator::Type         DataType;
+  typedef typename DataManipulator::CorbaInType  CorbaInDataType;
+
+  virtual ~GenericProvidesPort() {};
+
+};
+
+
+#endif
index a85721af6e8f9eb058f30c2ed05a08438b6af9f6..95d23f2807211397b51e488bfe88b83ccfb1c8e4 100644 (file)
@@ -43,7 +43,7 @@
 //ex : GENERATE_USES_PORT(Ports::Data_Short_Port,data_short_port);
 
 template <typename DataManipulator, typename CorbaPortType, char * repositoryName, typename UsesPort=uses_port> 
-class GenericUsesPort : public virtual UsesPort
+class GenericUsesPort : public UsesPort
 {
 public :
   // Type de données manipulés 
@@ -88,12 +88,15 @@ GenericUsesPort< DataManipulator,CorbaPortType, repositoryName, UsesPort  >::set
     size_t n = _my_ports->length()+1;
     _my_ports->length(n);
     (*_my_ports)[n]=CorbaPortType::_narrow(port);
+    return true;
   }  else {
     // Vérifier si port is_nil
     _my_ports = new Engines::DSC::uses_port();
     _my_ports->length(1);
     (*_my_ports)[0]=CorbaPortType::_narrow(port);
+    return true;
   }
+  return false;
 }
 
 template <typename DataManipulator,typename CorbaPortType, char * repositoryName, typename UsesPort > 
index 1dcd8398a1b0684754e2e0ad41fda5ad5fe0f09e..9aa857d5ef6d271ce7b4b432ab0c0ef93e10174a 100644 (file)
@@ -34,6 +34,7 @@ SUBDIRS = Palm Calcium
 #
 # header files  
 salomeinclude_HEADERS = GenericPort.hxx \
+                       GenericProvidesPort.hxx \
                        GenericUsesPort.hxx \
                        DataIdFilter.hxx \
                        CorbaTypeManipulator.hxx \
index 07df31b5226a936819591797a75bf7ada12b16aa..7ea4dca889e2407c58d52a655a810dd79170f249 100644 (file)
@@ -70,7 +70,8 @@ COMMON_LIBS =
 #
 lib_LTLIBRARIES = libSalomeDSCSuperv.la 
 
-libSalomeDSCSuperv_la_SOURCES  = uses_port.cxx \
+libSalomeDSCSuperv_la_SOURCES  = base_port.cxx \
+                                uses_port.cxx \
                                 provides_port.cxx \
                                 Superv_Component_i.cxx
 
index f7ea45fa8b1b42349a5fa38d353b290c05e2f86a..37a34640e6ba76658f6a52855e754a02477b7750 100644 (file)
@@ -67,7 +67,7 @@ public:
   virtual ~Superv_Component_i();
 
   // Exceptions declarations.
-  // There are also declared on the Superv_Component_i.cxx to avoid problems
+  // There are defined on the Superv_Component_i.cxx to avoid problems
   // from dlopen.
   DSC_EXCEPTION(BadFabType);
   DSC_EXCEPTION(BadType);
diff --git a/src/DSC/DSC_User/base_port.cxx b/src/DSC/DSC_User/base_port.cxx
new file mode 100644 (file)
index 0000000..a944500
--- /dev/null
@@ -0,0 +1,18 @@
+#include "base_port.hxx"
+
+
+base_port::base_port() 
+{
+  default_properties = new PortProperties_i();
+}
+
+base_port::~base_port() 
+{
+  delete default_properties;
+}
+
+Ports::PortProperties_ptr 
+base_port::get_port_properties() 
+{
+  return default_properties->_this();
+}
index c3d7bb6c3c9984b306b14f6c110c3a6a903f6eef..eed215e04698217585af2f607b0a003757073d2b 100644 (file)
 #ifndef _PORT_HXX_
 #define _PORT_HXX_
 
-/*! \class base_port
- *  \brief This class is the base class of DSC_User's C++ ports.
- *
- *  This class is the base class of DSC_User's C++ ports.
+#include "PortProperties_i.hxx"
+/*
+ *  This class is base class for all DSC_User provides and uses port.
+ *  It provides a default property object for the port.
  */
 class base_port
 {
 public :
-  virtual ~base_port() {};
+  base_port();
+  virtual ~base_port();
+
+  /*!
+   * This is used to get the property object of the port.
+   *
+   * \return property's CORBA reference.
+   */
+  virtual Ports::PortProperties_ptr get_port_properties();
+
+protected :
+  PortProperties_i * default_properties;
 };
 
 #endif
index 701b7b07e86930401f81cd0a80c553998e53a29f..a09f5cf712e2bd76c80d3b36cecb0c54341f9314 100644 (file)
 #include "provides_port.hxx"
 
 provides_port::provides_port() 
-{
-  default_properties = new PortProperties_i();
-}
+{}
 
 provides_port::~provides_port() 
-{
-  delete default_properties;
-}
-
-Ports::PortProperties_ptr 
-provides_port::get_port_properties() 
-{
-  return default_properties->_this();
-}
+{}
index 0647f9aebbda4ef592ca1539dc797dcb22c6c861..a0aeacd0b6ca9600ec09e173dc959530fcfb8079 100644 (file)
 #include "base_port.hxx"
 #include "SALOME_Ports.hh"
 #include "DSC_Engines.hh"
-#include "PortProperties_i.hxx"
 
 /*! \class provides_port
  *  \brief This class implements a DSC_User provides C++ port.
  *
  *  This class is base class for all DSC_User provides port.
  *  It's an abstract class.
- *  It provides a default property object for the port.
  */
 class provides_port : public base_port
 {
@@ -61,15 +59,6 @@ class provides_port : public base_port
     virtual void provides_port_changed(int connection_nbr,
                                       const Engines::DSC::Message message) {}
 
-    /*!
-     * This is used to get the property object of the port.
-     *
-     * \return property's CORBA reference.
-     */
-    virtual Ports::PortProperties_ptr get_port_properties();
-
-  private :
-    PortProperties_i * default_properties;
 };
 
 #endif
index b110e48d8795112d99ed5431c50e3b20204206c6..2a904b2ff12451b9931d2cb26bd1900b9e00c487 100644 (file)
 // 
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-//
-//
-//  File   : uses_port.cxx
-//  Author : André RIBES (EDF)
-//  Module : KERNEL
 
 #include "uses_port.hxx"
 
 uses_port::uses_port() 
-{
-  default_properties = new PortProperties_i();
-}
+{}
 
 uses_port::~uses_port() 
-{
-  delete default_properties;
-}
+{}
 
-Ports::PortProperties_ptr 
-uses_port::get_port_properties() 
-{
-  return default_properties->_this();
-}
index 93a2ad7577450910ffd6ba882f1bdcea765d5d09..93307b3b189d89d93d26cbb6b12b7ab53b6ecddf 100644 (file)
 #include "base_port.hxx"
 #include "SALOME_Ports.hh"
 #include "DSC_Engines.hh"
-#include "PortProperties_i.hxx"
 
 /*! \class provides_port
  *  \brief This class implements a DSC_User uses C++ port.
  *
  *  This class is base class for all DSC_User uses port.
  *  It's an abstract class.
- *  It provides a default property object for the port.
  *
  *  Contrary to DSC_Basic layer, a uses port as an implementation
  *  provided by this class which permits to manipulate the uses port.
@@ -64,7 +62,7 @@ class uses_port : public base_port
     virtual bool set_port(Ports::Port_ptr port) = 0;
 
     /*!
-     * This is method is the uses port's callback to be aware of
+     * This method is the uses port's callback to be aware of
      * connections states.
      * It's an abstract method. The uses port uses this method
      * to manage the sequence of the DSC_Basic uses port.
@@ -75,15 +73,6 @@ class uses_port : public base_port
     virtual void uses_port_changed(Engines::DSC::uses_port * new_uses_port,
                                   const Engines::DSC::Message message) = 0;
 
-    /*!
-     * This is used to get the property object of the port.
-     *
-     * \return property's CORBA reference.
-     */
-    virtual Ports::PortProperties_ptr get_port_properties();
-
-  private :
-    PortProperties_i * default_properties;
 };
 
 #endif