_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
}
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;
std::cout << "-------- CalciumCouplingPolicy::disconnect CP_ARRET ------------------" << std::endl;
_disconnectDirective = CalciumTypes::STOP;
}
+
+// if (waitingForAnyDataId || waitingForConvenientDataId);
+// cond_instance.signal();
+
}
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
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.
#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
--- /dev/null
+#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)
--- /dev/null
+// 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
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;
--- /dev/null
+// 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 ;
--- /dev/null
+// 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
--- /dev/null
+// 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 ;
--- /dev/null
+// 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
#
# 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 \
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)
+++ /dev/null
-// 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) {};
#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"
+++ /dev/null
-// 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
--- /dev/null
+// 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() {}
--- /dev/null
+// 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
+
#include "CalciumCouplingPolicy.hxx"
-#include "calcium_port_provides.hxx"
+#include "CalciumProvidesPort.hxx"
#include "DatastreamException.hxx"
using namespace CalciumTypes;
// ( 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 >
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;
}
--- /dev/null
+// 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
//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
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 >
#
# header files
salomeinclude_HEADERS = GenericPort.hxx \
+ GenericProvidesPort.hxx \
GenericUsesPort.hxx \
DataIdFilter.hxx \
CorbaTypeManipulator.hxx \
#
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
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);
--- /dev/null
+#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();
+}
#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
#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();
-}
+{}
#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
{
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
//
// 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();
-}
#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.
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.
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