SALOME_ComponentPaCO_Engines_Container_client.cc \
SALOME_ComponentPaCO_Engines_Component_server.cc \
SALOME_ComponentPaCO_Engines_Component_client.cc \
+ SALOME_ComponentPaCO_Engines_fileTransfer_server.cc \
+ SALOME_ComponentPaCO_Engines_fileTransfer_client.cc \
+ SALOME_ComponentPaCO_Engines_Salome_file_server.cc \
+ SALOME_ComponentPaCO_Engines_Salome_file_client.cc \
+ SALOME_ComponentPaCO_Engines_Parallel_Salome_file_server.cc \
+ SALOME_ComponentPaCO_Engines_Parallel_Salome_file_client.cc \
SALOME_PortsPaCO_Ports_Port_server.cc \
SALOME_PortsPaCO_Ports_Port_client.cc \
DSC_EnginesPaCO_Engines_DSC_server.cc \
SALOME_ComponentPaCO_Engines_Container_client.h \
SALOME_ComponentPaCO_Engines_Component_server.h \
SALOME_ComponentPaCO_Engines_Component_client.h \
+ SALOME_ComponentPaCO_Engines_fileTransfer_server.h \
+ SALOME_ComponentPaCO_Engines_fileTransfer_client.h \
+ SALOME_ComponentPaCO_Engines_Salome_file_server.h \
+ SALOME_ComponentPaCO_Engines_Salome_file_client.h \
+ SALOME_ComponentPaCO_Engines_Parallel_Salome_file_server.h \
+ SALOME_ComponentPaCO_Engines_Parallel_Salome_file_client.h \
SALOME_ExceptionPaCO.h \
SALOME_ComponentPaCO.h \
SALOME_Exception.h \
string getRef(in string machine);
};
+ /*! \brief Interface of a Parallel_Salome_file
+ This interface is used by parallel components and containers.
+ It adds methods to enable to choose on which node of the parallel component the file has to
+ be received.
+ */
+ interface Parallel_Salome_file : Engines::Salome_file {
+
+ /*!
+ Add a Local file to the Salome_file.
+
+ \param file_name name of the file with the path.
+ \param node the number of the node where the file is.
+
+ \exception raised if the file is already added into the Salome_file.
+ */
+ void setParallelLocalFile(in string comp_file_name, in long node) raises (SALOME::SALOME_Exception);
+
+ /*!
+ Add a Distributed file to the Salome_file.
+
+ \param comp_file_name name of the file with the path.
+
+ \exception raised if the file is already added into the Salome_file.
+ */
+ void setParallelDistributedFile(in string comp_file_name, in long node) raises (SALOME::SALOME_Exception);
+
+ /*!
+ This method update the state of the Parallel_Salome_file. Thus, each node
+ of the Parallel_Salome_file has the same state.
+
+ \param new_state the new state of the Parallel_Salome_file.
+ */
+ void updateState(in Engines::SfState new_state);
+ };
} ;
#endif
<Type>distributed</Type>
</Method>
</Interface>
+ <Interface>
+ <Name>Parallel_Salome_file</Name>
+ <Method>
+ <Name>setParallelLocalFile</Name>
+ <Type>distributed</Type>
+ </Method>
+ <Method>
+ <Name>setParallelDistributedFile</Name>
+ <Type>distributed</Type>
+ </Method>
+ </Interface>
</Module>
</GridCCM_Interface_description>
pthread_mutex_init(short_mutex, NULL);
short_condition = new pthread_cond_t();
pthread_cond_init(short_condition, NULL);
+ short_termine_cp = true;
+ short_mutex_cp = new pthread_mutex_t();
+ pthread_mutex_init(short_mutex_cp, NULL);
+ short_condition_cp = new pthread_cond_t();
+ pthread_cond_init(short_condition_cp, NULL);
}
data_short_port_provides::~data_short_port_provides() {
delete short_mutex;
pthread_cond_destroy(short_condition);
delete short_condition;
+ pthread_mutex_destroy(short_mutex_cp);
+ delete short_mutex_cp;
+ pthread_cond_destroy(short_condition_cp);
+ delete short_condition_cp;
}
void
data_short_port_provides::put(CORBA::Short data) {
+ // On attend que le get soit fait
+ pthread_mutex_lock(short_mutex_cp);
+ while (short_termine_cp == false)
+ {
+ pthread_cond_wait(short_condition_cp, short_mutex_cp);
+ }
+ short_termine_cp = false;
+ pthread_mutex_unlock(short_mutex_cp);
+
pthread_mutex_lock(short_mutex);
_val = data;
short_termine = true;
CORBA::Short
data_short_port_provides::get() {
+ CORBA::Short result;
pthread_mutex_lock(short_mutex);
while (short_termine == false)
{
pthread_cond_wait(short_condition, short_mutex);
}
+ result = _val;
short_termine = false;
pthread_mutex_unlock(short_mutex);
- return _val;
+
+ // On indique que l'on a copie la valeur
+ pthread_mutex_lock(short_mutex_cp);
+ short_termine_cp = true;
+ pthread_cond_signal(short_condition_cp);
+ pthread_mutex_unlock(short_mutex_cp);
+ return result;
}
Ports::Port_ptr
pthread_mutex_t * short_mutex;
pthread_cond_t * short_condition;
bool short_termine;
+ pthread_mutex_t * short_mutex_cp;
+ pthread_cond_t * short_condition_cp;
+ bool short_termine_cp;
};