FOREACH(version 1_35 1_38)
SET(LIB_NAMES ${LIB_NAMES} libboost_${name}-vc90-mt${EXTENSION}-${version})
ENDFOREACH(version 1_35 1_38)
- FIND_LIBRARY(BOOST_LIB_${name} NAMES ${LIB_NAMES} PATHS ${BOOST_LIB_PATHS})
+ FIND_LIBRARY(BOOST_LIB_${name} NAMES ${LIB_NAMES} PATHS ${BOOST_LIB_PATHS} ${BOOST_FIND_PATHS_OPTION})
ELSE(WINDOWS)
- FIND_LIBRARY(BOOST_LIB_${name} boost_${name} PATHS ${BOOST_LIB_PATHS})
+ FIND_LIBRARY(BOOST_LIB_${name} boost_${name} PATHS ${BOOST_LIB_PATHS} ${BOOST_FIND_PATHS_OPTION})
ENDIF(WINDOWS)
IF(NOT BOOST_LIB_${name})
SET(BOOST_STATUS 0)
IF(HDF5_ROOT_USER)
SET(HDF5_INCLUDES -I${HDF5_INCLUDE_DIR})
ENDIF(HDF5_ROOT_USER)
- SET(HDF5_INCLUDES -D_HDF5USEDLL_ ${HDF5_INCLUDES})
+ SET(HDF5_INCLUDES -DH5_USE_16_API -D_HDF5USEDLL_ ${HDF5_INCLUDES})
MESSAGE(STATUS "${HDF5_INCLUDE_TO_FIND} found in ${HDF5_INCLUDE_DIR}")
ELSE(HDF5_INCLUDE_DIR)
SET(HDF5_STATUS 0)
SET(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE} CACHE STRING "compilation types" FORCE)
ELSE(WINDOWS)
IF(CMAKE_BUILD_TYPE STREQUAL Release)
- SET(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG")
- SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
+ SET(CMAKE_C_FLAGS_RELEASE "-O1 -DNDEBUG")
+ SET(CMAKE_CXX_FLAGS_RELEASE "-O1 -DNDEBUG")
ENDIF(CMAKE_BUILD_TYPE STREQUAL Release)
ENDIF(WINDOWS)
ENDIF(CMAKE_BUILD_TYPE)
newlines.append("""
SET(SALOME_KERNEL ON)
SET(HAS_GUI ON)
+ SET(WITH_QT4 ON)
""")
pass
# --
COMMAND ${OMNIORB_IDL} ${flags} ${input}
MAIN_DEPENDENCY ${input}
)
+ ''')
+ newlines.append('''
install(FILES ${input} DESTINATION idl/salome)
- SET(IDL_HEADER ${CMAKE_CURRENT_BINARY_DIR}/${base}.hh)
- install(FILES ${IDL_HEADER} DESTINATION include/salome)
+ ''')
+ if self.module not in ["pyhello"]:
+ newlines.append('''
+ SET(IDL_HEADER ${CMAKE_CURRENT_BINARY_DIR}/${base}.hh)
+ install(FILES ${IDL_HEADER} DESTINATION include/salome)
+ ''')
+ pass
+ newlines.append('''
INSTALL(CODE "SET(IDL_FILE ${input})")
INSTALL(CODE "SET(DIR lib/python${PYTHON_VERSION}/site-packages/salome)")
INSTALL(CODE "SET(CMAKE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})")
ELSE(SWIG_SOURCES MATCHES ";")
SET(SWIG_SOURCES_FIRST "${SWIG_SOURCES}")
ENDIF(SWIG_SOURCES MATCHES ";")
+ SET(flags)
+ FOREACH(f ${SWIG_FLAGS} ${MY_SWIG_FLAGS})
+ SET(test ON)
+ IF(flags)
+ LIST(FIND flags ${f} index)
+ IF(NOT index EQUAL -1)
+ SET(test OFF)
+ ENDIF(NOT index EQUAL -1)
+ ENDIF(flags)
+ IF(test)
+ SET(flags ${flags} ${f})
+ ENDIF(test)
+ ENDFOREACH(f ${SWIG_FLAGS} ${MY_SWIG_FLAGS})
ADD_CUSTOM_COMMAND(
OUTPUT ${build_srcs}
- COMMAND ${SWIG_EXECUTABLE} ${SWIG_FLAGS} ${MY_SWIG_FLAGS} -o ${build_srcs} ${CMAKE_CURRENT_SOURCE_DIR}/${SWIG_SOURCES_FIRST}
+ COMMAND ${SWIG_EXECUTABLE} ${flags} -o ${build_srcs} ${CMAKE_CURRENT_SOURCE_DIR}/${SWIG_SOURCES_FIRST}
MAIN_DEPENDENCY ${SWIG_SOURCES}
)
''')
return;
else
{
- int ret;
- ret = pthread_mutex_lock(&_listMutex); // acquire lock, an check again
- if (std::find(_objList.begin(), _objList.end(), anObject)
- != _objList.end())
- {
- DEVTRACE("PROTECTED_DELETE::deleteInstance1 " << anObject);
- delete anObject;
- DEVTRACE("PROTECTED_DELETE::deleteInstance2 " << &_objList);
- _objList.remove(anObject);
- }
- ret = pthread_mutex_unlock(&_listMutex); // release lock
+ int ret;
+ ret = pthread_mutex_lock(&_listMutex); // acquire lock, an check again
+ if (std::find(_objList.begin(), _objList.end(), anObject)
+ != _objList.end())
+ {
+ DEVTRACE("PROTECTED_DELETE::deleteInstance1 " << anObject);
+ delete anObject;
+ DEVTRACE("PROTECTED_DELETE::deleteInstance2 " << &_objList);
+ _objList.remove(anObject);
+ }
+ ret = pthread_mutex_unlock(&_listMutex); // release lock
}
}
{
if (Make_ATEXIT && !atExitSingletonDone)
{
- DEVTRACE("atExitSingleton(" << Make_ATEXIT << ")");
- assert(GENERIC_DESTRUCTOR::Destructors == 0);
- GENERIC_DESTRUCTOR::Destructors = new std::list<GENERIC_DESTRUCTOR*>;
- int cr = atexit(HouseKeeping);
- assert(cr == 0);
- atExitSingletonDone = true;
+ DEVTRACE("atExitSingleton(" << Make_ATEXIT << ")");
+ assert(GENERIC_DESTRUCTOR::Destructors == 0);
+ GENERIC_DESTRUCTOR::Destructors = new std::list<GENERIC_DESTRUCTOR*>;
+ int cr = atexit(HouseKeeping);
+ assert(cr == 0);
+ atExitSingletonDone = true;
}
}
if(GENERIC_DESTRUCTOR::Destructors->size())
{
std::list<GENERIC_DESTRUCTOR*>::iterator it =
- GENERIC_DESTRUCTOR::Destructors->end();
+ GENERIC_DESTRUCTOR::Destructors->end();
do
- {
- it-- ;
- GENERIC_DESTRUCTOR* ptr = *it ;
- DEVTRACE("HouseKeeping() " << typeid(ptr).name());
- (*ptr)();
- delete ptr ;
- }
+ {
+ it-- ;
+ GENERIC_DESTRUCTOR* ptr = *it ;
+ DEVTRACE("HouseKeeping() " << typeid(ptr).name());
+ (*ptr)();
+ delete ptr ;
+ }
while (it != GENERIC_DESTRUCTOR::Destructors->begin()) ;
DEVTRACE("HouseKeeping() end list ");
const int GENERIC_DESTRUCTOR::Add(GENERIC_DESTRUCTOR &anObject)
{
DEVTRACE("GENERIC_DESTRUCTOR::Add("<<typeid(anObject).name()<<") "
- << &anObject);
+ << &anObject);
if (!atExitSingletonDone)
{
HouseKeeper = atExitSingleton(true);
_objectPtr(&anObject)
{
DEVTRACE(" DESTRUCTOR_OF " << typeid(anObject).name()
- << " " << _objectPtr << " " << this );
+ << " " << _objectPtr << " " << this );
PROTECTED_DELETE::addObj(_objectPtr);
assert(GENERIC_DESTRUCTOR::Add(*this) >= 0);
}
{
if (_objectPtr)
{
- DEVTRACE("DESTRUCTOR_OF<>::operator() " << _objectPtr);
- if (_objectPtr) PROTECTED_DELETE::deleteInstance(_objectPtr);
- _objectPtr = NULL;
+ DEVTRACE("DESTRUCTOR_OF<>::operator() " << _objectPtr);
+ if (_objectPtr) PROTECTED_DELETE::deleteInstance(_objectPtr);
+ _objectPtr = NULL;
}
}
for(long i=0;i<size;i+=TAILLE_SPLIT)
{
if(size-i>TAILLE_SPLIT)
- n=TAILLE_SPLIT;
+ n=TAILLE_SPLIT;
else
- n=size-i;
+ n=size-i;
TSeqCorba seq=_mySender->sendPart(i,n);
T *seqd=(T *)seq->get_buffer(0);
for(long j=0;j<n;j++)
- *iter++=*seqd++;
+ *iter++=*seqd++;
}
return ret;
}
for(long i=0;i<size;i+=TAILLE_SPLIT)
{
if(size-i>TAILLE_SPLIT)
- n=TAILLE_SPLIT;
+ n=TAILLE_SPLIT;
else
- n=size-i;
+ n=size-i;
TSeqCorba seq=_mySender->sendPart(i,n);
TCorba *seqd=seq->get_buffer(0);
for(long j=0;j<n;j++)
- *iter++=*seqd++;
+ *iter++=*seqd++;
}
return ret;
}
for(long i=0;i<size;i+=TAILLE_SPLIT)
{
if(size-i>TAILLE_SPLIT)
- n=TAILLE_SPLIT;
+ n=TAILLE_SPLIT;
else
- n=size-i;
+ n=size-i;
TSeqCorba seq=_mySender->sendPart(i,n);
TCorba *seqd=seq->get_buffer(0);
for(long j=0;j<n;j++)
else{
// Connect to service, get the inter-communicator server
// Attention MPI_Comm_connect est un appel collectif :
- // - Si lancement mpirun -c n -----> uniquement MPI_COMM_SELF fonctionne
- // - Si lancement client_server&client_server ----> MPI_COMM_WORLD fonctionne
+ // - Si lancement mpirun -c n -----> uniquement MPI_COMM_SELF fonctionne
+ // - Si lancement client_server&client_server ----> MPI_COMM_WORLD fonctionne
// TIMEOUT is inefficient since MPI_Comm_Connect doesn't return if we asked for
// a service that has been unpublished !
while( n < size*sizeof(T) ){
m = read(_clientSockfd, (char*)v+n, size*sizeof(T)-n);
if( m < 0 ){
- closeCom();
- delete [] v;
- SALOME::ExceptionStruct es;
- es.type = SALOME::COMM;
- es.text = "error read Socket exception";
- throw SALOME::SALOME_Exception(es);
+ closeCom();
+ delete [] v;
+ SALOME::ExceptionStruct es;
+ es.type = SALOME::COMM;
+ es.text = "error read Socket exception";
+ throw SALOME::SALOME_Exception(es);
}
n += m;
}
catch(SALOME::SALOME_Exception &ex){
if( ex.details.type == SALOME::COMM )
{
- _senderDestruc=false;
- cout << ex.details.text << endl;
- throw MultiCommException("Unknown sender protocol");
+ _senderDestruc=false;
+ cout << ex.details.text << endl;
+ throw MultiCommException("Unknown sender protocol");
}
else
throw ex;
catch(SALOME::SALOME_Exception &ex){
if( ex.details.type == SALOME::COMM )
{
- _senderDestruc=false;
- cout << ex.details.text << endl;
- throw MultiCommException("Unknown sender protocol");
+ _senderDestruc=false;
+ cout << ex.details.text << endl;
+ throw MultiCommException("Unknown sender protocol");
}
else
throw ex;
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr = INADDR_ANY;
bcopy((char *)server->h_addr,
- (char *)&serv_addr.sin_addr.s_addr,
- server->h_length);
+ (char *)&serv_addr.sin_addr.s_addr,
+ server->h_length);
serv_addr.sin_port = htons(port);
if( connect(_clientSockfd, (struct sockaddr *) & serv_addr, sizeof(struct sockaddr)) < 0 ){
catch(SALOME::SALOME_Exception &ex){
if( ex.details.type == SALOME::COMM )
{
- _senderDestruc=false;
- cout << ex.details.text << endl;
- throw MultiCommException("Unknown sender protocol");
+ _senderDestruc=false;
+ cout << ex.details.text << endl;
+ throw MultiCommException("Unknown sender protocol");
}
else
throw ex;
host = gethostbyname(s);
if (host != NULL)
inet_ntop(AF_INET, (struct in_addr *) *host->h_addr_list,
- t, INET_ADDRSTRLEN);
+ t, INET_ADDRSTRLEN);
}
return std::string(t);
}
*errorFlag = false;
while( n < *lgrTabToSend*sizeof(double) ){
- m = write(*clientSockfd, (char*)tabToSend+n, *lgrTabToSend*sizeof(double)-n);
- if( m < 0 ){
- if( *clientSockfd >= 0 ){
- ::close(*clientSockfd);
- *clientSockfd = -1;
- }
- if( *serverSockfd >= 0 ){
- ::close(*serverSockfd);
- *serverSockfd = -1;
- }
- *errorFlag = true;
- }
- n += m;
+ m = write(*clientSockfd, (char*)tabToSend+n, *lgrTabToSend*sizeof(double)-n);
+ if( m < 0 ){
+ if( *clientSockfd >= 0 ){
+ ::close(*clientSockfd);
+ *clientSockfd = -1;
+ }
+ if( *serverSockfd >= 0 ){
+ ::close(*serverSockfd);
+ *serverSockfd = -1;
+ }
+ *errorFlag = true;
+ }
+ n += m;
}
xdr_destroy( &xp );
*errorFlag = false;
while( n < *lgrTabToSend*sizeof(int) ){
- m = write(*clientSockfd, (char*)tabToSend+n, *lgrTabToSend*sizeof(int)-n);
- if( m < 0 ){
- if( *clientSockfd >= 0 ){
- ::close(*clientSockfd);
- *clientSockfd = -1;
- }
- if( *serverSockfd >= 0 ){
- ::close(*serverSockfd);
- *serverSockfd = -1;
- }
- *errorFlag = true;
- }
- n += m;
+ m = write(*clientSockfd, (char*)tabToSend+n, *lgrTabToSend*sizeof(int)-n);
+ if( m < 0 ){
+ if( *clientSockfd >= 0 ){
+ ::close(*clientSockfd);
+ *clientSockfd = -1;
+ }
+ if( *serverSockfd >= 0 ){
+ ::close(*serverSockfd);
+ *serverSockfd = -1;
+ }
+ *errorFlag = true;
+ }
+ n += m;
}
xdr_destroy( &xp );
/* Association of socket with a port */
if( ::bind(_serverSockfd, (struct sockaddr *) & serv_addr,
- sizeof(struct sockaddr)) < 0 ) {
+ sizeof(struct sockaddr)) < 0 ) {
closeCom();
es.type = SALOME::COMM;
es.text = "error bind Socket exception";
};
class COMMUNICATION_EXPORT SALOME_SenderDouble_i : public virtual POA_SALOME::SenderDouble,
- public virtual SALOME_Sender_i
+ public virtual SALOME_Sender_i
{
public:
SALOME_SenderDouble_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend=false);
};
class COMMUNICATION_EXPORT SALOME_SenderInt_i : public virtual POA_SALOME::SenderInt,
- public virtual SALOME_Sender_i
+ public virtual SALOME_Sender_i
{
public:
SALOME_SenderInt_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend=false);
/*! Servant class for CORBA sender for double* when no copy of array _tabToSend is required, that is to say double and CORBA::Double are binary equal.
*/
class COMMUNICATION_EXPORT SALOME_CorbaDoubleNCSender_i : public POA_SALOME::CorbaDoubleNCSender,
- public SALOME_SenderDouble_i
+ public SALOME_SenderDouble_i
{
public:
SALOME_CorbaDoubleNCSender_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend=false);
/*! Servant class for CORBA sender for double* when copy of array _tabToSend is required, that is to say double and CORBA::Double are NOT binary equal.
*/
class COMMUNICATION_EXPORT SALOME_CorbaDoubleCSender_i : public POA_SALOME::CorbaDoubleCSender,
- public SALOME_SenderDouble_i
+ public SALOME_SenderDouble_i
{
public:
SALOME_CorbaDoubleCSender_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend=false);
/*! Servant class for CORBA sender for int* when no copy of array _tabToSend is required, that is to say int and CORBA::Long are binary equal.
*/
class COMMUNICATION_EXPORT SALOME_CorbaLongNCSender_i : public POA_SALOME::CorbaLongNCSender,
- public SALOME_SenderInt_i
+ public SALOME_SenderInt_i
{
public:
SALOME_CorbaLongNCSender_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend=false);
/*! Servant class for CORBA sender for int* when copy of array _tabToSend is required, that is to say int and CORBA::Long are NOT binary equal.
*/
class COMMUNICATION_EXPORT SALOME_CorbaLongCSender_i : public POA_SALOME::CorbaLongCSender,
- public SALOME_SenderInt_i
+ public SALOME_SenderInt_i
{
public:
SALOME_CorbaLongCSender_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend=false);
/*! Servant class of sender using MPI2.
*/
class COMMUNICATION_EXPORT SALOME_MPISender_i : public virtual POA_SALOME::MPISender,
- public virtual SALOME_Sender_i
+ public virtual SALOME_Sender_i
{
private:
static unsigned long _tag1;
};
class COMMUNICATION_EXPORT SALOME_MPISenderDouble_i : public POA_SALOME::MPISenderDouble,
- public SALOME_SenderDouble_i,
- public SALOME_MPISender_i
+ public SALOME_SenderDouble_i,
+ public SALOME_MPISender_i
{
public:
SALOME_MPISenderDouble_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend=false);
};
class COMMUNICATION_EXPORT SALOME_MPISenderInt_i : public POA_SALOME::MPISenderInt,
- public SALOME_SenderInt_i,
- public SALOME_MPISender_i
+ public SALOME_SenderInt_i,
+ public SALOME_MPISender_i
{
public:
SALOME_MPISenderInt_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend=false);
/*! Servant class of sender using Sockets.
*/
class COMMUNICATION_EXPORT SALOME_SocketSender_i : public virtual POA_SALOME::SocketSender,
- public virtual SALOME_Sender_i
+ public virtual SALOME_Sender_i
{
private:
int _serverSockfd;
};
class COMMUNICATION_EXPORT SALOME_SocketSenderDouble_i : public POA_SALOME::SocketSenderDouble,
- public SALOME_SenderDouble_i,
- public SALOME_SocketSender_i
+ public SALOME_SenderDouble_i,
+ public SALOME_SocketSender_i
{
public:
SALOME_SocketSenderDouble_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend=false);
};
class COMMUNICATION_EXPORT SALOME_SocketSenderInt_i : public POA_SALOME::SocketSenderInt,
- public SALOME_SenderInt_i,
- public SALOME_SocketSender_i
+ public SALOME_SenderInt_i,
+ public SALOME_SocketSender_i
{
public:
SALOME_SocketSenderInt_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend=false);
#include "SenderFactory.hxx"
SALOME_Matrix_i::SALOME_Matrix_i(const SALOMEMultiComm& multiCommunicator,const double *tabToSend,int nbOfRow,int nbOfColumn,bool ownTabToSend):_tabToSend(tabToSend),
- _nbOfRow(nbOfRow),
- _nbOfColumn(nbOfColumn),
- _ownTabToSend(ownTabToSend),
- _type(multiCommunicator)
+ _nbOfRow(nbOfRow),
+ _nbOfColumn(nbOfColumn),
+ _ownTabToSend(ownTabToSend),
+ _type(multiCommunicator)
{
}
{
case SALOME::CORBA_:
{
- SALOME_CorbaDoubleSender * retc=new SALOME_CorbaDoubleSender(tab,lgr,ownTab);
- return retc->_this();
+ SALOME_CorbaDoubleSender * retc=new SALOME_CorbaDoubleSender(tab,lgr,ownTab);
+ return retc->_this();
}
#ifdef HAVE_MPI2
case SALOME::MPI_:
{
- SALOME_MPISenderDouble_i* retm=new SALOME_MPISenderDouble_i(tab,lgr,ownTab);
- return retm->_this();
+ SALOME_MPISenderDouble_i* retm=new SALOME_MPISenderDouble_i(tab,lgr,ownTab);
+ return retm->_this();
}
#endif
#ifdef HAVE_SOCKET
case SALOME::SOCKET_:
{
- SALOME_SocketSenderDouble_i* rets=new SALOME_SocketSenderDouble_i(tab,lgr,ownTab);
- return rets->_this();
+ SALOME_SocketSenderDouble_i* rets=new SALOME_SocketSenderDouble_i(tab,lgr,ownTab);
+ return rets->_this();
}
#endif
default:
{
- multiCommunicator.setProtocol(SALOME::CORBA_);
- MESSAGE("PROTOCOL CHANGED TO CORBA");
- SALOME_CorbaDoubleSender * retc=new SALOME_CorbaDoubleSender(tab,lgr,ownTab);
- return retc->_this();
+ multiCommunicator.setProtocol(SALOME::CORBA_);
+ MESSAGE("PROTOCOL CHANGED TO CORBA");
+ SALOME_CorbaDoubleSender * retc=new SALOME_CorbaDoubleSender(tab,lgr,ownTab);
+ return retc->_this();
}
// throw MultiCommException("Communication protocol not implemented");
}
{
case SALOME::CORBA_:
{
- SALOME_CorbaLongSender * retc=new SALOME_CorbaLongSender(tab,lgr,ownTab);
- return retc->_this();
+ SALOME_CorbaLongSender * retc=new SALOME_CorbaLongSender(tab,lgr,ownTab);
+ return retc->_this();
}
#ifdef HAVE_MPI2
case SALOME::MPI_:
{
- SALOME_MPISenderInt_i* retm=new SALOME_MPISenderInt_i(tab,lgr,ownTab);
- return retm->_this();
+ SALOME_MPISenderInt_i* retm=new SALOME_MPISenderInt_i(tab,lgr,ownTab);
+ return retm->_this();
}
#endif
#ifdef HAVE_SOCKET
case SALOME::SOCKET_:
{
- SALOME_SocketSenderInt_i* rets=new SALOME_SocketSenderInt_i(tab,lgr,ownTab);
- return rets->_this();
+ SALOME_SocketSenderInt_i* rets=new SALOME_SocketSenderInt_i(tab,lgr,ownTab);
+ return rets->_this();
}
#endif
default:
{
- multiCommunicator.setProtocol(SALOME::CORBA_);
- SALOME_CorbaLongSender * retc=new SALOME_CorbaLongSender(tab,lgr,ownTab);
- return retc->_this();
+ multiCommunicator.setProtocol(SALOME::CORBA_);
+ SALOME_CorbaLongSender * retc=new SALOME_CorbaLongSender(tab,lgr,ownTab);
+ return retc->_this();
}
// throw MultiCommException("Communication protocol not implemented");
}
//SCRUTE(_refcount_value());
_poa->deactivate_object(*_id);
//SCRUTE(_refcount_value());
- _remove_ref();
+ //_remove_ref(); // VSR: commented, since raises SIGSEGV because of double deactivate_object()
//SCRUTE(_refcount_value());
MESSAGE("Engines_Component_i::destroyed") ;
}
}
MESSAGE("[GiveContainer] Resource selected is: " << resource_selected);
+ _numInstanceMutex.lock();
+
// Step 5: get container in the naming service
Engines::ResourceDefinition_var resource_definition = _ResManager->GetResourceDefinition(resource_selected.c_str());
std::string hostname(resource_definition->name.in());
if (std::string(local_params.parallelLib.in()) != "")
{
INFOS("[GiveContainer] PaCO++ container are not currently available");
+ _numInstanceMutex.unlock();
return ret;
}
// Classic or Exe ?
if (CORBA::is_nil (Catalog))
{
INFOS("[GiveContainer] Module Catalog is not found -> cannot launch a container");
+ _numInstanceMutex.unlock();
return ret;
}
// Loop through component list
if(found)
{
INFOS("ContainerManager Error: you can't have 2 CEXE component in the same container" );
+ _numInstanceMutex.unlock();
return Engines::Container::_nil();
}
MESSAGE("[GiveContainer] Exe container found !: " << container_exe_tmp);
catch (ServiceUnreachable&)
{
INFOS("Caught exception: Naming Service Unreachable");
+ _numInstanceMutex.unlock();
return ret;
}
catch (...)
{
INFOS("Caught unknown exception.");
+ _numInstanceMutex.unlock();
return ret;
}
// launch container with a system call
int status=system(command.c_str());
+ _numInstanceMutex.unlock();
+
if (status == -1){
MESSAGE("SALOME_ContainerManager::StartContainer rsh failed (system command status -1)");
RmTmpFile(_TmpFileName); // command file can be removed here
std::string machinesFile(const int nbproc);
+ void machinesFile(const int nbproc);
+
// For PacO++ Parallel extension
typedef std::vector<std::string> actual_launch_machine_t;
std::string BuildCommandToLaunchParallelContainer(const std::string& exe_name,
}
else {
if(_current->_next) { //Next Brother
- _current = _current->_next;
+ _current = _current->_next;
}
else {
- if(_current->_father && _current->_father != _root) {
- DF_LabelNode *father = _current->_father;
- _current = father->_next;
- if(!_current) {
- while(father && father != _root) {
- father = father->_father;
- if(father->_next) break;
- }
- if(father == _root) father = NULL;
- if(father) _current = father->_next;
- else _current = NULL;
- }
- }
- else {
- _current = NULL; //We iterate the whole sub tree
- }
+ if(_current->_father && _current->_father != _root) {
+ DF_LabelNode *father = _current->_father;
+ _current = father->_next;
+ if(!_current) {
+ while(father && father != _root) {
+ father = father->_father;
+ if(father->_next) break;
+ }
+ if(father == _root) father = NULL;
+ if(father) _current = father->_next;
+ else _current = NULL;
+ }
+ }
+ else {
+ _current = NULL; //We iterate the whole sub tree
+ }
}
}
}
template<class Y>
explicit df_shared_ptr(Y * p)
{
- boost::shared_ptr<T>::reset(p);
+ boost::shared_ptr<T>::reset(p);
}
template<class Y>
df_shared_ptr(df_shared_ptr<Y> const & r):
boost::shared_ptr<T>(r,boost::detail::dynamic_cast_tag())
- {}
+ {}
template<class Y>
df_shared_ptr & operator=(df_shared_ptr<Y> const & r)
{
- df_shared_ptr<T>(r).swap(*this);
- return *this;
+ df_shared_ptr<T>(r).swap(*this);
+ return *this;
}
template<class Y> df_shared_ptr& operator()(Y * p) // Y must be complete
{
if(T* pt = dynamic_cast<T*>(p))
- boost::shared_ptr<T>::reset(pt);
+ boost::shared_ptr<T>::reset(pt);
else
- boost::throw_exception(std::bad_cast());
+ boost::throw_exception(std::bad_cast());
return *this;
}
vs.push_back(s.substr(0, pos));
s = s.substr(pos+1, s.size());
}
-
+
if(!s.empty() && s[0] != separator) vs.push_back(s);
return vs;
}
Engines::ConnectionManager::connectionId
ConnectionManager_i::connect(Engines::DSC_ptr uses_component,
- const char* uses_port_name,
- Engines::DSC_ptr provides_component,
- const char* provides_port_name)
+ const char* uses_port_name,
+ Engines::DSC_ptr provides_component,
+ const char* provides_port_name)
{
Ports::Port_var p_port = provides_component->get_provides_port(provides_port_name, false);
void
ConnectionManager_i::disconnect(Engines::ConnectionManager::connectionId id,
- Engines::DSC::Message message)
+ Engines::DSC::Message message)
{
int err=0;
// Connection id exist ?
try
{
infos->provides_component->disconnect_provides_port(infos->provides_port_name.c_str(),
- message);
+ message);
}
catch(CORBA::SystemException& ex)
{
try
{
infos->uses_component->disconnect_uses_port(infos->uses_port_name.c_str(),
- infos->provides_port,
- message);
+ infos->provides_port,
+ message);
}
catch(CORBA::SystemException& ex)
{
* \see Engines::ConnectionManager::connect
*/
Engines::ConnectionManager::connectionId connect(Engines::DSC_ptr uses_component,
- const char* uses_port_name,
- Engines::DSC_ptr provides_component,
- const char* provides_port_name);
+ const char* uses_port_name,
+ Engines::DSC_ptr provides_component,
+ const char* provides_port_name);
/*!
* CORBA method : releases a connection performed with
* \see Engines::ConnectionManager::disconnect
*/
void disconnect(Engines::ConnectionManager::connectionId id,
- Engines::DSC::Message message);
+ Engines::DSC::Message message);
/*!
Shutdown the ConnectionManager process.
};
typedef std::map<Engines::ConnectionManager::connectionId,
- connection_infos *> ids_type;
+ connection_infos *> ids_type;
typedef std::map<Engines::ConnectionManager::connectionId,
- connection_infos *>::iterator ids_it_type;
+ connection_infos *>::iterator ids_it_type;
ids_type ids;
ids_it_type ids_it;
* \param message contains informations about the modification of the port.
*/
virtual void provides_port_changed(const char* provides_port_name,
- int connection_nbr,
- const Engines::DSC::Message message) = 0;
+ int connection_nbr,
+ const Engines::DSC::Message message) = 0;
/*! \brief This method is used by the component when the number of connection
* on a uses port changes.
* \param message contains informations about the modification of the port.
*/
virtual void uses_port_changed(const char* uses_port_name,
- Engines::DSC::uses_port * new_uses_port,
- const Engines::DSC::Message message) = 0;
+ Engines::DSC::uses_port * new_uses_port,
+ const Engines::DSC::Message message) = 0;
};
#endif
Engines_DSC_i::
Engines_DSC_i(CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName,
- bool notif) : Engines_Component_i(orb,
- poa,
- contId,
- instanceName,
- interfaceName)
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId * contId,
+ const char *instanceName,
+ const char *interfaceName,
+ bool notif) : Engines_Component_i(orb,
+ poa,
+ contId,
+ instanceName,
+ interfaceName)
{
#ifdef MYDEBUG
std::cerr << "--Engines_DSC_i: MARK 1 --" << instanceName << "----" << std::endl;
*/
class DSC_BASIC_EXPORT Engines_DSC_i:
public Engines_Component_i, // keyword virtual is not use to be able to
- // call the right Engines_Component_i constructor.
- // If virtual is used, a derived class of Engines_DSC_i
- // will have to call the right Engines_Component_i constructor.
+ // call the right Engines_Component_i constructor.
+ // If virtual is used, a derived class of Engines_DSC_i
+ // will have to call the right Engines_Component_i constructor.
public virtual POA_Engines::DSC,
public Engines_DSC_interface
{
public:
Engines_DSC_i(CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName,
- bool notif = false);
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId * contId,
+ const char *instanceName,
+ const char *interfaceName,
+ bool notif = false);
Engines_DSC_i(CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- Engines::Container_ptr container,
- const char *instanceName,
- const char *interfaceName,
+ PortableServer::POA_ptr poa,
+ Engines::Container_ptr container,
+ const char *instanceName,
+ const char *interfaceName,
bool notif = false,
bool regist = true );
* \see Engines::DSC::add_provides_port
*/
virtual void add_provides_port(Ports::Port_ptr ref,
- const char* provides_port_name,
- Ports::PortProperties_ptr port_prop)
+ const char* provides_port_name,
+ Ports::PortProperties_ptr port_prop)
throw (Engines::DSC::PortAlreadyDefined,
- Engines::DSC::NilPort,
- Engines::DSC::BadProperty) {
+ Engines::DSC::NilPort,
+ Engines::DSC::BadProperty) {
Engines_DSC_interface::add_provides_port(ref,
- provides_port_name,
- port_prop);
+ provides_port_name,
+ port_prop);
}
/*!
* \see Engines::DSC::add_uses_port
*/
virtual void add_uses_port(const char* repository_id,
- const char* uses_port_name,
- Ports::PortProperties_ptr port_prop)
+ const char* uses_port_name,
+ Ports::PortProperties_ptr port_prop)
throw (Engines::DSC::PortAlreadyDefined,
- Engines::DSC::BadProperty) {
+ Engines::DSC::BadProperty) {
Engines_DSC_interface::add_uses_port(repository_id,
- uses_port_name,
- port_prop);
+ uses_port_name,
+ port_prop);
}
/*!
* \see Engines::DSC::get_provides_port
*/
virtual Ports::Port_ptr get_provides_port(const char* provides_port_name,
- const CORBA::Boolean connection_error)
+ const CORBA::Boolean connection_error)
throw (Engines::DSC::PortNotDefined,
- Engines::DSC::PortNotConnected) {
+ Engines::DSC::PortNotConnected) {
return Engines_DSC_interface::get_provides_port(provides_port_name,
- connection_error);
+ connection_error);
}
/*!
*/
virtual Engines::DSC::uses_port * get_uses_port(const char* uses_port_name)
throw (Engines::DSC::PortNotDefined,
- Engines::DSC::PortNotConnected) {
+ Engines::DSC::PortNotConnected) {
return Engines_DSC_interface::get_uses_port(uses_port_name);
}
* \see Engines::DSC::connect_uses_port
*/
virtual void connect_uses_port(const char* uses_port_name,
- Ports::Port_ptr provides_port_ref)
+ Ports::Port_ptr provides_port_ref)
throw (Engines::DSC::PortNotDefined,
- Engines::DSC::BadPortType,
- Engines::DSC::NilPort) {
+ Engines::DSC::BadPortType,
+ Engines::DSC::NilPort) {
Engines_DSC_interface::connect_uses_port(uses_port_name,
- provides_port_ref);
+ provides_port_ref);
}
/*!
* \see Engines::DSC::disconnect_provides_port
*/
virtual void disconnect_provides_port(const char* provides_port_name,
- const Engines::DSC::Message message)
+ const Engines::DSC::Message message)
throw (Engines::DSC::PortNotDefined,
- Engines::DSC::PortNotConnected) {
+ Engines::DSC::PortNotConnected) {
Engines_DSC_interface::disconnect_provides_port(provides_port_name,
- message);
+ message);
}
/*!
* \see Engines::DSC::disconnect_uses_port
*/
virtual void disconnect_uses_port(const char* uses_port_name,
- Ports::Port_ptr provides_port_ref,
- const Engines::DSC::Message message)
+ Ports::Port_ptr provides_port_ref,
+ const Engines::DSC::Message message)
throw (Engines::DSC::PortNotDefined,
- Engines::DSC::PortNotConnected,
- Engines::DSC::BadPortReference) {
+ Engines::DSC::PortNotConnected,
+ Engines::DSC::BadPortReference) {
Engines_DSC_interface::disconnect_uses_port(uses_port_name,
- provides_port_ref,
- message);
+ provides_port_ref,
+ message);
}
/*!
void
Engines_DSC_interface::add_provides_port(Ports::Port_ptr ref,
- const char* provides_port_name,
- Ports::PortProperties_ptr port_prop)
+ const char* provides_port_name,
+ Ports::PortProperties_ptr port_prop)
throw (Engines::DSC::PortAlreadyDefined,
Engines::DSC::NilPort,
Engines::DSC::BadProperty)
void
Engines_DSC_interface::add_uses_port(const char* repository_id,
- const char* uses_port_name,
- Ports::PortProperties_ptr port_prop)
+ const char* uses_port_name,
+ Ports::PortProperties_ptr port_prop)
throw (Engines::DSC::PortAlreadyDefined,
Engines::DSC::BadProperty)
{
Ports::Port_ptr
Engines_DSC_interface::get_provides_port(const char* provides_port_name,
- const CORBA::Boolean connection_error)
+ const CORBA::Boolean connection_error)
throw (Engines::DSC::PortNotDefined,
- Engines::DSC::PortNotConnected,
- Engines::DSC::BadPortType)
+ Engines::DSC::PortNotConnected,
+ Engines::DSC::BadPortType)
{
// Method arg test
assert(provides_port_name);
Engines::DSC::uses_port *
Engines_DSC_interface::get_uses_port(const char* uses_port_name)
throw (Engines::DSC::PortNotDefined,
- Engines::DSC::PortNotConnected,
- Engines::DSC::BadPortType)
+ Engines::DSC::PortNotConnected,
+ Engines::DSC::BadPortType)
{
// Method arg test
assert(uses_port_name);
my_ports[provides_port_name]->connection_nbr += 1;
// User code is informed
provides_port_changed(provides_port_name,
- my_ports[provides_port_name]->connection_nbr,
- Engines::DSC::AddingConnection
- );
+ my_ports[provides_port_name]->connection_nbr,
+ Engines::DSC::AddingConnection
+ );
}
void
Engines_DSC_interface::connect_uses_port(const char* uses_port_name,
- Ports::Port_ptr provides_port_ref)
+ Ports::Port_ptr provides_port_ref)
throw (Engines::DSC::PortNotDefined,
- Engines::DSC::BadPortType,
- Engines::DSC::NilPort)
+ Engines::DSC::BadPortType,
+ Engines::DSC::NilPort)
{
// Method arg test
assert(uses_port_name);
my_ports[uses_port_name]->connection_nbr += 1;
// User code is informed
uses_port_changed(uses_port_name,
- new Engines::DSC::uses_port(my_ports[uses_port_name]->uses_port_refs),
- Engines::DSC::AddingConnection);
+ new Engines::DSC::uses_port(my_ports[uses_port_name]->uses_port_refs),
+ Engines::DSC::AddingConnection);
}
else {
Engines::DSC::BadPortType BPT;
BPT.expected = CORBA::string_dup("Expected ...");
BPT.received = CORBA::string_dup((std::string("Received an incorrect repository id type ")+
- repository_id).c_str());
+ repository_id).c_str());
throw BPT;
}
void
Engines_DSC_interface::disconnect_provides_port(const char* provides_port_name,
- const Engines::DSC::Message message)
+ const Engines::DSC::Message message)
throw (Engines::DSC::PortNotDefined,
Engines::DSC::PortNotConnected)
{
{
my_ports[provides_port_name]->connection_nbr -= 1;
provides_port_changed(provides_port_name,
- my_ports[provides_port_name]->connection_nbr,
- message);
+ my_ports[provides_port_name]->connection_nbr,
+ message);
}
else
throw Engines::DSC::PortNotConnected();
void
Engines_DSC_interface::disconnect_uses_port(const char* uses_port_name,
- Ports::Port_ptr provides_port_ref,
- const Engines::DSC::Message message)
+ Ports::Port_ptr provides_port_ref,
+ const Engines::DSC::Message message)
throw (Engines::DSC::PortNotDefined,
Engines::DSC::PortNotConnected,
Engines::DSC::BadPortReference)
{
if (my_ports[uses_port_name]->uses_port_refs[i]->_is_equivalent(provides_port_ref))
{
- port_index = i;
- break;
+ port_index = i;
+ break;
}
}
if (port_index == -1)
for(;index_ancien < seq_length;) {
if (index_ancien == port_index)
{
- // Rien a faire !
- // On ne change pas le index du nouveau tableau
- index_ancien += 1;
+ // Rien a faire !
+ // On ne change pas le index du nouveau tableau
+ index_ancien += 1;
}
else
{
- (*new_uses_port)[index_nouveau] = my_ports[uses_port_name]->uses_port_refs[index_ancien];
- index_ancien += 1;
- index_nouveau += 1;
+ (*new_uses_port)[index_nouveau] = my_ports[uses_port_name]->uses_port_refs[index_ancien];
+ index_ancien += 1;
+ index_nouveau += 1;
}
}
// The user code is informed
uses_port_changed(uses_port_name,
- new_uses_port,
- message);
+ new_uses_port,
+ message);
}
else
throw Engines::DSC::PortNotConnected();
* \see Engines::DSC::add_provides_port
*/
virtual void add_provides_port(Ports::Port_ptr ref,
- const char* provides_port_name,
- Ports::PortProperties_ptr port_prop)
+ const char* provides_port_name,
+ Ports::PortProperties_ptr port_prop)
throw (Engines::DSC::PortAlreadyDefined,
- Engines::DSC::NilPort,
- Engines::DSC::BadProperty);
+ Engines::DSC::NilPort,
+ Engines::DSC::BadProperty);
/*!
* \see Engines::DSC::add_uses_port
*/
virtual void add_uses_port(const char* repository_id,
- const char* uses_port_name,
- Ports::PortProperties_ptr port_prop)
+ const char* uses_port_name,
+ Ports::PortProperties_ptr port_prop)
throw (Engines::DSC::PortAlreadyDefined,
- Engines::DSC::BadProperty);
+ Engines::DSC::BadProperty);
/*!
* \see Engines::DSC::get_provides_port
*/
virtual Ports::Port_ptr get_provides_port(const char* provides_port_name,
- const CORBA::Boolean connection_error)
+ const CORBA::Boolean connection_error)
throw (Engines::DSC::PortNotDefined,
- Engines::DSC::PortNotConnected,
- Engines::DSC::BadPortType);
+ Engines::DSC::PortNotConnected,
+ Engines::DSC::BadPortType);
/*!
* \see Engines::DSC::get_uses_port
*/
virtual Engines::DSC::uses_port * get_uses_port(const char* uses_port_name)
throw (Engines::DSC::PortNotDefined,
- Engines::DSC::PortNotConnected,
- Engines::DSC::BadPortType);
+ Engines::DSC::PortNotConnected,
+ Engines::DSC::BadPortType);
/*!
* \see Engines::DSC::connect_provides_port
* port how much provides ports are connected with.
*/
virtual void connect_uses_port(const char* uses_port_name,
- Ports::Port_ptr provides_port_ref)
+ Ports::Port_ptr provides_port_ref)
throw (Engines::DSC::PortNotDefined,
- Engines::DSC::BadPortType,
- Engines::DSC::NilPort);
+ Engines::DSC::BadPortType,
+ Engines::DSC::NilPort);
/*!
* \see Engines::DSC::is_connected
* to manage connections between ports.
*/
virtual void disconnect_provides_port(const char* provides_port_name,
- const Engines::DSC::Message message)
+ const Engines::DSC::Message message)
throw (Engines::DSC::PortNotDefined,
- Engines::DSC::PortNotConnected);
+ Engines::DSC::PortNotConnected);
/*!
* \see Engines::DSC::disconnect_uses_port
* the sequence.
*/
virtual void disconnect_uses_port(const char* uses_port_name,
- Ports::Port_ptr provides_port_ref,
- const Engines::DSC::Message message)
+ Ports::Port_ptr provides_port_ref,
+ const Engines::DSC::Message message)
throw (Engines::DSC::PortNotDefined,
- Engines::DSC::PortNotConnected,
- Engines::DSC::BadPortReference);
+ Engines::DSC::PortNotConnected,
+ Engines::DSC::BadPortReference);
/*!
* \see Engines::DSC::get_port_properties
* \see Ports::PortProperties::set_property
*/
virtual void set_property(const char * name,
- const CORBA::Any& value)
+ const CORBA::Any& value)
throw (Ports::NotDefined, Ports::BadType);
/*!
data_short_port_provides::data_short_port_provides() {
_val = 0;
- short_termine = false;
+ short_termine = false;
short_mutex = new pthread_mutex_t();
pthread_mutex_init(short_mutex, NULL);
short_condition = new pthread_cond_t();
pthread_cond_init(short_condition, NULL);
- short_termine_cp = true;
+ 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();
void
data_short_port_uses::uses_port_changed(Engines::DSC::uses_port * new_uses_port,
- const Engines::DSC::Message message)
+ const Engines::DSC::Message message)
{
if (_my_ports)
delete _my_ports;
* \param message message associated to the modification.
*/
virtual void uses_port_changed(Engines::DSC::uses_port * new_uses_port,
- const Engines::DSC::Message message);
+ const Engines::DSC::Message message);
private :
Engines::DSC::uses_port * _my_ports;
// soit utilisable.
// Ne pas mettre lineNumber=0 à cause du calcul log dans la SALOME_Exception si fileName est défini
DSC_Exception( const std::string & text,
- const char *fileName="",
- const unsigned int lineNumber=0,
- const char *funcName="" ):
+ const char *fileName="",
+ const unsigned int lineNumber=0,
+ const char *funcName="" ):
SALOME_Exception(text.c_str()) ,
_dscText(text),
_filefuncName(setFileFuncName(fileName?fileName:"",funcName?funcName:"")),
#define DSC_EXCEPTION(Derived) struct Derived : public DSC_Exception { \
Derived ( const std::string & text, const char *fileName="", const unsigned int lineNumber=0, const char *funcName="" \
- ) : DSC_Exception(text,fileName,lineNumber,funcName) { \
+ ) : DSC_Exception(text,fileName,lineNumber,funcName) { \
_exceptionName = #Derived; \
} \
virtual ~Derived(void) throw();\
bool _minFound,_maxFound,_equal;
AdjacentFunctor(const T& value):_minValue(value),_maxValue(value),
- _minFound(false),_maxFound(false),
- _equal(false) {}
+ _minFound(false),_maxFound(false),
+ _equal(false) {}
// Suppose que les valeurs passées en paramètres sont triées par ordre croissant
bool operator()(const T &v1) {
template <typename T1, typename T2, typename T3>
struct AdjacentPredicate< std::pair<const std::pair<T1,T2>, T3 > > :
public std::binary_function < std::pair<const std::pair<T1,T2>, T3 >,
- std::pair<const std::pair<T1,T2>, T3 >, bool >
+ std::pair<const std::pair<T1,T2>, T3 >, bool >
{
std::pair<T1,T2> _value;
AdjacentPredicate(const std::pair<T1,T2> & value):_value(value){
std::cout << "1-Initializing with value " << _value << std::endl;
}
bool operator()( const std::pair<const std::pair<T1,T2>, T3 > & v1,
- const std::pair<const std::pair<T1,T2>, T3 > v2) const {
+ const std::pair<const std::pair<T1,T2>, T3 > v2) const {
std::cout << "1-> :" << v1 << "," << v2 << " " << std::endl;
return (v1.first <= _value ) && (_value < v2.first) ;
}
/* Attention si les niveaux sont actifs le buffer peut être supprimé automatiquement par calcium. */
#define CALCIUM_EXT_LECT_INTERFACE_C_(_name,_timeType,_type,_typeName,_qual) \
- InfoType ecp_##_name (void * component, int mode, \
- _timeType * ti, _timeType * tf, int * i, \
- char * nomvar, int bufferLength, \
- int * nRead, _type _qual ** data ) { \
- size_t _nRead; \
- long _i=*i; \
- fflush(stdout); \
- fflush(stderr); \
- \
+ InfoType ecp_##_name (void * component, int mode, \
+ _timeType * ti, _timeType * tf, int * i, \
+ char * nomvar, int bufferLength, \
+ int * nRead, _type _qual ** data ) { \
+ size_t _nRead; \
+ long _i=*i; \
+ fflush(stdout); \
+ fflush(stderr); \
+ \
InfoType info = ecp_lecture_##_typeName (component, mode, ti, tf, &_i, \
- nomvar, bufferLength, &_nRead, \
- data ); \
+ nomvar, bufferLength, &_nRead, \
+ data ); \
/* std::cout << "-------- CalciumInterface(C Part), Valeur de data : " << std::endl; */ \
- /* std::cout << "Ptr :" << *data << std::endl; */ \
- /* for (int j=0; j<_nRead;++j) */ \
- /* printf("--- Valeur de data[%d] : %d \n",j,(*data)[j]); */ \
- /* std::cout << "Ptr :" << *data << std::endl; */ \
- /* */ \
+ /* std::cout << "Ptr :" << *data << std::endl; */ \
+ /* for (int j=0; j<_nRead;++j) */ \
+ /* printf("--- Valeur de data[%d] : %d \n",j,(*data)[j]); */ \
+ /* std::cout << "Ptr :" << *data << std::endl; */ \
+ /* */ \
/* std::cerr << "-------- CalciumInterface(C Part) MARK 2 ------------------" << std::endl; */ \
if(mode == CP_SEQUENTIEL) \
- *i = _i; \
- *nRead=_nRead; \
+ *i = _i; \
+ *nRead=_nRead; \
/* std::cerr << "-------- CalciumInterface(C Part) MARK 3 ------------------" << std::endl; */ \
- \
- return info; \
- }; \
- void ecp_##_name##_free ( _type _qual * data) { \
- ecp_lecture_##_typeName##_free(data); \
+ \
+ return info; \
+ }; \
+ void ecp_##_name##_free ( _type _qual * data) { \
+ ecp_lecture_##_typeName##_free(data); \
};
Le paramètre supplémentaire strSize indique la taille fixe et identique
des chaînes stockées dans data (les ports CALCIUM n'en n'ont pas besoin)
*/
-InfoType ecp_lch(void * component, int mode, float * ti, float * tf, int * i,
- char * nomvar, int bufferLength, int * nRead,
- char *** data, int strSize) {
+InfoType ecp_lch(void * component, int mode, float * ti, float * tf, int * i,
+ char * nomvar, int bufferLength, int * nRead,
+ char *** data, int strSize) {
- size_t _nRead;
- long _i=*i;
- fflush(stdout);fflush(stderr);
+ size_t _nRead;
+ long _i=*i;
+ fflush(stdout);fflush(stderr);
InfoType info = ecp_lecture_str (component, mode, ti, tf, &_i,
- nomvar, bufferLength, &_nRead,
- data);/*, strSize );
- strSize est inutile pour les ports CALCIUM
- qui gèrent des tailles quelconques de chaines. */
- if(mode == CP_SEQUENTIEL)
- *i = _i;
- *nRead=_nRead;
- fflush(stdout);fflush(stderr);
-
- return info;
-};
-
-void ecp_lch_free (char* * data) { \
- ecp_lecture_str_free(data); \
+ nomvar, bufferLength, &_nRead,
+ data);/*, strSize );
+ strSize est inutile pour les ports CALCIUM
+ qui gèrent des tailles quelconques de chaines. */
+ if(mode == CP_SEQUENTIEL)
+ *i = _i;
+ *nRead=_nRead;
+ fflush(stdout);fflush(stderr);
+
+ return info;
+};
+
+void ecp_lch_free (char* * data) { \
+ ecp_lecture_str_free(data); \
};
/**************************************/
#define CALCIUM_LECT_INTERFACE_C_(_name,_timeType,_calInt,_type,_typeName,_qual,lastarg) \
- _calInt cp_##_name (void * component, _calInt mode, \
- _timeType * ti, _timeType * tf, _calInt * i, \
- char * nomvar, _calInt bufferLength, \
- _calInt * nRead, _type _qual * data \
- lastarg ) { \
- \
- int _mode = (int) mode; \
- size_t _bufferLength = bufferLength; \
- size_t _nRead; \
- long _i =*i; \
- fflush(stdout); \
- fflush(stderr); \
- \
- if ( (data == NULL) || (_bufferLength < 1) ) return CPNTNULL; \
- \
+ _calInt cp_##_name (void * component, _calInt mode, \
+ _timeType * ti, _timeType * tf, _calInt * i, \
+ char * nomvar, _calInt bufferLength, \
+ _calInt * nRead, _type _qual * data \
+ lastarg ) { \
+ \
+ int _mode = (int) mode; \
+ size_t _bufferLength = bufferLength; \
+ size_t _nRead; \
+ long _i =*i; \
+ fflush(stdout); \
+ fflush(stderr); \
+ \
+ if ( (data == NULL) || (_bufferLength < 1) ) return CPNTNULL; \
+ \
_calInt info = ecp_lecture_##_typeName (component, _mode, ti, tf, &_i, \
- nomvar, _bufferLength, &_nRead, \
- &data ); \
- if(mode == CP_SEQUENTIEL) \
- *i = _i; \
- *nRead=_nRead; \
- fflush(stdout); \
- fflush(stderr); \
- \
- return info; \
- }; \
- void cp_##_name##_free ( _type _qual * data) { \
- ecp_lecture_##_typeName##_free(data); \
+ nomvar, _bufferLength, &_nRead, \
+ &data ); \
+ if(mode == CP_SEQUENTIEL) \
+ *i = _i; \
+ *nRead=_nRead; \
+ fflush(stdout); \
+ fflush(stderr); \
+ \
+ return info; \
+ }; \
+ void cp_##_name##_free ( _type _qual * data) { \
+ ecp_lecture_##_typeName##_free(data); \
};
des chaînes stockées dans data (les ports CALCIUM n'en n'ont pas besoin)
*/
-/* InfoType cp_lch(void * component, int mode, float * ti, float * tf, int * i, */
-/* char * nomvar, int bufferLength, int * nRead, */
-/* char ** data, int strSize) { */
+/* InfoType cp_lch(void * component, int mode, float * ti, float * tf, int * i, */
+/* char * nomvar, int bufferLength, int * nRead, */
+/* char ** data, int strSize) { */
-/* size_t _nRead; */
-/* long _i=*i; */
-/* fflush(stdout);fflush(stderr); */
-/* fprintf(stderr,"Beginning of cp_lch: %s %d %f\n",nomvar,*i,*ti); */
-
-/* if ( (data == NULL) || (bufferLength < 1) ) return CPNTNULL; */
+/* size_t _nRead; */
+/* long _i=*i; */
+/* fflush(stdout);fflush(stderr); */
+/* fprintf(stderr,"Beginning of cp_lch: %s %d %f\n",nomvar,*i,*ti); */
+
+/* if ( (data == NULL) || (bufferLength < 1) ) return CPNTNULL; */
/* InfoType info = ecp_lecture_str (component, mode, ti, tf, &_i, */
-/* nomvar, bufferLength, &_nRead, */
-/* &data);*/
+/* nomvar, bufferLength, &_nRead, */
+/* &data);*/
/*, strSize ); */
-/* strSize est inutile pour les ports CALCIUM */
-/* qui gèrent des tailles quelconques de chaines. */
-/* if(mode == CP_SEQUENTIEL) */
-/* *i = _i; */
-/* *nRead=_nRead; */
-/* fprintf(stderr,"End of cp_lch: %s %d \n",nomvar,*i); */
-/* fflush(stdout);fflush(stderr); */
-
-/* return info; */
-/* }; */
+/* strSize est inutile pour les ports CALCIUM */
+/* qui gèrent des tailles quelconques de chaines. */
+/* if(mode == CP_SEQUENTIEL) */
+/* *i = _i; */
+/* *nRead=_nRead; */
+/* fprintf(stderr,"End of cp_lch: %s %d \n",nomvar,*i); */
+/* fflush(stdout);fflush(stderr); */
+
+/* return info; */
+/* }; */
/* Definition des méthodes calcium standard */
/***************************/
#define CALCIUM_ECR_INTERFACE_C_(_name,_timeType,_calInt,_type,_typeName,_qual,lastarg) \
- _calInt cp_##_name (void * component, _calInt mode, \
- _timeType t, _calInt i, \
- char * nomvar, _calInt nbelem, \
- _type _qual * data \
- lastarg ) { \
- \
- int _mode = mode; \
- long _i = i; \
- size_t _nbelem = nbelem; \
- _timeType _t = t; \
- fflush(stdout); \
- fflush(stderr); \
- if ( (data == NULL) || (nbelem < 1) ) return CPNTNULL; \
- \
+ _calInt cp_##_name (void * component, _calInt mode, \
+ _timeType t, _calInt i, \
+ char * nomvar, _calInt nbelem, \
+ _type _qual * data \
+ lastarg ) { \
+ \
+ int _mode = mode; \
+ long _i = i; \
+ size_t _nbelem = nbelem; \
+ _timeType _t = t; \
+ fflush(stdout); \
+ fflush(stderr); \
+ if ( (data == NULL) || (nbelem < 1) ) return CPNTNULL; \
+ \
_calInt info = ecp_ecriture_##_typeName (component, _mode, &_t, _i, \
- nomvar, _nbelem, \
- data ); \
- fflush(stdout); \
- fflush(stderr); \
- \
- return info; \
- }; \
+ nomvar, _nbelem, \
+ data ); \
+ fflush(stdout); \
+ fflush(stderr); \
+ \
+ return info; \
+ }; \
/* InfoType cp_ech(void * component, int mode, float t, int i, */
-/* char * nomvar, int nbelem, */
-/* char ** data, int strSize) { */
-
-/*long _i=i;*/
-/* fflush(stdout);fflush(stderr); */
-/* fprintf(stderr,"Beginning of cp_ech: %s %d %f\n",nomvar,i,t); */
-/* if ( (data == NULL) || (nbelem < 1) ) return CPNTNULL; */
+/* char * nomvar, int nbelem, */
+/* char ** data, int strSize) { */
+
+/*long _i=i;*/
+/* fflush(stdout);fflush(stderr); */
+/* fprintf(stderr,"Beginning of cp_ech: %s %d %f\n",nomvar,i,t); */
+/* if ( (data == NULL) || (nbelem < 1) ) return CPNTNULL; */
-/* InfoType info = ecp_ecriture_str (component, mode, &t, i, */
-/* nomvar, nbelem, */
-/* data); */
+/* InfoType info = ecp_ecriture_str (component, mode, &t, i, */
+/* nomvar, nbelem, */
+/* data); */
/*, strSize );*/
-/* fprintf(stderr,"End of cp_ech: %s %d \n",nomvar,i); */
-/* fflush(stdout); */
-/* fflush(stderr); */
-
-/* return info; */
-/* }; */
+/* fprintf(stderr,"End of cp_ech: %s %d \n",nomvar,i); */
+/* fflush(stdout); */
+/* fflush(stderr); */
+
+/* return info; */
+/* }; */
/* Definition des méthodes calcium standard */
/* CALCIUM_ECR_INTERFACE_C_(_name,_timeType,_calInt,type,_typeName,_qual) */
bool provideLastGivenValue = false;
if (code == CalciumTypes::CP_CONT ) provideLastGivenValue = true;
- try {
- CalciumInterface::ecp_fin( *_component,
- provideLastGivenValue);
+ try {
+ CalciumInterface::ecp_fin( *_component,
+ provideLastGivenValue);
} catch ( const CalciumException & ex) { //tester l'arrêt par exception
DEBTRACE( ex.what() );
- return ex.getInfo();
- }
+ return ex.getInfo();
+ }
return CalciumTypes::CPOK;
};
// Le paramètre supplémentaire strsize n'étant pas utilisé
// j'utilise la génération par la macro CALCIUM_C2CPP_INTERFACE_(str,char*,);
// extern "C" CalciumTypes::InfoType ecp_lecture_str (void * component, int dependencyType,
-// float * ti, float * tf, long * i,
-// const char * const nomvar, size_t bufferLength,
-// size_t * nRead, char ** *data, size_t strsize ) {
+// float * ti, float * tf, long * i,
+// const char * const nomvar, size_t bufferLength,
+// size_t * nRead, char ** *data, size_t strsize ) {
// Superv_Component_i * _component = static_cast<Superv_Component_i *>(component);
-// double _ti=*ti;
-// double _tf=*tf;
-// size_t _nRead=0;
-// size_t _bufferLength=bufferLength;
-// CalciumTypes::DependencyType dependencyType=
-// static_cast<CalciumTypes::DependencyType>(dependencyType);
+// double _ti=*ti;
+// double _tf=*tf;
+// size_t _nRead=0;
+// size_t _bufferLength=bufferLength;
+// CalciumTypes::DependencyType dependencyType=
+// static_cast<CalciumTypes::DependencyType>(dependencyType);
// // - GERER POINTEUR NULL : NOTHING TODO
// // - VERIFIER LA TAILLE DES CHAINES RETOURNEES (ELLES DEVRAIENT ETRES CORRECTES SI L'ECRITURE EST BIEN CODEE.)
// DEBTRACE( "-------- CalciumInterface(lecture Inter Part) MARK 1 ------------------" )
-// try {
-// CalciumInterface::ecp_lecture< char*, char* >( *_component,
-// dependencyType,
-// _ti, _tf, *i,
-// nomvar,
-// _bufferLength, _nRead, *data);
-// } catch ( const CalciumException & ex) {
+// try {
+// CalciumInterface::ecp_lecture< char*, char* >( *_component,
+// dependencyType,
+// _ti, _tf, *i,
+// nomvar,
+// _bufferLength, _nRead, *data);
+// } catch ( const CalciumException & ex) {
// DEBTRACE( ex.what() );
-// return ex.getInfo();
-// }
+// return ex.getInfo();
+// }
-// *nRead = _nRead;
+// *nRead = _nRead;
// if (dependencyType == CalciumTypes::CP_SEQUENTIEL )
-// *ti=(float)(_ti);
+// *ti=(float)(_ti);
// DEBTRACE( "-------- CalciumInterface(lecture Inter Part), Data Ptr :" << *data ) ;
// return CalciumTypes::CPOK;
-// };
-
-
-// extern "C" void ecp_lecture_str_free (char** data) {
-// CalciumInterface::ecp_free< char*, char* >(data);
-// };
-
-
+// };
+
+
+// extern "C" void ecp_lecture_str_free (char** data) {
+// CalciumInterface::ecp_free< char*, char* >(data);
+// };
+
+
// extern "C" CalciumTypes::InfoType ecp_ecriture_str (void * component, int dependencyType,
-// float *t, long i,
-// const char * const nomvar, size_t bufferLength,
-// char ** data, int strsize ) {
+// float *t, long i,
+// const char * const nomvar, size_t bufferLength,
+// char ** data, int strsize ) {
// Superv_Component_i * _component = static_cast<Superv_Component_i *>(component);
// /* Je ne sais pas pourquoi, je n'arrive pas à passer t par valeur : corruption de la pile*/
-// double _t=*t;
-// size_t _bufferLength=bufferLength;
+// double _t=*t;
+// size_t _bufferLength=bufferLength;
// // - VERIFIER LA TAILLE DES CHAINES RETOURNEES (ELLES DEVRAIENT ETRES CORRECTES SI L'ECRITURE EST BIEN CODEE.)
// DEBTRACE( "-------- CalciumInterface(ecriture Inter Part) MARK 1 ------------------" )
-// try {
-// std::string essai(nomvar);
-// DEBTRACE( "----------->-" << nomvar )
-// CalciumInterface::ecp_ecriture< char*, char* >( *_component,
-// static_cast<CalciumTypes::DependencyType>(dependencyType),
-// _t,i,nomvar,_bufferLength,*data);
-// } catch ( const CalciumException & ex) {
-// std::cerr << ex.what() << std::endl;
-// return ex.getInfo();
-// }
+// try {
+// std::string essai(nomvar);
+// DEBTRACE( "----------->-" << nomvar )
+// CalciumInterface::ecp_ecriture< char*, char* >( *_component,
+// static_cast<CalciumTypes::DependencyType>(dependencyType),
+// _t,i,nomvar,_bufferLength,*data);
+// } catch ( const CalciumException & ex) {
+// std::cerr << ex.what() << std::endl;
+// return ex.getInfo();
+// }
// DEBTRACE( "-------- CalciumInterface(ecriture Inter Part), Valeur de data :" << data )
-// return CalciumTypes::CPOK;
-// };
+// return CalciumTypes::CPOK;
+// };
#include "CalciumCouplingPolicy.hxx"
CalciumCouplingPolicy::CalciumCouplingPolicy():_dependencyType(CalciumTypes::UNDEFINED_DEPENDENCY),
- _storageLevel(CalciumTypes::UNLIMITED_STORAGE_LEVEL),
- _dateCalSchem(CalciumTypes::TI_SCHEM),
- _interpolationSchem(CalciumTypes::L1_SCHEM),
- _extrapolationSchem(CalciumTypes::UNDEFINED_EXTRA_SCHEM),
- _alpha(0.0),_deltaT(CalciumTypes::EPSILON),
- _disconnectDirective(CalciumTypes::UNDEFINED_DIRECTIVE){};
+ _storageLevel(CalciumTypes::UNLIMITED_STORAGE_LEVEL),
+ _dateCalSchem(CalciumTypes::TI_SCHEM),
+ _interpolationSchem(CalciumTypes::L1_SCHEM),
+ _extrapolationSchem(CalciumTypes::UNDEFINED_EXTRA_SCHEM),
+ _alpha(0.0),_deltaT(CalciumTypes::EPSILON),
+ _disconnectDirective(CalciumTypes::UNDEFINED_DIRECTIVE){};
void CalciumCouplingPolicy::setDependencyType (CalciumTypes::DependencyType dependencyType) {_dependencyType=dependencyType;}
CalciumTypes::DependencyType CalciumCouplingPolicy::getDependencyType () const { return _dependencyType;}
CalciumCouplingPolicy::TimeType
CalciumCouplingPolicy::getEffectiveTime(CalciumCouplingPolicy::TimeType ti,
- CalciumCouplingPolicy::TimeType tf) {
+ CalciumCouplingPolicy::TimeType tf) {
if ( _dateCalSchem == CalciumTypes::TI_SCHEM ) return ti;
if ( _dateCalSchem == CalciumTypes::TF_SCHEM ) return tf;
inline TagType getTag (const DataId &dataId) const { return dataId.second;}
template <typename DataManipulator,
- class EnableIf = void > struct BoundedDataIdProcessor;
+ class EnableIf = void > struct BoundedDataIdProcessor;
//template <typename DataManipulator> struct BoundedDataIdProcessor;
template <typename DataManipulator> struct EraseDataIdProcessor;
template <typename DataManipulator> struct DisconnectProcessor;
// Le container doit être associatif
template < typename AssocContainer >
bool isDataIdConveniant( AssocContainer & storedDatas,
- const typename AssocContainer::key_type & expectedDataId,
- bool & isEqual, bool & isBounded,
- typename AssocContainer::iterator & wDataIt1) const;
+ const typename AssocContainer::key_type & expectedDataId,
+ bool & isEqual, bool & isBounded,
+ typename AssocContainer::iterator & wDataIt1) const;
TimeType getEffectiveTime(TimeType ti, TimeType tf);
typedef std::vector < DataId > DataIdVect;
InternalDataIdContainer(const DataId & dataId,
- const CalciumCouplingPolicy & policy
- ):std::vector< std::pair< T_TIME,T_TAG> >() {
+ const CalciumCouplingPolicy & policy
+ ):std::vector< std::pair< T_TIME,T_TAG> >() {
// Ignore les paramètres qui ne sont pas en rapport avec le type de dépendance
switch (policy._dependencyType) {
case CalciumTypes::TIME_DEPENDENCY:
BoundedDataIdProcessor(const CouplingPolicy & couplingPolicy) {};
template < typename Iterator, typename DataId >
void inline apply(typename iterator_t<Iterator>::value_type & data,
- const DataId & dataId,
- const Iterator & it1) const {
+ const DataId & dataId,
+ const Iterator & it1) const {
typedef typename iterator_t<Iterator>::value_type value_type;
#ifdef MYDEBUG
std::cout << "-------- Calcium Generic BoundedDataIdProcessor.apply() called " << std::endl;
// Méthode implémentant l'interpolation temporelle
template < typename MapIterator >
void inline apply (typename iterator_t<MapIterator>::value_type & data,
- const DataId & dataId, const MapIterator & it1) const {
+ const DataId & dataId, const MapIterator & it1) const {
typedef typename iterator_t<MapIterator>::value_type value_type;
typedef typename DataManipulator::InnerType InnerType;
// OLD: REM : Pour des buffers de type int
// OLD: le compilo indiquera warning: converting to `long int' from `Double'
std::transform(InIt1,InIt1+dataSize,InIt2,OutIt,
- ( _1 - _2 ) * coeff + _2 );
+ ( _1 - _2 ) * coeff + _2 );
// for(size_t i =0; i < dataSize3; ++i) {
-// OutIt[i]=(InIt1[i] - InIt2[i]) * coeff + InIt2[i];
+// OutIt[i]=(InIt1[i] - InIt2[i]) * coeff + InIt2[i];
// }
}
// Le container doit être associatif
template < typename AssocContainer >
bool CalciumCouplingPolicy::isDataIdConveniant( AssocContainer & storedDatas, const typename AssocContainer::key_type & expectedDataId,
- bool & isEqual, bool & isBounded, typename AssocContainer::iterator & wDataIt1) const {
+ bool & isEqual, bool & isBounded, typename AssocContainer::iterator & wDataIt1) const {
// Rem : le type key_type == DataId
typedef typename AssocContainer::key_type key_type;
//
// L'algo find_if ne peut être utilisé car il recopie l'AdjacentFunctor
// qui ne peut alors pas mémoriser ses états précédents
- //
+ //
// Un codage en reverse serait plus efficace
typename AssocContainer::iterator prev = storedDatas.begin();
template < typename Container >
void apply(Container & storedDatas,
- typename Container::iterator & wDataIt1 ) const {
+ typename Container::iterator & wDataIt1 ) const {
typedef typename Container::key_type key_type;
typedef typename Container::value_type value_type;
if (s > 0 ) {
size_t dist=distance(storedDatas.begin(),wDataIt1);
for (int i=0; i<s; ++i) {
- //no bug if removed : DataManipulator::delete_data((*storedDatas.begin()).second);
- DataManipulator::delete_data((*storedDatas.begin()).second);
- storedDatas.erase(storedDatas.begin());
+ //no bug if removed : DataManipulator::delete_data((*storedDatas.begin()).second);
+ DataManipulator::delete_data((*storedDatas.begin()).second);
+ storedDatas.erase(storedDatas.begin());
}
// Si l'itérateur pointait sur une valeur que l'on vient de supprimer
if (dist < s ) {
throw(CalciumException(CalciumTypes::CPNTNULL,LOC(OSS()<< "StorageLevel management "
- << _couplingPolicy._storageLevel <<
- " has just removed the data to send")));
+ << _couplingPolicy._storageLevel <<
+ " has just removed the data to send")));
}
}
#ifdef MYDEBUG
template < typename Container, typename DataId >
bool apply(Container & storedDatas,
- const DataId & expectedDataId,
- typename Container::iterator & wDataIt1 ) const {
+ const DataId & expectedDataId,
+ typename Container::iterator & wDataIt1 ) const {
typedef typename Container::key_type key_type;
typedef typename Container::value_type value_type;
// TODO : Ds GenericPort::next il faut convertir en CPSTOPSEQ
if ( _couplingPolicy._disconnectDirective == CalciumTypes::CP_ARRET )
throw(CalciumException(CalciumTypes::CPINARRET,LOC(OSS()<< "CP_ARRET directive"
- << " interrupts all further data reading")));
+ << " interrupts all further data reading")));
#ifdef MYDEBUG
std::cout << "-------- CalciumCouplingPolicy::DisconnectProcessor MARK3 --------" << std::endl;
#endif
// TODO : Dans la gestion des niveaux il faut peut être interdire un niveau == 0
if ( storedDatas.empty() )
throw(CalciumException(CalciumTypes::CPNTNULL,LOC(OSS()<< "CP_CONT directive"
- << " is active but no data is available.")));
+ << " is active but no data is available.")));
// expectedDataId n'a ni été trouvé dans storedDataIds ni encadré mais il se peut
// qu'en mode itératif il ne soit pas plus grand que le plus grand DataId stocké auquel
// TODO : Il faut en fait renvoyer le plus proche cf IT ou DT
if (it1 == storedDatas.end())
throw(CalciumException(CalciumTypes::CPNTNULL,LOC(OSS()<< "CP_CONT directive"
- << " is active but the requested dataId is less or equal to the last one received.")));
+ << " is active but the requested dataId is less or equal to the last one received.")));
#ifdef MYDEBUG
std::cout << "-------- CalciumCouplingPolicy::DisconnectProcessor MARK6 " << std::endl;
struct CalciumException : public DSC_Exception {
CalciumException( const CalciumTypes::InfoType info,
- const std::string & text,
- const char *fileName,
- const unsigned int lineNumber,
- const char *funcName):
+ const std::string & text,
+ const char *fileName,
+ const unsigned int lineNumber,
+ const char *funcName):
DSC_Exception(text,fileName,lineNumber,funcName),
_info(info),_exceptionName("CalciumException")
{};
CalciumException( const CalciumTypes::InfoType info,
- const std::string & text ):
+ const std::string & text ):
DSC_Exception(text),_info(info),_exceptionName("CalciumException")
{};
// (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 POA_Ports::PortProperties, \
- public GenericProvidesPort< __VA_ARGS__ , CalciumCouplingPolicy, calcium_provides_port > { \
- private : \
+ class specificPortName : public virtual CorbaInterface , \
+ public virtual POA_Ports::PortProperties, \
+ public GenericProvidesPort< __VA_ARGS__ , CalciumCouplingPolicy, calcium_provides_port > { \
+ private : \
omni_mutex _disconnect_mutex; \
int _mustnotdisconnect; \
- public : \
- typedef __VA_ARGS__ DataManipulator; \
- typedef DataManipulator::Type CorbaDataType; \
- typedef GenericPort< DataManipulator , \
- CalciumCouplingPolicy > Port; \
+ public : \
+ typedef __VA_ARGS__ DataManipulator; \
+ typedef DataManipulator::Type CorbaDataType; \
+ typedef GenericPort< DataManipulator , \
+ CalciumCouplingPolicy > Port; \
specificPortName () : _mustnotdisconnect(0) {}; \
- \
- virtual ~ specificPortName (); \
- \
- inline void disconnect(bool provideLastGivenValue) { \
+ \
+ virtual ~ specificPortName (); \
+ \
+ inline void disconnect(bool provideLastGivenValue) { \
_disconnect_mutex.lock(); \
if(_mustnotdisconnect > 1) \
{ \
Port::disconnect(provideLastGivenValue); \
} \
_disconnect_mutex.unlock(); \
- } \
+ } \
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(); \
- } \
+ 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(); \
- } \
+ 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); \
- } \
+ Port::setInterpolationSchem(interpolationSchem); \
+ } \
inline void setExtrapolationSchem (CalciumTypes::ExtrapolationSchem extrapolationSchem) { \
- Port::setExtrapolationSchem(extrapolationSchem); \
- } \
+ Port::setExtrapolationSchem(extrapolationSchem); \
+ } \
inline CalciumTypes::InterpolationSchem getInterpolationSchem() const { \
- return Port::getInterpolationSchem(); \
- } \
+ return Port::getInterpolationSchem(); \
+ } \
inline CalciumTypes::ExtrapolationSchem getExtrapolationSchem() const { \
- return Port::getExtrapolationSchem(); \
- } \
- \
- inline void put( DataManipulator::CorbaInType data, \
- CORBA::Double time, CORBA::Long tag) { \
- Port::put(data, time, tag); \
- } \
- \
- inline Ports::Port_ptr get_port_ref() { \
- return _this(); \
- } \
- \
- Ports::PortProperties_ptr get_port_properties() { \
- return POA_Ports::PortProperties::_this(); \
- } \
- \
+ return Port::getExtrapolationSchem(); \
+ } \
+ \
+ inline void put( DataManipulator::CorbaInType data, \
+ CORBA::Double time, CORBA::Long tag) { \
+ Port::put(data, time, tag); \
+ } \
+ \
+ 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); \
- \
- virtual void provides_port_changed(int connection_nbr, \
- const Engines::DSC::Message message) { \
- if ( message == Engines::DSC::AddingConnection) \
+ throw (Ports::NotDefined, Ports::BadType, Ports::BadValue); \
+ \
+ virtual CORBA::Any* get_property(const char* name) \
+ throw (Ports::NotDefined); \
+ \
+ virtual void provides_port_changed(int connection_nbr, \
+ const Engines::DSC::Message message) { \
+ if ( message == Engines::DSC::AddingConnection) \
{ \
_disconnect_mutex.lock(); \
_mustnotdisconnect++; \
_disconnect_mutex.unlock(); \
} \
- else if ( message == Engines::DSC::RemovingConnection ) \
+ else if ( message == Engines::DSC::RemovingConnection ) \
{ \
disconnect(false); \
} \
- } \
- }; \
+ } \
+ }; \
-#define CALCIUM_GENERIC_PROVIDES_PORT_CXX(specificPortName) \
- \
- specificPortName::~specificPortName(void) {}; \
- \
+#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" ) \
+ 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") \
+ 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") \
+ else if (key == "ExtrapolationSchem") \
{ *value <<= corbaExtrapolationSchem[Port::getExtrapolationSchem()];} \
- else { \
- delete value; \
- throw Ports::NotDefined(); \
- } \
- return value; \
- };
-
+ else { \
+ delete value; \
+ throw Ports::NotDefined(); \
+ } \
+ return value; \
+ };
+
#endif
template <typename DataManipulator, typename CorbaPortType, char * repositoryName >
class CalciumGenericUsesPort : public GenericUsesPort<DataManipulator,CorbaPortType, repositoryName,
- calcium_uses_port >
+ calcium_uses_port >
{
public :
virtual ~CalciumGenericUsesPort() {};
CALCIUM_GENERIC_PROVIDES_PORT_CXX(calcium_intc_port_provides)
-CALCIUM_GENERIC_PROVIDES_PORT_CXX(calcium_real_port_provides)
+CALCIUM_GENERIC_PROVIDES_PORT_CXX(calcium_real_port_provides)
CALCIUM_GENERIC_PROVIDES_PORT_CXX(calcium_double_port_provides)
using namespace std;
CORBA_DATE_CAL_SCHEM::CORBA_DATE_CAL_SCHEM() : map<CalciumTypes::DateCalSchem,
- Ports::Calcium_Ports::DateCalSchem>()
+ Ports::Calcium_Ports::DateCalSchem>()
{
map<CalciumTypes::DateCalSchem,
Ports::Calcium_Ports::DateCalSchem > &
table = ( map<CalciumTypes::DateCalSchem,
- Ports::Calcium_Ports::DateCalSchem > & ) *this ;
+ Ports::Calcium_Ports::DateCalSchem > & ) *this ;
table[CalciumTypes::TI_SCHEM ] = Ports::Calcium_Ports::TI_SCHEM ;
table[CalciumTypes::TF_SCHEM ] = Ports::Calcium_Ports::TF_SCHEM ;
{
map<CalciumTypes::DateCalSchem,
Ports::Calcium_Ports::DateCalSchem > &table = (map<CalciumTypes::DateCalSchem,
- Ports::Calcium_Ports::DateCalSchem >&)*this ;
+ Ports::Calcium_Ports::DateCalSchem >&)*this ;
assert( table.find( (CalciumTypes::DateCalSchem)c ) != table.end() ) ;
return table[ (CalciumTypes::DateCalSchem)c ] ;
}
CORBA_DEPENDENCY_TYPE::CORBA_DEPENDENCY_TYPE() : map<CalciumTypes::DependencyType,
- Ports::Calcium_Ports::DependencyType >()
+ Ports::Calcium_Ports::DependencyType >()
{
map<CalciumTypes::DependencyType,
Ports::Calcium_Ports::DependencyType > &
CORBA_INTERPOLATION_SCHEM::CORBA_INTERPOLATION_SCHEM() : map<CalciumTypes::InterpolationSchem,
- Ports::Calcium_Ports::InterpolationSchem > ()
+ Ports::Calcium_Ports::InterpolationSchem > ()
{
map<CalciumTypes::InterpolationSchem,
Ports::Calcium_Ports::InterpolationSchem > &
table = ( map<CalciumTypes::InterpolationSchem,
- Ports::Calcium_Ports::InterpolationSchem > & ) *this ;
+ Ports::Calcium_Ports::InterpolationSchem > & ) *this ;
table[CalciumTypes::L0_SCHEM ] = Ports::Calcium_Ports::L0_SCHEM ;
table[CalciumTypes::L1_SCHEM ] = Ports::Calcium_Ports::L1_SCHEM ;
CORBA_EXTRAPOLATION_SCHEM::CORBA_EXTRAPOLATION_SCHEM() : map<CalciumTypes::ExtrapolationSchem,
- Ports::Calcium_Ports::ExtrapolationSchem > ()
+ Ports::Calcium_Ports::ExtrapolationSchem > ()
{
map<CalciumTypes::ExtrapolationSchem,
Ports::Calcium_Ports::ExtrapolationSchem > &
table = ( map<CalciumTypes::ExtrapolationSchem,
- Ports::Calcium_Ports::ExtrapolationSchem > & ) *this ;
+ Ports::Calcium_Ports::ExtrapolationSchem > & ) *this ;
table[CalciumTypes::E0_SCHEM ] = Ports::Calcium_Ports::E0_SCHEM ;
table[CalciumTypes::E1_SCHEM ] = Ports::Calcium_Ports::E1_SCHEM ;
class CORBA_DATE_CAL_SCHEM : public std::map<CalciumTypes::DateCalSchem,
- Ports::Calcium_Ports::DateCalSchem >
+ Ports::Calcium_Ports::DateCalSchem >
{
public :
extern const CORBA_DATE_CAL_SCHEM corbaDateCalSchem ;
class CORBA_DEPENDENCY_TYPE : public std::map<CalciumTypes::DependencyType,
- Ports::Calcium_Ports::DependencyType>
+ Ports::Calcium_Ports::DependencyType>
{
public :
extern const CORBA_DEPENDENCY_TYPE corbaDependencyType ;
class CORBA_INTERPOLATION_SCHEM : public std::map<CalciumTypes::InterpolationSchem,
- Ports::Calcium_Ports::InterpolationSchem>
+ Ports::Calcium_Ports::InterpolationSchem>
{
public :
extern const CORBA_INTERPOLATION_SCHEM corbaInterpolationSchem ;
class CORBA_EXTRAPOLATION_SCHEM : public std::map<CalciumTypes::ExtrapolationSchem,
- Ports::Calcium_Ports::ExtrapolationSchem>
+ Ports::Calcium_Ports::ExtrapolationSchem>
{
public :
template <typename PortType> struct CalciumTypesManipulator :
public seq_u_manipulation<Ports::Calcium_Ports::seq_complex,
- Ports::Calcium_Ports::Complex> {
+ Ports::Calcium_Ports::Complex> {
static bool needInterpolation=true;
}
template <POA_Ports::Calcium_Ports::Calcium_Complex_Port> struct CalciumTypesManipulator :
public seq_u_manipulation<Ports::Calcium_Ports::seq_complex,
- Ports::Calcium_Ports::Complex> {
+ Ports::Calcium_Ports::Complex> {
static bool needInterpolation=true;
}
corbaData = DataManipulator::create(nRead,const_cast<T2 * > (&data),false);
#ifdef MYDEBUG
std::cerr << "-------- Copy2CorbaSpace<true> MARK 2 --(dataPtr : "
- << DataManipulator::getPointer(corbaData,false)<<")----------------" << std::endl;
+ << DataManipulator::getPointer(corbaData,false)<<")----------------" << std::endl;
#endif
}
using namespace std;
DATE_CAL_SCHEM::DATE_CAL_SCHEM() : map<Ports::Calcium_Ports::DateCalSchem,
- CalciumTypes::DateCalSchem>()
+ CalciumTypes::DateCalSchem>()
{
map<Ports::Calcium_Ports::DateCalSchem,
CalciumTypes::DateCalSchem > &
table = ( map<Ports::Calcium_Ports::DateCalSchem,
- CalciumTypes::DateCalSchem > & ) *this ;
+ CalciumTypes::DateCalSchem > & ) *this ;
table[Ports::Calcium_Ports::TI_SCHEM ] = CalciumTypes::TI_SCHEM ;
table[Ports::Calcium_Ports::TF_SCHEM ] = CalciumTypes::TF_SCHEM ;
{
map<Ports::Calcium_Ports::DateCalSchem,
CalciumTypes::DateCalSchem> &table = (map<Ports::Calcium_Ports::DateCalSchem,
- CalciumTypes::DateCalSchem>&)*this ;
+ CalciumTypes::DateCalSchem>&)*this ;
assert( table.find( (Ports::Calcium_Ports::DateCalSchem)c ) != table.end() ) ;
return table[ (Ports::Calcium_Ports::DateCalSchem)c ] ;
}
DEPENDENCY_TYPE::DEPENDENCY_TYPE() : map<Ports::Calcium_Ports::DependencyType,
- CalciumTypes::DependencyType>()
+ CalciumTypes::DependencyType>()
{
map<Ports::Calcium_Ports::DependencyType,
CalciumTypes::DependencyType > &
{
map<Ports::Calcium_Ports::DependencyType,
CalciumTypes::DependencyType> &table = (map<Ports::Calcium_Ports::DependencyType,
- CalciumTypes::DependencyType>&)*this ;
+ CalciumTypes::DependencyType>&)*this ;
MESSAGE("DEPENDENCY_TYPE() : ::operator["<<c<<"]: " << table[c]);
INTERPOLATION_SCHEM::INTERPOLATION_SCHEM() : map<Ports::Calcium_Ports::InterpolationSchem,
- CalciumTypes::InterpolationSchem > ()
+ CalciumTypes::InterpolationSchem > ()
{
map<Ports::Calcium_Ports::InterpolationSchem,
CalciumTypes::InterpolationSchem > &
table = ( map<Ports::Calcium_Ports::InterpolationSchem,
- CalciumTypes::InterpolationSchem > & ) *this ;
+ CalciumTypes::InterpolationSchem > & ) *this ;
table[Ports::Calcium_Ports::L0_SCHEM ] = CalciumTypes::L0_SCHEM ;
table[Ports::Calcium_Ports::L1_SCHEM ] = CalciumTypes::L1_SCHEM ;
EXTRAPOLATION_SCHEM::EXTRAPOLATION_SCHEM() : map<Ports::Calcium_Ports::ExtrapolationSchem,
- CalciumTypes::ExtrapolationSchem > ()
+ CalciumTypes::ExtrapolationSchem > ()
{
map<Ports::Calcium_Ports::ExtrapolationSchem,
CalciumTypes::ExtrapolationSchem > &
table = ( map<Ports::Calcium_Ports::ExtrapolationSchem,
- CalciumTypes::ExtrapolationSchem > & ) *this ;
+ CalciumTypes::ExtrapolationSchem > & ) *this ;
table[Ports::Calcium_Ports::E0_SCHEM ] = CalciumTypes::E0_SCHEM ;
table[Ports::Calcium_Ports::E1_SCHEM ] = CalciumTypes::E1_SCHEM ;
class DATE_CAL_SCHEM : public std::map<Ports::Calcium_Ports::DateCalSchem,
- CalciumTypes::DateCalSchem>
+ CalciumTypes::DateCalSchem>
{
public :
extern const DATE_CAL_SCHEM dateCalSchem ;
class DEPENDENCY_TYPE : public std::map<Ports::Calcium_Ports::DependencyType,
- CalciumTypes::DependencyType>
+ CalciumTypes::DependencyType>
{
public :
extern const DEPENDENCY_TYPE dependencyType ;
class INTERPOLATION_SCHEM : public std::map<Ports::Calcium_Ports::InterpolationSchem,
- CalciumTypes::InterpolationSchem>
+ CalciumTypes::InterpolationSchem>
{
public :
extern const INTERPOLATION_SCHEM interpolationSchem ;
class EXTRAPOLATION_SCHEM : public std::map<Ports::Calcium_Ports::ExtrapolationSchem,
- CalciumTypes::ExtrapolationSchem>
+ CalciumTypes::ExtrapolationSchem>
{
public :
#include "calciumP.h"
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
-#define CPNeedPrototype 1
+#define CPNeedPrototype 1
#else
-#define CPNeedPrototype 0
+#define CPNeedPrototype 0
#endif
extern "C" {
#endif
-/* */
-/* */
-/* Fonctions de connexion */
-/* */
-/* */
-extern int cp_cd(
-/* ----- */
+/* */
+/* */
+/* Fonctions de connexion */
+/* */
+/* */
+extern int cp_cd(
+/* ----- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
char * /* S Nom de l instance appelante*/
#endif
);
-/* */
-/* */
-/* Fonction de deconnexion */
-/* */
-/* */
-extern int cp_fin(
-/* ------ */
-#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Directive de continuation */
- /* CP_CONT ou CP_ARRET */
-#endif
-);
-
-
-
-/* */
-/* */
-/* Fonctions de lecture bloquante */
-/* */
-/* */
-extern int cp_len(
-/* ------ */
-#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance ou de lecture */
- /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
- float * /* E/S Borne inf de l'intervalle de lecture */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- float * /* E Borne Sup de l'intervalle de lecture */,
- int * /* E/S Pas d'iteration a lire */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- char * /* E Nom de la variable a lire */,
- int /* E Nombre max de valeurs a lire */,
- int * /* S Nombre de valeurs rellement lues */,
- int * /* S Tableau d'entiers pour stocker les */
- /* valeurs lues */
-#endif
-);
-
-extern int cp_lre(
-/* ------ */
-#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance ou de lecture */
- /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
- float * /* E/S Borne inf de l'intervalle de lecture */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- float * /* E Borne Sup de l'intervalle de lecture */,
- int * /* E/S Pas d'iteration a lire */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- char * /* E Nom de la variable a lire */,
- int /* E Nombre max de valeurs a lire */,
- int * /* S Nombre de valeurs rellement lues */,
- float * /* S Tableau de flottants pour stocker les */
- /* valeurs lues */
-#endif
-);
-
-extern int cp_ldb(
-/* ------ */
-#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance ou de lecture */
- /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
- double* /* E/S Borne inf de l'intervalle de lecture */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- double* /* E Borne Sup de l'intervalle de lecture */,
- int * /* E/S Pas d'iteration a lire */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- char * /* E Nom de la variable a lire */,
- int /* E Nombre max de valeurs a lire */,
- int * /* S Nombre de valeurs rellement lues */,
- double* /* S Tableau de doubles pour stocker les */
- /* valeurs lues */
-#endif
-);
-
-extern int cp_lcp(
-/* ------ */
-#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance ou de lecture */
- /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
- float * /* E/S Borne inf de l'intervalle de lecture */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- float * /* E Borne Sup de l'intervalle de lecture */,
- int * /* E/S Pas d'iteration lire */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- char * /* E Nom de la variable a lire */,
- int /* E Nombre max de valeurs a lire */,
- int * /* S Nombre de valeurs rellement lues */,
- float * /* S Tableau de flottants pour stocker les */
- /* valeurs lues (dimension = 2 * le nombre */
- /* de valeurs lues) */
-#endif
-);
-
-extern int cp_llo(
-/* ------ */
-#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance ou de lecture */
- /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
- float * /* E/S Borne inf de l'intervalle de lecture */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- float * /* E Borne Sup de l'intervalle de lecture */,
- int * /* E/S Pas d'iteration a lire */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- char * /* E Nom de la variable a lire */,
- int /* E Nombre max de valeurs a lire */,
- int * /* S Nombre de valeurs rellement lues */,
- int * /* S Tableau d 'entier pour stocker les */
- /* valeurs lues (remplace le logiques) */
-#endif
-);
-
-extern int cp_lch(
-/* ------ */
-#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance ou de lecture */
- /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
- float * /* E/S Borne inf de l'intervalle de lecture */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- float * /* E Borne Sup de l'intervalle de lecture */,
- int * /* E/S Pas d'iteration a lire */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- char * /* E Nom de la variable a lire */,
- int /* E Nombre max de valeurs a lire */,
- int * /* S Nombre de valeurs rellement lues */,
- char *[]/* S Tableau de chaines pour stocker les */
- /* valeurs lues (remplace le logiques) */,
- int /* E Taille des chaines du tablaeu */
-#endif
-);
-
-
-
-/* */
-/* */
-/* Fonctions de lecture non bloquantes */
-/* */
-/* */
-extern int cp_nlen(
-/* ------- */
-#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance ou de lecture */
- /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
- float * /* E/S Borne inf de l'intervalle de lecture */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- float * /* E Borne Sup de l'intervalle de lecture */,
- int * /* E/S Pas d'iteration a lire */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- char * /* E Nom de la variable a lire */,
- int /* E Nombre max de valeurs a lire */,
- int * /* S Nombre de valeurs rellement lues */,
- int * /* S Tableau d'entiers pour stocker les */
- /* valeurs lues */
-#endif
-);
-
-extern int cp_nlre(
-/* ------- */
-#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance ou de lecture */
- /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
- float * /* E/S Borne inf de l'intervalle de lecture */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- float * /* E Borne Sup de l'intervalle de lecture */,
- int * /* E/S Pas d'iteration a lire */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- char * /* E Nom de la variable a lire */,
- int /* E Nombre max de valeurs a lire */,
- int * /* S Nombre de valeurs rellement lues */,
- float * /* S Tableau de flottants pour stocker les */
- /* valeurs lues */
-#endif
-);
-
-extern int cp_nldb(
-/* ------- */
-
-#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance ou de lecture */
- /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
- double */* E/S Borne inf de l'intervalle de lecture */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- double */* E Borne Sup de l'intervalle de lecture */,
- int * /* E/S Pas d'iteration a lire */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- char * /* E Nom de la variable a lire */,
- int /* E Nombre max de valeurs a lire */,
- int * /* S Nombre de valeurs rellement lues */,
- double* /* S Tableau de doubles pour stocker les */
- /* valeurs lues */
-#endif
-);
-
-extern int cp_nlcp(
-/* ------- */
-#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance ou de lecture */
- /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
- float * /* E/S Borne inf de l'intervalle de lecture */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- float * /* E Borne Sup de l'intervalle de lecture */,
- int * /* E/S Pas d'iteration lire */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- char * /* E Nom de la variable a lire */,
- int /* E Nombre max de valeurs a lire */,
- int * /* S Nombre de valeurs rellement lues */,
- float * /* S Tableau de flottants pour stocker les */
- /* valeurs lues (dimension = 2 * le nombre */
- /* de valeurs lues) */
-#endif
-);
-
-extern int cp_nllo(
-/* ------- */
-#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance ou de lecture */
- /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
- float * /* E/S Borne inf de l'intervalle de lecture */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- float * /* E Borne Sup de l'intervalle de lecture */,
- int * /* E/S Pas d'iteration a lire */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- char * /* E Nom de la variable a lire */,
- int /* E Nombre max de valeurs a lire */,
- int * /* S Nombre de valeurs rellement lues */,
- int * /* S Tableau d 'entier pour stocker les */
- /* valeurs lues (remplace le logiques) */
-#endif
-);
-
-extern int cp_nlch(
-/* ------- */
-#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance ou de lecture */
- /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
- float * /* E/S Borne inf de l'intervalle de lecture */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- float * /* E Borne Sup de l'intervalle de lecture */,
- int * /* E/S Pas d'iteration a lire */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- char * /* E Nom de la variable a lire */,
- int /* E Nombre max de valeurs a lire */,
- int * /* S Nombre de valeurs rellement lues */,
- char *[]/* S Tableau de chaines pour stocker les */
- /* valeurs lues (remplace le logiques) */,
- int /* E Taille des chaines du tablaeu */
-#endif
-);
-
-
-
-
-/* */
-/* */
-/* Fonctions d'ecriture */
-/* */
-/* */
-
-extern int cp_een(
-/* ------ */
-#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance */
- /* CP_TEMPS, CP_ITERATION */,
- float /* E Pas de temps a ecrire */,
- int /* E Pas d'iteration a ecrire */,
- char * /* E Nom de la variable a ecrire */,
- int /* E Nombre de valeurs a ecrire */,
- int * /* E Tableau d'entiers a ecrire */
+/* */
+/* */
+/* Fonction de deconnexion */
+/* */
+/* */
+extern int cp_fin(
+/* ------ */
+#if CPNeedPrototype
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Directive de continuation */
+ /* CP_CONT ou CP_ARRET */
+#endif
+);
+
+
+
+/* */
+/* */
+/* Fonctions de lecture bloquante */
+/* */
+/* */
+extern int cp_len(
+/* ------ */
+#if CPNeedPrototype
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ float * /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ float * /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration a lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ int * /* S Tableau d'entiers pour stocker les */
+ /* valeurs lues */
+#endif
+);
+
+extern int cp_lre(
+/* ------ */
+#if CPNeedPrototype
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ float * /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ float * /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration a lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ float * /* S Tableau de flottants pour stocker les */
+ /* valeurs lues */
+#endif
+);
+
+extern int cp_ldb(
+/* ------ */
+#if CPNeedPrototype
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ double* /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ double* /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration a lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ double* /* S Tableau de doubles pour stocker les */
+ /* valeurs lues */
+#endif
+);
+
+extern int cp_lcp(
+/* ------ */
+#if CPNeedPrototype
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ float * /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ float * /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ float * /* S Tableau de flottants pour stocker les */
+ /* valeurs lues (dimension = 2 * le nombre */
+ /* de valeurs lues) */
+#endif
+);
+
+extern int cp_llo(
+/* ------ */
+#if CPNeedPrototype
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ float * /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ float * /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration a lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ int * /* S Tableau d 'entier pour stocker les */
+ /* valeurs lues (remplace le logiques) */
+#endif
+);
+
+extern int cp_lch(
+/* ------ */
+#if CPNeedPrototype
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ float * /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ float * /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration a lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ char *[]/* S Tableau de chaines pour stocker les */
+ /* valeurs lues (remplace le logiques) */,
+ int /* E Taille des chaines du tablaeu */
+#endif
+);
+
+
+
+/* */
+/* */
+/* Fonctions de lecture non bloquantes */
+/* */
+/* */
+extern int cp_nlen(
+/* ------- */
+#if CPNeedPrototype
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ float * /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ float * /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration a lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ int * /* S Tableau d'entiers pour stocker les */
+ /* valeurs lues */
+#endif
+);
+
+extern int cp_nlre(
+/* ------- */
+#if CPNeedPrototype
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ float * /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ float * /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration a lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ float * /* S Tableau de flottants pour stocker les */
+ /* valeurs lues */
+#endif
+);
+
+extern int cp_nldb(
+/* ------- */
+
+#if CPNeedPrototype
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ double */* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ double */* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration a lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ double* /* S Tableau de doubles pour stocker les */
+ /* valeurs lues */
+#endif
+);
+
+extern int cp_nlcp(
+/* ------- */
+#if CPNeedPrototype
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ float * /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ float * /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ float * /* S Tableau de flottants pour stocker les */
+ /* valeurs lues (dimension = 2 * le nombre */
+ /* de valeurs lues) */
+#endif
+);
+
+extern int cp_nllo(
+/* ------- */
+#if CPNeedPrototype
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ float * /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ float * /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration a lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ int * /* S Tableau d 'entier pour stocker les */
+ /* valeurs lues (remplace le logiques) */
+#endif
+);
+
+extern int cp_nlch(
+/* ------- */
+#if CPNeedPrototype
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ float * /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ float * /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration a lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ char *[]/* S Tableau de chaines pour stocker les */
+ /* valeurs lues (remplace le logiques) */,
+ int /* E Taille des chaines du tablaeu */
+#endif
+);
+
+
+
+
+/* */
+/* */
+/* Fonctions d'ecriture */
+/* */
+/* */
+
+extern int cp_een(
+/* ------ */
+#if CPNeedPrototype
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance */
+ /* CP_TEMPS, CP_ITERATION */,
+ float /* E Pas de temps a ecrire */,
+ int /* E Pas d'iteration a ecrire */,
+ char * /* E Nom de la variable a ecrire */,
+ int /* E Nombre de valeurs a ecrire */,
+ int * /* E Tableau d'entiers a ecrire */
#endif
);
-extern int cp_elg(
-/* ------ */
+extern int cp_elg(
+/* ------ */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance */
- /* CP_TEMPS, CP_ITERATION */,
- float /* E Pas de temps a ecrire */,
- int /* E Pas d'iteration a ecrire */,
- char * /* E Nom de la variable a ecrire */,
- int /* E Nombre de valeurs a ecrire */,
- long * /* E Tableau d'entiers a ecrire */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance */
+ /* CP_TEMPS, CP_ITERATION */,
+ float /* E Pas de temps a ecrire */,
+ int /* E Pas d'iteration a ecrire */,
+ char * /* E Nom de la variable a ecrire */,
+ int /* E Nombre de valeurs a ecrire */,
+ long * /* E Tableau d'entiers a ecrire */
#endif
);
-extern int cp_ere(
-/* ------ */
+extern int cp_ere(
+/* ------ */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance */
- /* CP_TEMPS, CP_ITERATION */,
- float /* E Pas de temps a ecrire */,
- int /* E Pas d'iteration a ecrire */,
- char * /* E Nom de la variable a ecrire */,
- int /* E Nombre de valeurs a ecrire */,
- float * /* E Tableau de flottants a ecrire */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance */
+ /* CP_TEMPS, CP_ITERATION */,
+ float /* E Pas de temps a ecrire */,
+ int /* E Pas d'iteration a ecrire */,
+ char * /* E Nom de la variable a ecrire */,
+ int /* E Nombre de valeurs a ecrire */,
+ float * /* E Tableau de flottants a ecrire */
#endif
);
-extern int cp_edb(
-/* ------ */
+extern int cp_edb(
+/* ------ */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance */
- /* CP_TEMPS, CP_ITERATION */,
- double /* E Pas de temps a ecrire */,
- int /* E Pas d'iteration a ecrire */,
- char * /* E Nom de la variable a ecrire */,
- int /* E Nombre de valeurs a ecrire */,
- double* /* E Tableau de doubles a ecrire */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance */
+ /* CP_TEMPS, CP_ITERATION */,
+ double /* E Pas de temps a ecrire */,
+ int /* E Pas d'iteration a ecrire */,
+ char * /* E Nom de la variable a ecrire */,
+ int /* E Nombre de valeurs a ecrire */,
+ double* /* E Tableau de doubles a ecrire */
#endif
);
-extern int cp_ecp(
-/* ------ */
+extern int cp_ecp(
+/* ------ */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance */
- /* CP_TEMPS, CP_ITERATION */,
- float /* E Pas de temps a ecrire */,
- int /* E Pas d'iteration a ecrire */,
- char * /* E Nom de la variable a ecrire */,
- int /* E Nombre de valeurs a ecrire */,
- float * /* E Tableau de flottants a ecrire */
- /* (dimension = 2 * le nombre de valeurs */
- /* a ecrire */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance */
+ /* CP_TEMPS, CP_ITERATION */,
+ float /* E Pas de temps a ecrire */,
+ int /* E Pas d'iteration a ecrire */,
+ char * /* E Nom de la variable a ecrire */,
+ int /* E Nombre de valeurs a ecrire */,
+ float * /* E Tableau de flottants a ecrire */
+ /* (dimension = 2 * le nombre de valeurs */
+ /* a ecrire */
#endif
);
-extern int cp_elo(
-/* ------ */
+extern int cp_elo(
+/* ------ */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance */
- /* CP_TEMPS, CP_ITERATION */,
- float /* E Pas de temps a ecrire */,
- int /* E Pas d'iteration a ecrire */,
- char * /* E Nom de la variable a ecrire */,
- int /* E Nombre de valeurs a ecrire */,
- int * /* E Tableau d'entiers a ecrire */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance */
+ /* CP_TEMPS, CP_ITERATION */,
+ float /* E Pas de temps a ecrire */,
+ int /* E Pas d'iteration a ecrire */,
+ char * /* E Nom de la variable a ecrire */,
+ int /* E Nombre de valeurs a ecrire */,
+ int * /* E Tableau d'entiers a ecrire */
#endif
);
-extern int cp_ech(
-/* ------ */
+extern int cp_ech(
+/* ------ */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance */
- /* CP_TEMPS, CP_ITERATION */,
- float /* E Pas de temps a ecrire */,
- int /* E Pas d'iteration a ecrire */,
- char * /* E Nom de la variable a ecrire */,
- int /* E Nombre de valeurs a ecrire */,
- char *[]/* E Tableau de chaines a ecrire */,
- int /* E Taille des chaines a ecrire */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance */
+ /* CP_TEMPS, CP_ITERATION */,
+ float /* E Pas de temps a ecrire */,
+ int /* E Pas d'iteration a ecrire */,
+ char * /* E Nom de la variable a ecrire */,
+ int /* E Nombre de valeurs a ecrire */,
+ char *[]/* E Tableau de chaines a ecrire */,
+ int /* E Taille des chaines a ecrire */
#endif
);
-/* */
-/* */
-/* Fonctions de fin de pas */
-/* */
-/* */
-extern int cp_aufp(
-/* ------- */
+/* */
+/* */
+/* Fonctions de fin de pas */
+/* */
+/* */
+extern int cp_aufp(
+/* ------- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */
#endif
);
-extern int cp_infp(
-/* ------- */
+extern int cp_infp(
+/* ------- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */
#endif
);
-extern int cp_fini(
-/* ------- */
+extern int cp_fini(
+/* ------- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Tous les pas <= a cette valeur */
- /* seront oublies par le coupleur */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Tous les pas <= a cette valeur */
+ /* seront oublies par le coupleur */
#endif
);
-extern int cp_fint(
-/* ------- */
+extern int cp_fint(
+/* ------- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- float /* E Tous les pas <= a cette valeur */
- /* seront oublies par le coupleur */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ float /* E Tous les pas <= a cette valeur */
+ /* seront oublies par le coupleur */
#endif
);
-/* */
-/* */
-/* Fonctions d'effacement */
-/* */
-/* */
-extern int cp_effi(
-/* ------- */
+/* */
+/* */
+/* Fonctions d'effacement */
+/* */
+/* */
+extern int cp_effi(
+/* ------- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- char * /* E Nom de la variable a effacer */,
- int /* E Tous les pas >= a cette valeurt */
- /* seront effaces par le coupleur */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ char * /* E Nom de la variable a effacer */,
+ int /* E Tous les pas >= a cette valeurt */
+ /* seront effaces par le coupleur */
#endif
);
-extern int cp_efft(
-/* ------- */
+extern int cp_efft(
+/* ------- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- char * /* E Nom de la variable a effacer */,
- float /* E Tous les pas >= a cette valeur */
- /* seront effaces par le coupleur */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ char * /* E Nom de la variable a effacer */,
+ float /* E Tous les pas >= a cette valeur */
+ /* seront effaces par le coupleur */
#endif
);
-/* */
-/* */
-/* Fonctions de mode d'execution */
-/* */
-/* */
-extern int cp_pause(
-/* -------- */
+/* */
+/* */
+/* Fonctions de mode d'execution */
+/* */
+/* */
+extern int cp_pause(
+/* -------- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */
#endif
);
-extern int cp_run(
-/* ------ */
+extern int cp_run(
+/* ------ */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */
#endif
);
-extern int cp_npas(
-/* ------- */
+extern int cp_npas(
+/* ------- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Nombre de pas a executer */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Nombre de pas a executer */
#endif
);
-/* */
-/* */
-/* Fonctions de configuration dynamique */
-/* */
-/* */
-extern int cp_dfcode(
-/* -------- */
+/* */
+/* */
+/* Fonctions de configuration dynamique */
+/* */
+/* */
+extern int cp_dfcode(
+/* -------- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- char * /* E Declaration du code */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ char * /* E Declaration du code */
#endif
);
-extern int cp_dfinst(
-/* -------- */
+extern int cp_dfinst(
+/* -------- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- char * /* E Declaration de l'instance */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ char * /* E Declaration de l'instance */
#endif
);
-extern int cp_dflien(
-/* -------- */
+extern int cp_dflien(
+/* -------- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- char * /* E Declaration du lien */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ char * /* E Declaration du lien */
#endif
);
-/* */
-/* */
-/* Fonctions d'interrogation */
-/* */
-/* */
-extern int cp_ivers(
-/* -------- */
+/* */
+/* */
+/* Fonctions d'interrogation */
+/* */
+/* */
+extern int cp_ivers(
+/* -------- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- char * /* S Repertoire ACCC */,
- char * /* S Repertoire ACCC */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ char * /* S Repertoire ACCC */,
+ char * /* S Repertoire ACCC */
#endif
);
-extern int cp_icd(
-/* ------ */
+extern int cp_icd(
+/* ------ */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Longueur du tableau passe en parametre */,
- int * /* S Nombre de codes retournes */,
- char *[]/* S Tableau contenant les noms des codes */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Longueur du tableau passe en parametre */,
+ int * /* S Nombre de codes retournes */,
+ char *[]/* S Tableau contenant les noms des codes */
#endif
);
-extern int cp_iincd(
-/* -------- */
+extern int cp_iincd(
+/* -------- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- char * /* E Nom du code dont on veut les instances */,
- int /* E Longueur du tableau passe en parametre */,
- int * /* S Nombre d'instances retournees */,
- char *[]/* S Tableau contenant les noms des instances */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ char * /* E Nom du code dont on veut les instances */,
+ int /* E Longueur du tableau passe en parametre */,
+ int * /* S Nombre d'instances retournees */,
+ char *[]/* S Tableau contenant les noms des instances */
#endif
);
-extern int cp_ivr(
-/* ------ */
+extern int cp_ivr(
+/* ------ */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Longueur des tableaux passes en parametre */,
- int * /* S Nombre de variables retournees */,
- char *[]/* S Tableau contenant les noms des instances */,
- char *[]/* S Tableau contenant les noms des variables */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Longueur des tableaux passes en parametre */,
+ int * /* S Nombre de variables retournees */,
+ char *[]/* S Tableau contenant les noms des instances */,
+ char *[]/* S Tableau contenant les noms des variables */
#endif
);
-extern int cp_ivrcd(
-/* -------- */
+extern int cp_ivrcd(
+/* -------- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- char * /* E Nom du code dont on veut les variables */,
- int /* E Longueur des tableaux passes en parametre */,
- int * /* S Nombre de variables retournees */,
- char *[]/* S Tableau contenant les noms des variables */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ char * /* E Nom du code dont on veut les variables */,
+ int /* E Longueur des tableaux passes en parametre */,
+ int * /* S Nombre de variables retournees */,
+ char *[]/* S Tableau contenant les noms des variables */
#endif
);
-extern int cp_ivrin(
-/* -------- */
+extern int cp_ivrin(
+/* -------- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- char * /* E Nom de l'instance dont on veut la liste */
- /* des variables */,
- char * /* S Nom du code pere de l'instance */,
- int /* E Longueur du tableau pour les variables */
- /* entrantes */,
- int /* E Longueur du tableau pour les variables */
- /* sortantes */,
- int * /* S Nombre de variables entrantes retournees */,
- int * /* S Nombre de variables sortantes retournees */,
- char *[]/* S Tableau contenant les noms des variables */
- /* entrantes */,
- char *[]/* S Tableau contenant les noms des variables */
- /* sortantes */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ char * /* E Nom de l'instance dont on veut la liste */
+ /* des variables */,
+ char * /* S Nom du code pere de l'instance */,
+ int /* E Longueur du tableau pour les variables */
+ /* entrantes */,
+ int /* E Longueur du tableau pour les variables */
+ /* sortantes */,
+ int * /* S Nombre de variables entrantes retournees */,
+ int * /* S Nombre de variables sortantes retournees */,
+ char *[]/* S Tableau contenant les noms des variables */
+ /* entrantes */,
+ char *[]/* S Tableau contenant les noms des variables */
+ /* sortantes */
#endif
);
-extern int cp_icavr(
-/* -------- */
+extern int cp_icavr(
+/* -------- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- char * /* E Nom de l'instance contenant la variable */,
- char * /* E Nom local de la variable */,
- int * /* S Sens de la variable */,
- int * /* S Dependance de la variable */,
- int * /* S Type de la variable */,
- int /* E Longueur des tableaux permettant de */
- /* recueillir les pas de temps et d'iteration*/,
- int * /* S Nombre de codes retournes */,
- float * /* S Tableau contenant les pas de temps */,
- int * /* S Tableau contenant les pas d'iterations */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ char * /* E Nom de l'instance contenant la variable */,
+ char * /* E Nom local de la variable */,
+ int * /* S Sens de la variable */,
+ int * /* S Dependance de la variable */,
+ int * /* S Type de la variable */,
+ int /* E Longueur des tableaux permettant de */
+ /* recueillir les pas de temps et d'iteration*/,
+ int * /* S Nombre de codes retournes */,
+ float * /* S Tableau contenant les pas de temps */,
+ int * /* S Tableau contenant les pas d'iterations */
#endif
);
-extern int cp_ilien(
-/* -------- */
+extern int cp_ilien(
+/* -------- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- char * /* E Nom global de la variable */,
- int /* E Longueur des tableaux pour les noms des */
- /* instances et des variables */,
- int * /* S Nombre de variables participant au lien */,
- char *[]/* S Tableau contenant les noms des instances */,
- char *[]/* S Tableau contenant les noms des variables */,
- int * /* S Type du lien */,
- int * /* S Niveau du lien */,
- int * /* S Tableau des parametres d'interpolation */
- /* des variables entrantes */,
- float * /* S Tableau des valeurs de delta utilisees */
- /* pour les variables entrantes */,
- int * /* S Tableau des parametres d'extrapolation */
- /* des variables entrantes */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ char * /* E Nom global de la variable */,
+ int /* E Longueur des tableaux pour les noms des */
+ /* instances et des variables */,
+ int * /* S Nombre de variables participant au lien */,
+ char *[]/* S Tableau contenant les noms des instances */,
+ char *[]/* S Tableau contenant les noms des variables */,
+ int * /* S Type du lien */,
+ int * /* S Niveau du lien */,
+ int * /* S Tableau des parametres d'interpolation */
+ /* des variables entrantes */,
+ float * /* S Tableau des valeurs de delta utilisees */
+ /* pour les variables entrantes */,
+ int * /* S Tableau des parametres d'extrapolation */
+ /* des variables entrantes */
#endif
);
-/* */
-/* */
-/* Fonctions de manipulation d'options */
-/* */
-/* */
-extern int cp_setopt(
-/* --------- */
+/* */
+/* */
+/* Fonctions de manipulation d'options */
+/* */
+/* */
+extern int cp_setopt(
+/* --------- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Numero identifiant l'option a modifier */,
- int /* E Valeur a donner a l'option */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Numero identifiant l'option a modifier */,
+ int /* E Valeur a donner a l'option */
#endif
);
-extern int cp_getopt(
-/* --------- */
+extern int cp_getopt(
+/* --------- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Numero identifiant l'option a consulter */,
- int * /* S Valeur recupereee de l'option */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Numero identifiant l'option a consulter */,
+ int * /* S Valeur recupereee de l'option */
#endif
);
#include "calciumP.h"
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
-#define CPNeedPrototype 1
+#define CPNeedPrototype 1
#else
-#define CPNeedPrototype 0
+#define CPNeedPrototype 0
#endif
extern "C" {
#endif
-/* */
-/* */
-/* Fonctions de connexion */
-/* */
-/* */
-extern int ecp_cd(
-/* ----- */
+/* */
+/* */
+/* Fonctions de connexion */
+/* */
+/* */
+extern int ecp_cd(
+/* ----- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
char * /* S Nom de l instance appelante*/
#endif
);
-/* */
-/* */
-/* Fonction de deconnexion */
-/* */
-/* */
-extern int ecp_fin(
-/* ------ */
+/* */
+/* */
+/* Fonction de deconnexion */
+/* */
+/* */
+extern int ecp_fin(
+/* ------ */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Directive de continuation */
- /* CP_CONT ou CP_ARRET */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Directive de continuation */
+ /* CP_CONT ou CP_ARRET */
#endif
);
-/* */
-/* */
-/* Fonctions de libération du buffer 0 copy */
-/* */
+/* */
+/* */
+/* Fonctions de libération du buffer 0 copy */
+/* */
extern void ecp_len_free(
#if CPNeedPrototype
- int *
+ int *
#endif
- );
+ );
extern void ecp_lre_free(
#if CPNeedPrototype
- float *
+ float *
#endif
- );
+ );
extern void ecp_ldb_free(
#if CPNeedPrototype
- double *
+ double *
#endif
- );
+ );
extern void ecp_llo_free(
#if CPNeedPrototype
- int *
+ int *
#endif
- );
+ );
extern void ecp_lcp_free(
#if CPNeedPrototype
- float *
+ float *
#endif
- );
+ );
extern void ecp_lch_free(
#if CPNeedPrototype
- char **
+ char **
#endif
- );
+ );
-/* */
-/* */
-/* Fonctions de lecture bloquante 0 copy */
-/* */
-/* */
-extern int ecp_len(
-/* ------ */
+/* */
+/* */
+/* Fonctions de lecture bloquante 0 copy */
+/* */
+/* */
+extern int ecp_len(
+/* ------ */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance ou de lecture */
- /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
- float * /* E/S Borne inf de l'intervalle de lecture */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- float * /* E Borne Sup de l'intervalle de lecture */,
- int * /* E/S Pas d'iteration a lire */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- char * /* E Nom de la variable a lire */,
- int /* E Nombre max de valeurs a lire */,
- int * /* S Nombre de valeurs rellement lues */,
- int ** /* E/S Tableau d'entiers pour stocker les */
- /* valeurs lues */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ float * /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ float * /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration a lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ int ** /* E/S Tableau d'entiers pour stocker les */
+ /* valeurs lues */
#endif
);
-extern int ecp_lre(
-/* ------ */
+extern int ecp_lre(
+/* ------ */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance ou de lecture */
- /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
- float * /* E/S Borne inf de l'intervalle de lecture */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- float * /* E Borne Sup de l'intervalle de lecture */,
- int * /* E/S Pas d'iteration a lire */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- char * /* E Nom de la variable a lire */,
- int /* E Nombre max de valeurs a lire */,
- int * /* S Nombre de valeurs rellement lues */,
- float **/* E/S Tableau de flottants pour stocker les */
- /* valeurs lues */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ float * /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ float * /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration a lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ float **/* E/S Tableau de flottants pour stocker les */
+ /* valeurs lues */
#endif
);
-extern int ecp_ldb(
-/* ------ */
+extern int ecp_ldb(
+/* ------ */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance ou de lecture */
- /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
- double* /* E/S Borne inf de l'intervalle de lecture */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- double* /* E Borne Sup de l'intervalle de lecture */,
- int * /* E/S Pas d'iteration a lire */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- char * /* E Nom de la variable a lire */,
- int /* E Nombre max de valeurs a lire */,
- int * /* S Nombre de valeurs rellement lues */,
- double**/* E/S Tableau de doubles pour stocker les */
- /* valeurs lues */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ double* /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ double* /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration a lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ double**/* E/S Tableau de doubles pour stocker les */
+ /* valeurs lues */
#endif
);
-extern int ecp_lcp(
-/* ------ */
+extern int ecp_lcp(
+/* ------ */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance ou de lecture */
- /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
- float * /* E/S Borne inf de l'intervalle de lecture */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- float * /* E Borne Sup de l'intervalle de lecture */,
- int * /* E/S Pas d'iteration lire */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- char * /* E Nom de la variable a lire */,
- int /* E Nombre max de valeurs a lire */,
- int * /* S Nombre de valeurs rellement lues */,
- float **/* E/S Tableau de flottants pour stocker les */
- /* valeurs lues (dimension = 2 * le nombre */
- /* de valeurs lues) */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ float * /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ float * /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ float **/* E/S Tableau de flottants pour stocker les */
+ /* valeurs lues (dimension = 2 * le nombre */
+ /* de valeurs lues) */
#endif
);
-extern int ecp_llo(
-/* ------ */
+extern int ecp_llo(
+/* ------ */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance ou de lecture */
- /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
- float * /* E/S Borne inf de l'intervalle de lecture */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- float * /* E Borne Sup de l'intervalle de lecture */,
- int * /* E/S Pas d'iteration a lire */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- char * /* E Nom de la variable a lire */,
- int /* E Nombre max de valeurs a lire */,
- int * /* S Nombre de valeurs rellement lues */,
- int ** /* E/S Tableau d 'entier pour stocker les */
- /* valeurs lues (remplace le logiques) */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ float * /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ float * /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration a lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ int ** /* E/S Tableau d 'entier pour stocker les */
+ /* valeurs lues (remplace le logiques) */
#endif
);
-extern int ecp_lch(
-/* ------ */
+extern int ecp_lch(
+/* ------ */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance ou de lecture */
- /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
- float * /* E/S Borne inf de l'intervalle de lecture */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- float * /* E Borne Sup de l'intervalle de lecture */,
- int * /* E/S Pas d'iteration a lire */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- char * /* E Nom de la variable a lire */,
- int /* E Nombre max de valeurs a lire */,
- int * /* S Nombre de valeurs rellement lues */,
- char **[]/*E/S Tableau de chaines pour stocker les */
- /* valeurs lues (remplace le logiques) */,
- int /* E Taille des chaines du tablaeu */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ float * /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ float * /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration a lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ char **[]/*E/S Tableau de chaines pour stocker les */
+ /* valeurs lues (remplace le logiques) */,
+ int /* E Taille des chaines du tablaeu */
#endif
);
-/* */
-/* */
-/* Fonctions de lecture non bloquantes */
-/* */
-/* */
-extern int ecp_nlen(
-/* ------- */
+/* */
+/* */
+/* Fonctions de lecture non bloquantes */
+/* */
+/* */
+extern int ecp_nlen(
+/* ------- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance ou de lecture */
- /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
- float * /* E/S Borne inf de l'intervalle de lecture */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- float * /* E Borne Sup de l'intervalle de lecture */,
- int * /* E/S Pas d'iteration a lire */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- char * /* E Nom de la variable a lire */,
- int /* E Nombre max de valeurs a lire */,
- int * /* S Nombre de valeurs rellement lues */,
- int ** /* E/S Tableau d'entiers pour stocker les */
- /* valeurs lues */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ float * /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ float * /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration a lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ int ** /* E/S Tableau d'entiers pour stocker les */
+ /* valeurs lues */
#endif
);
-extern int ecp_nlre(
-/* ------- */
+extern int ecp_nlre(
+/* ------- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance ou de lecture */
- /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
- float * /* E/S Borne inf de l'intervalle de lecture */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- float * /* E Borne Sup de l'intervalle de lecture */,
- int * /* E/S Pas d'iteration a lire */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- char * /* E Nom de la variable a lire */,
- int /* E Nombre max de valeurs a lire */,
- int * /* S Nombre de valeurs rellement lues */,
- float **/* E/S Tableau de flottants pour stocker les */
- /* valeurs lues */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ float * /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ float * /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration a lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ float **/* E/S Tableau de flottants pour stocker les */
+ /* valeurs lues */
#endif
);
-extern int ecp_nldb(
-/* ------- */
+extern int ecp_nldb(
+/* ------- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance ou de lecture */
- /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
- double */* E/S Borne inf de l'intervalle de lecture */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- double */* E Borne Sup de l'intervalle de lecture */,
- int * /* E/S Pas d'iteration a lire */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- char * /* E Nom de la variable a lire */,
- int /* E Nombre max de valeurs a lire */,
- int * /* S Nombre de valeurs rellement lues */,
- double**/* E/S Tableau de doubles pour stocker les */
- /* valeurs lues */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ double */* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ double */* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration a lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ double**/* E/S Tableau de doubles pour stocker les */
+ /* valeurs lues */
#endif
);
-extern int ecp_nlcp(
-/* ------- */
+extern int ecp_nlcp(
+/* ------- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance ou de lecture */
- /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
- float * /* E/S Borne inf de l'intervalle de lecture */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- float * /* E Borne Sup de l'intervalle de lecture */,
- int * /* E/S Pas d'iteration lire */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- char * /* E Nom de la variable a lire */,
- int /* E Nombre max de valeurs a lire */,
- int * /* S Nombre de valeurs rellement lues */,
- float **/* E/S Tableau de flottants pour stocker les */
- /* valeurs lues (dimension = 2 * le nombre */
- /* de valeurs lues) */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ float * /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ float * /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ float **/* E/S Tableau de flottants pour stocker les */
+ /* valeurs lues (dimension = 2 * le nombre */
+ /* de valeurs lues) */
#endif
);
-extern int ecp_nllo(
-/* ------- */
+extern int ecp_nllo(
+/* ------- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance ou de lecture */
- /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
- float * /* E/S Borne inf de l'intervalle de lecture */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- float * /* E Borne Sup de l'intervalle de lecture */,
- int * /* E/S Pas d'iteration a lire */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- char * /* E Nom de la variable a lire */,
- int /* E Nombre max de valeurs a lire */,
- int * /* S Nombre de valeurs rellement lues */,
- int **/* E/S Tableau d 'entier pour stocker les */
- /* valeurs lues (remplace le logiques) */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ float * /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ float * /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration a lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ int **/* E/S Tableau d 'entier pour stocker les */
+ /* valeurs lues (remplace le logiques) */
#endif
);
-extern int ecp_nlch(
-/* ------- */
+extern int ecp_nlch(
+/* ------- */
#if CPNeedPrototype
- void * component /* Pointeur de type Superv_Component_i* sur le */
- /* composant SALOME Supervisable */,
- int /* E Type de dependance ou de lecture */
- /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
- float * /* E/S Borne inf de l'intervalle de lecture */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- float * /* E Borne Sup de l'intervalle de lecture */,
- int * /* E/S Pas d'iteration a lire */
- /* Retourne le pas lu dans le cas de */
- /* lecture sequentielle */,
- char * /* E Nom de la variable a lire */,
- int /* E Nombre max de valeurs a lire */,
- int * /* S Nombre de valeurs rellement lues */,
- char **[]/* E/S Tableau de chaines pour stocker les */
- /* valeurs lues (remplace le logiques) */,
- int /* E Taille des chaines du tablaeu */
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ float * /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ float * /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration a lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ char **[]/* E/S Tableau de chaines pour stocker les */
+ /* valeurs lues (remplace le logiques) */,
+ int /* E Taille des chaines du tablaeu */
#endif
);
class calcium_complex_port_uses :
public virtual CalciumGenericUsesPort< seq_u_manipulation<Ports::Calcium_Ports::seq_float,
- CORBA::Float >,
- Ports::Calcium_Ports::Calcium_Complex_Port,
- _repository_Calcium_Complex_Port_name
- >
+ CORBA::Float >,
+ Ports::Calcium_Ports::Calcium_Complex_Port,
+ _repository_Calcium_Complex_Port_name
+ >
{
public :
class calcium_double_port_uses :
public virtual CalciumGenericUsesPort< seq_u_manipulation<Ports::Calcium_Ports::seq_double,
- CORBA::Double >,
- Ports::Calcium_Ports::Calcium_Double_Port,
- _repository_Calcium_Double_Port_name
- >
+ CORBA::Double >,
+ Ports::Calcium_Ports::Calcium_Double_Port,
+ _repository_Calcium_Double_Port_name
+ >
{
public :
class calcium_intc_port_uses :
public virtual CalciumGenericUsesPort< seq_u_manipulation<Ports::Calcium_Ports::seq_long,
- CORBA::Long >,
- Ports::Calcium_Ports::Calcium_Intc_Port,
- _repository_Calcium_Intc_Port_name
- >
+ CORBA::Long >,
+ Ports::Calcium_Ports::Calcium_Intc_Port,
+ _repository_Calcium_Intc_Port_name
+ >
{
public :
class calcium_logical_port_uses :
public virtual CalciumGenericUsesPort< seq_u_manipulation<Ports::Calcium_Ports::seq_boolean,
- CORBA::Boolean >,
- Ports::Calcium_Ports::Calcium_Logical_Port,
- _repository_Calcium_Logical_Port_name
- >
+ CORBA::Boolean >,
+ Ports::Calcium_Ports::Calcium_Logical_Port,
+ _repository_Calcium_Logical_Port_name
+ >
{
public :
class calcium_long_port_uses :
public virtual CalciumGenericUsesPort< seq_u_manipulation<Ports::Calcium_Ports::seq_long_long,
- CORBA::LongLong >,
- Ports::Calcium_Ports::Calcium_Long_Port,
- _repository_Calcium_Long_Port_name
- >
+ CORBA::LongLong >,
+ Ports::Calcium_Ports::Calcium_Long_Port,
+ _repository_Calcium_Long_Port_name
+ >
{
public :
class calcium_real_port_uses :
public virtual CalciumGenericUsesPort< seq_u_manipulation<Ports::Calcium_Ports::seq_float,
- CORBA::Float >,
- Ports::Calcium_Ports::Calcium_Real_Port,
- _repository_Calcium_Real_Port_name
- >
+ CORBA::Float >,
+ Ports::Calcium_Ports::Calcium_Real_Port,
+ _repository_Calcium_Real_Port_name
+ >
{
public :
class calcium_string_port_uses :
public virtual CalciumGenericUsesPort< seq_u_manipulation<Ports::Calcium_Ports::seq_string,
- char * >,
- Ports::Calcium_Ports::Calcium_String_Port,
- _repository_Calcium_String_Port_name
- >
+ char * >,
+ Ports::Calcium_Ports::Calcium_String_Port,
+ _repository_Calcium_String_Port_name
+ >
{
public :
/**************************************/
void F_FUNC(cplin,CPLIN)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
- cal_int *max,cal_int *n, int *tab,cal_int *err STR_PLEN(nom));
+ cal_int *max,cal_int *n, int *tab,cal_int *err STR_PLEN(nom));
void F_FUNC(cpllg,CPLLG)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
cal_int *max,cal_int *n, long *tab,cal_int *err STR_PLEN(nom));
void F_FUNC(cplen,CPLEN)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
void F_FUNC(cplin,CPLIN)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
- cal_int *max,cal_int *n, int *tab,cal_int *err STR_PLEN(nom))
+ cal_int *max,cal_int *n, int *tab,cal_int *err STR_PLEN(nom))
{
char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
*err=cp_lin_fort_((void *)*compo,*dep,ti,tf,iter,cnom,*max,n,tab);
#else
fprintf(stderr,"End of CPLIN: %s : Can't use fortran INTEGER*4 because int C is not 32bits long on this machine.\n",
- cnom);
+ cnom);
#endif
free_str1(cnom);
}
*err=cp_llg_fort_((void *)*compo,*dep,ti,tf,iter,cnom,*max,n,tab);
#else
fprintf(stderr,"End of CPLLG: %s : Can't use fortran INTEGER*8 because long C is not 64bits long on this machine.\n",
- cnom);
+ cnom);
#endif
free_str1(cnom);
}
/* INTERFACES D'ECRITURE */
/***************************/
void F_FUNC(cpech,CPECH)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, char *tab,cal_int *err
- STR_PLEN(nom) STR_PLEN(tab));
+ STR_PLEN(nom) STR_PLEN(tab));
void F_FUNC(cpedb,CPEDB)(long *compo,cal_int *dep,double *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, double *tab,cal_int *err STR_PLEN(nom));
void F_FUNC(cpere,CPERE)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, float *tab,cal_int *err STR_PLEN(nom));
void F_FUNC(cpecp,CPECP)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, float *tab,cal_int *err STR_PLEN(nom));
void F_FUNC(cpelo,CPELO)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, int *tab,cal_int *err STR_PLEN(nom));
void F_FUNC(cpech,CPECH)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, char *tab,cal_int *err
- STR_PLEN(nom) STR_PLEN(tab))
+ STR_PLEN(nom) STR_PLEN(tab))
{
char ** tabChaine=NULL;
cal_int index=0,index2=0;
tabChaine[index][STR_LEN(tab)]='\0';
for (index2 = STR_LEN(tab) - 1; index2 >= 0; index2--) {
if ( tabChaine[index][index2] == ' ' ||
- tabChaine[index][index2] == '\0' )
- tabChaine[index][index2]='\0';
+ tabChaine[index][index2] == '\0' )
+ tabChaine[index][index2]='\0';
}
}
*err=cp_ein_fort_((void *)*compo,*dep,*ti,*iter,cnom,*n,tab);
#else
fprintf(stderr,"CPEIN: %s %f %d : Can't use fortran INTEGER*4 because int C is not 32bits long on this machine.\n",
- cnom, *ti,*iter);
+ cnom, *ti,*iter);
#endif
free_str1(cnom);
}
*err=cp_elg_fort_((void *)*compo,*dep,*ti,*iter,cnom,*n,tab);
#else
fprintf(stderr,"CPELG: %s %f %d : Can't use fortran INTEGER*8 because long C is not 64bits long on this machine.\n",
- cnom, *ti,*iter);
+ cnom, *ti,*iter);
#endif
free_str1(cnom);
}
#define CALCIUM_ECR_INTERFACE_C_H(_name,_timeType,_calInt,_type,_typeName,_qual,lastarg) \
- extern _calInt cp_##_name (void * component, _calInt mode, \
- _timeType t, _calInt i, \
- char * nomvar, _calInt nbelem, \
- _type _qual * data \
- lastarg ) ; \
+ extern _calInt cp_##_name (void * component, _calInt mode, \
+ _timeType t, _calInt i, \
+ char * nomvar, _calInt nbelem, \
+ _type _qual * data \
+ lastarg ) ; \
CALCIUM_ECR_INTERFACE_C_H(een_fort_,float ,cal_int,cal_int,integer,,);
#define CALCIUM_LECT_INTERFACE_C_H(_name,_timeType,_calInt,_type,_typeName,_qual,lastarg) \
- extern _calInt cp_##_name (void * component, _calInt mode, \
- _timeType * ti, _timeType * tf, _calInt * i, \
- char * nomvar, _calInt bufferLength, \
- _calInt * nRead, _type _qual * data \
- lastarg ) ; \
- \
+ extern _calInt cp_##_name (void * component, _calInt mode, \
+ _timeType * ti, _timeType * tf, _calInt * i, \
+ char * nomvar, _calInt bufferLength, \
+ _calInt * nRead, _type _qual * data \
+ lastarg ) ; \
+ \
CALCIUM_LECT_INTERFACE_C_H(len_fort_,float ,cal_int,cal_int ,integer,,);
static const double MAXVALUE = 150.0;
MyRand() { srand(getpid()); }
int operator()() const {
- return 1+(int) ( MAXVALUE *rand()/(RAND_MAX +1.0));
+ return 1+(int) ( MAXVALUE *rand()/(RAND_MAX +1.0));
}
};
//Calcul sans Lambda
// ERREUR : il faut produire une binary pas avec compose2
// std::transform(InIt1,InIt1+dataSize3,InIt2,OutIt2,
- // //std::minus<Type>(),
- // __gnu_cxx::compose2(std::minus<Type>(),
- // // __gnu_cxx::identity<Type>(),
- // std::bind2nd( std::multiplies<Type>(), 1. ),
- // std::bind2nd( std::multiplies<Type>(), 1.1 ) )
- // );
+ // //std::minus<Type>(),
+ // __gnu_cxx::compose2(std::minus<Type>(),
+ // // __gnu_cxx::identity<Type>(),
+ // std::bind2nd( std::multiplies<Type>(), 1. ),
+ // std::bind2nd( std::multiplies<Type>(), 1.1 ) )
+ // );
// InIt2 =vect2.begin();
// OutIt2=vect4.begin();
// std::transform(InIt2,InIt2+dataSize3,OutIt2,OutIt2,
- // std::plus<Type>() );
+ // std::plus<Type>() );
// Calcul direct
InIt1=vect1.begin(); InIt2=vect2.begin();OutIt2=vect4.begin();
DataIdContainer::iterator dataIdIt = dataIds.begin();
if (!dataIds.empty())
- for (;dataIdIt != dataIds.end();++dataIdIt) {
- std::cout << "(*dataIdIt) must be equal to given dataId parameter : " << *dataIdIt;
- std::cout << " == " << dataId << " : " << (ret = (*dataIdIt == dataId)) << std::endl;
- }
+ for (;dataIdIt != dataIds.end();++dataIdIt) {
+ std::cout << "(*dataIdIt) must be equal to given dataId parameter : " << *dataIdIt;
+ std::cout << " == " << dataId << " : " << (ret = (*dataIdIt == dataId)) << std::endl;
+ }
} catch(const CalciumException & ex) {
ret=1;
std::cout << ex.what() << std::endl;
int ret;
TEST2() {
- // Doit filtrer le mode de dépendance temporel car le mode est
+ // Doit filtrer le mode de dépendance temporel car le mode est
// défini itératif
ret=0;
if (!dataIds.empty())
for (;dataIdIt != dataIds.end();++dataIdIt) {
- std::cout << "(*dataIdIt) must be equal to given dataId parameter : " << *dataIdIt ;
- std::cout << " == " << DataId(0,tag) << " : " << (ret = (*dataIdIt == DataId(0,tag))) << std::endl;
+ std::cout << "(*dataIdIt) must be equal to given dataId parameter : " << *dataIdIt ;
+ std::cout << " == " << DataId(0,tag) << " : " << (ret = (*dataIdIt == DataId(0,tag))) << std::endl;
}
}
TEST3() {
- // Doit filtrer le mode de dépendance temporel car le mode est
+ // Doit filtrer le mode de dépendance temporel car le mode est
// défini itératif
ret=0;
if (!dataIds.empty())
for (;dataIdIt != dataIds.end();++dataIdIt) {
- std::cout << "(*dataIdIt) must be equal to given dataId parameter : " << *dataIdIt ;
- std::cout << " == " << DataId(time,0) << " : " << (ret = (*dataIdIt == DataId(time,0))) << std::endl;
+ std::cout << "(*dataIdIt) must be equal to given dataId parameter : " << *dataIdIt ;
+ std::cout << " == " << DataId(time,0) << " : " << (ret = (*dataIdIt == DataId(time,0))) << std::endl;
}
}
#ifndef __VERSION_H
#define __VERSION_H
-/* Constantes servant a memoriser les repertoires des versions */
-/* de CALCIUM et de PVM ayant servi a la generation d'un */
-/* executable */
+/* Constantes servant a memoriser les repertoires des versions */
+/* de CALCIUM et de PVM ayant servi a la generation d'un */
+/* executable */
-#define ACCC_REP "/home/fayolle/CALCIUM3.0"
-#define PVM_REP "/home/fayolle/pvm3"
+#define ACCC_REP "/home/fayolle/CALCIUM3.0"
+#define PVM_REP "/home/fayolle/pvm3"
#endif
// Operation de création
// static inline Type create(size_t size=1,InnerType * data=NULL,
-// bool giveOwnerShip=false) {
+// bool giveOwnerShip=false) {
// Type dummy;
// if (dataPtr)
// return *data;
// (généralement pas de recopie qlq soit l'ownership )
// data doit avoir été alloué par allocPointer si giveOwnerShip = true
static inline Type create(size_t size, InnerType * const data = NULL,
- bool giveOwnerShip = false ) {
+ bool giveOwnerShip = false ) {
Type tmp;
if (!data) {
tmp = new seq_T();
// (généralement pas de recopie qlq soit l'ownership )
// data doit avoir été alloué par allocPointer si giveOwnerShip = true
static inline Type create(size_t size, InnerType * const data = NULL,
- bool giveOwnerShip = false ) {
+ bool giveOwnerShip = false ) {
Type tmp;
if (!data) {
tmp = new seq_T();
// wDataIt1->first < wdataId < (wDataIt1+1)->first
template < typename Container >
bool isDataIdConveniant(Container & storedDatas,
- const typename Container::key_type & expectedDataId,
- bool & isEqual , bool & isBounded,
- typename Container::iterator & wDataIt1 ) const {
+ const typename Container::key_type & expectedDataId,
+ bool & isEqual , bool & isBounded,
+ typename Container::iterator & wDataIt1 ) const {
typedef typename Container::key_type key_type;
typedef typename Container::value_type value_type;
typedef typename Container::iterator iterator;
BoundedDataIdProcessor(const CouplingPolicy & couplingPolicy) {};
template < typename Iterator, typename DataId >
void inline apply(typename iterator_t<Iterator>::value_type & data,
- const DataId & dataId,
- const Iterator & it1) const {
+ const DataId & dataId,
+ const Iterator & it1) const {
typedef typename iterator_t<Iterator>::value_type value_type;
std::cout << "-------- Generic BoundedDataIdProcessor.apply() called " << std::endl;
template < typename Container >
void apply(Container & storedDatas,
- typename Container::iterator & wDataIt1 ) const {
+ typename Container::iterator & wDataIt1 ) const {
typedef typename Container::key_type key_type;
typedef typename Container::value_type value_type;
typedef typename Container::iterator iterator;
template < typename Container, typename DataId >
bool apply(Container & storedDatas,
- const DataId & expectedDataId,
- typename Container::iterator & wDataIt1 ) const {
+ const DataId & expectedDataId,
+ typename Container::iterator & wDataIt1 ) const {
typedef typename Container::key_type key_type;
typedef typename Container::value_type value_type;
typedef typename Container::iterator iterator;
// Si la longueur du filtre est 1
if ((*i).filtre.len == 1) {
- // Si la valeur initiale correspond à la valeur du filtre
- if ((*i).filtre.debut == valeur_initiale)
- si_passe_filtre = true;
+ // Si la valeur initiale correspond à la valeur du filtre
+ if ((*i).filtre.debut == valeur_initiale)
+ si_passe_filtre = true;
} else {
- // Si la valeur initiale est dans la séquence des valeurs du filtre
- // la valeur est comprise dans les bornes [debut,fin]
- // et sa distance du début de la séquence est modulo le pas
- if ( ((*i).filtre.fin - valeur_initiale >= 0) == (valeur_initiale - (*i).filtre.debut >= 0)
+ // Si la valeur initiale est dans la séquence des valeurs du filtre
+ // la valeur est comprise dans les bornes [debut,fin]
+ // et sa distance du début de la séquence est modulo le pas
+ if ( ((*i).filtre.fin - valeur_initiale >= 0) == (valeur_initiale - (*i).filtre.debut >= 0)
&& (valeur_initiale - (*i).filtre.debut) % (*i).filtre.pas == 0 ) {
- si_passe_filtre = true;
- }
+ si_passe_filtre = true;
+ }
}
// Si la valeur initiale passe le filtre
if (si_passe_filtre) {
- // cout << "config: filtre passe " << endl;
+ // cout << "config: filtre passe " << endl;
- // Si il y a une conversion à effectuer
- if ((*i).p_convers != NULL) {
+ // Si il y a une conversion à effectuer
+ if ((*i).p_convers != NULL) {
- // Si la longueur du filtre est 1
- if ((*i).filtre.len == 1) {
+ // Si la longueur du filtre est 1
+ if ((*i).filtre.len == 1) {
- // Si la longueur des paramètres de conversion est aussi 1
- if ((*i).p_convers->len == 1) {
- // Ajoute la valeur de conversion à la liste des valeurs après conversion
- liste_conversions.push_back ((*i).p_convers->debut);
- } else {
- // Ajoute la séquence de conversion à la liste des valeurs après conversion
- for (int s = (*i).p_convers->debut; s != (*i).p_convers->fin; s += (*i).p_convers->pas) {
- liste_conversions.push_back (s);
- }
- liste_conversions.push_back ((*i).p_convers->fin);
- }
+ // Si la longueur des paramètres de conversion est aussi 1
+ if ((*i).p_convers->len == 1) {
+ // Ajoute la valeur de conversion à la liste des valeurs après conversion
+ liste_conversions.push_back ((*i).p_convers->debut);
+ } else {
+ // Ajoute la séquence de conversion à la liste des valeurs après conversion
+ for (int s = (*i).p_convers->debut; s != (*i).p_convers->fin; s += (*i).p_convers->pas) {
+ liste_conversions.push_back (s);
+ }
+ liste_conversions.push_back ((*i).p_convers->fin);
+ }
- } else {
- // Le filtre est une séquence qui est convertie en une autre séquence de même longueur
- // Choisit la valeur au rang désiré dans la séquence de conversion
- int rang = (valeur_initiale - (*i).filtre.debut) / (*i).filtre.pas;
+ } else {
+ // Le filtre est une séquence qui est convertie en une autre séquence de même longueur
+ // Choisit la valeur au rang désiré dans la séquence de conversion
+ int rang = (valeur_initiale - (*i).filtre.debut) / (*i).filtre.pas;
- int valeur_convertie = (*i).p_convers->debut + rang * (*i).p_convers->pas;
+ int valeur_convertie = (*i).p_convers->debut + rang * (*i).p_convers->pas;
- // Ajoute cette valeur à la liste des valeurs après conversion
- liste_conversions.push_back (valeur_convertie);
- }
- } else {
- // Ajoute la valeur initiale telle-quelle à la liste des valeurs après conversion
- liste_conversions.push_back (valeur_initiale);
- }
+ // Ajoute cette valeur à la liste des valeurs après conversion
+ liste_conversions.push_back (valeur_convertie);
+ }
+ } else {
+ // Ajoute la valeur initiale telle-quelle à la liste des valeurs après conversion
+ liste_conversions.push_back (valeur_initiale);
+ }
}
}
// template <typename T1, typename T2, typename T3>
// struct FindKeyPredicate< std::pair<const std::pair<T1,T2>, T3 > > :
// public std::binary_function < std::pair<const std::pair<T1,T2>, T3 >,
-// std::pair<const std::pair<T1,T2>, T3 >, bool >
+// std::pair<const std::pair<T1,T2>, T3 >, bool >
// {
// std::pair<T1,T2> _value;
// FindKeyPredicate(const std::pair<T1,T2> & value):_value(value){
// std::cout << "1-Initializing with value " << _value << std::endl;
// }
// bool operator()( const std::pair<const std::pair<T1,T2>, T3 > & v1,
-// const std::pair<const std::pair<T1,T2>, T3 > v2) const {
+// const std::pair<const std::pair<T1,T2>, T3 > v2) const {
// std::cout << "1-> :" << v1 << "," << v2 << " " << std::endl;
// return (v1.first <= _value ) && (_value < v2.first) ;
// }
template <typename DataManipulator, typename CouplingPolicy, typename ProvidesPort=provides_port>
class GenericProvidesPort : public ProvidesPort,
- public GenericPort< DataManipulator , CouplingPolicy > {
+ public GenericPort< DataManipulator , CouplingPolicy > {
public :
// Type de données manipulés
typedef typename DataManipulator::Type DataType;
#include "DSC_Exception.hxx"
-// #define GENERATE_USES_PORT(dataManip,portType,portName) \
+// #define GENERATE_USES_PORT(dataManip,portType,portName) \
// const char * _repository_##portType##_name_ = "IDL:Ports/##portType##:1.0"; \
// GenericUsesPort< dataManip, portType, _repository_##portType##_name_ > portName;
//ex : GENERATE_USES_PORT(Ports::Data_Short_Port,data_short_port);
template <typename DataManipulator, typename CorbaPortType, char * repositoryName,
- typename UsesPort=uses_port >
+ typename UsesPort=uses_port >
class GenericUsesPort : public UsesPort
{
public :
void put(CorbaInDataType data, TimeType time, TagType tag);
virtual void uses_port_changed(Engines::DSC::uses_port * new_uses_port,
- const Engines::DSC::Message message);
+ const Engines::DSC::Message message);
protected :
Engines::DSC::uses_port * _my_ports;
template <typename TimeType,typename TagType>
void
GenericUsesPort< DataManipulator,CorbaPortType, repositoryName, UsesPort >::put( CorbaInDataType data,
- TimeType time,
- TagType tag) {
+ TimeType time,
+ TagType tag) {
typedef typename CorbaPortType::_var_type CorbaPortTypeVar;
if (!_my_ports)
throw DSC_Exception(LOC("There is no connected provides port to communicate with."));
} catch(const CORBA::SystemException& ex) {
//OLD : DataManipulator::delete_data(copyOfData);
throw DSC_Exception(LOC(OSS() << "Can't invoke put method on port number "
- << i << "( i>= 0)"));
+ << i << "( i>= 0)"));
}
//if (i) PB1
template <typename DataManipulator, typename CorbaPortType, char * repositoryName, typename UsesPort>
void
GenericUsesPort< DataManipulator, CorbaPortType, repositoryName, UsesPort
- >::uses_port_changed(Engines::DSC::uses_port * new_uses_port,
- const Engines::DSC::Message message)
+ >::uses_port_changed(Engines::DSC::uses_port * new_uses_port,
+ const Engines::DSC::Message message)
{
if (_my_ports) delete _my_ports;
policy.filtre_convert_TIME.applique_filtre_conversion(dataId.first, _lTime);
int c=0;
for(std::vector<CORBA::Long>::iterator i=_lTime.begin();i!=_lTime.end();++i)
- std::cout << "_lTime["<< c++ << "] : " << *i << std::endl;
+ std::cout << "_lTime["<< c++ << "] : " << *i << std::endl;
policy.filtre_convert_TAG.applique_filtre_conversion(dataId.second, _lTag);
c=0;
for(std::vector<CORBA::Long>::iterator i=_lTag.begin();i!=_lTag.end();++i)
- std::cout << "_lTag["<< c++ << "] : " << *i << std::endl;
+ std::cout << "_lTag["<< c++ << "] : " << *i << std::endl;
}
// Pas encore testé
// Pas encore testé
DataIdIterator(const InternalDataIdContainer<TTIME,TTAG> & pc):
- _pc(pc),_itTime(pc._lTime.begin()),_itTag(pc._lTag.begin()) {}
+ _pc(pc),_itTime(pc._lTime.begin()),_itTag(pc._lTag.begin()) {}
DataIdIterator(const InternalDataIdContainer<TTIME,TTAG> & pc, ItTime itTime, ItTag itTag):
- _pc(pc),_itTime(itTime),_itTag(itTag) {}
+ _pc(pc),_itTime(itTime),_itTag(itTag) {}
// Pas encore testé
DataIdIterator(const DataIdIterator & dIt):
- _pc(dIt._pc),_itTime(dIt._itTime),_itTag(dIt._itTag) {}
+ _pc(dIt._pc),_itTime(dIt._itTime),_itTag(dIt._itTag) {}
~DataIdIterator() {}
// Pas encore testé
DataIdIterator & operator=(const DataIdIterator & dIt) {
- if (this != &dIt) {
- _pc=dIt._pc;_itTime=dIt._itTime;_itTag=dIt._itTag;
- }
- return *this;
+ if (this != &dIt) {
+ _pc=dIt._pc;_itTime=dIt._itTime;_itTag=dIt._itTag;
+ }
+ return *this;
}
DataId operator*() const {
- std::cout << "-------- operator*(), *_itTime : " << *_itTime << " *_itTag " << *_itTag <<std::endl;
- return DataId(*_itTime,*_itTag); }
+ std::cout << "-------- operator*(), *_itTime : " << *_itTime << " *_itTag " << *_itTag <<std::endl;
+ return DataId(*_itTime,*_itTag); }
bool operator==( const DataIdIterator & dIt) const {
- return (_itTime == dIt._itTime) && (_itTag == dIt._itTag) && (&_pc == &dIt._pc);
+ return (_itTime == dIt._itTime) && (_itTag == dIt._itTag) && (&_pc == &dIt._pc);
}
bool operator!=( const DataIdIterator & dIt) const {
- return (_itTime != dIt._itTime) || (_itTag != dIt._itTag) || (&_pc != &dIt._pc);
+ return (_itTime != dIt._itTime) || (_itTag != dIt._itTag) || (&_pc != &dIt._pc);
}
// Notation préfixé
DataIdIterator & operator++() {
- if ( _itTag != _pc._lTag.end() ) {
- ++_itTag;
- if (_itTag != _pc._lTag.end() ) return *this;
- }
- if ( _itTime != _pc._lTime.end() ) {
- ++_itTime;
- if (_itTime != _pc._lTime.end() ) _itTag=_pc._lTag.begin();
- }
- return *this;
+ if ( _itTag != _pc._lTag.end() ) {
+ ++_itTag;
+ if (_itTag != _pc._lTag.end() ) return *this;
+ }
+ if ( _itTime != _pc._lTime.end() ) {
+ ++_itTime;
+ if (_itTime != _pc._lTime.end() ) _itTag=_pc._lTag.begin();
+ }
+ return *this;
}
// Notation postfixé
DataIdIterator operator++(int fake) {
- DataIdIterator tmpIt=*this; ++*this; return tmpIt;
+ DataIdIterator tmpIt=*this; ++*this; return tmpIt;
}
}; //Fin de la classe de l'itérateur
public virtual POA_Ports::Palm_Ports::Palm_Data_Seq_Short_Port,
public virtual provides_port,
public virtual GenericPort< seq_u_manipulation<Ports::Palm_Ports::seq_short, CORBA::Short>,
- PalmCouplingPolicy >
+ PalmCouplingPolicy >
{
typedef Ports::Palm_Ports::seq_short CorbaDataType;
typedef seq_u_manipulation<CorbaDataType, CORBA::Short> DataManipulator;
// template < typename Iterator >
// typename iterator_t<Iterator>::value_type
// CalciumCoulpingPolicy::processTimeInterval (DataId & dataId,
-// Iterator & it1, Iterator & it2);
+// Iterator & it1, Iterator & it2);
#include "CalciumCouplingPolicy.hxx"
template <> struct ProcessTimeIntervalTraits<CalciumCouplingPolicy> {
static const double MAXVALUE = 150.0;
MyRand() { srand(getpid()); }
int operator()() const {
- return 1+(int) ( MAXVALUE *rand()/(RAND_MAX +1.0));
+ return 1+(int) ( MAXVALUE *rand()/(RAND_MAX +1.0));
}
};
-
+
// if ( it == vect.end() ) {
// std::cout << " Je n'ai pas trouvé la valeur " << valueToFind << std::endl;
// } else {
// Type min,max;
// if ( ap.getBounds(min,max) ) {
// it2=it;it2--;
-// std::cout << "La valeur : " << valueToFind << " est encadrée par (*it) :" << (*it) << " et valeur de *(it-1) :" << (*it2) << std::endl;
+// std::cout << "La valeur : " << valueToFind << " est encadrée par (*it) :" << (*it) << " et valeur de *(it-1) :" << (*it2) << std::endl;
// }
// }
// }
// AdjacentFunctor<MapIntDouble::value_type::first_type> apMap(valueToFind);
// for (itM1 = myMap.begin(); itM1 != myMap.end(); ++itM1)
// if ( apMap(itM1->first) ) break;
-
+
// if ( itM1 == myMap.end() ) {
// std::cout << " Je n'est pas trouvé la valeur " << valueToFind << std::endl;
// } else {
// Type min,max;
// if ( apMap.getBounds(min,max) ) {
// itM2=itM1;itM2--;
-// std::cout << "La valeur " << valueToFind << " est encadrée par (itM1->first) :" << (itM1->first) << " et valeur de (it-1)->first :" << (itM2->first) << std::endl;
+// std::cout << "La valeur " << valueToFind << " est encadrée par (itM1->first) :" << (itM1->first) << " et valeur de (it-1)->first :" << (itM2->first) << std::endl;
// }
// }
// }
// MapIntDouble_Double::key_type min,max;
// if ( apMapP.getBounds(min,max) ) {
// itMP2=itMP1;itMP2--;
-// std::cout << "La valeur " << valuePToFind << " est encadrée par (itMP1->first) :" << (itMP1->first) << " et valeur de (it-1)->first :" << (itMP2->first) << std::endl;
+// std::cout << "La valeur " << valuePToFind << " est encadrée par (itMP1->first) :" << (itMP1->first) << " et valeur de (it-1)->first :" << (itMP2->first) << std::endl;
// }
// }
// }
static const double MAXVALUE = 150.0;
MyRand() { srand(getpid()); }
int operator()() const {
- return 1+(int) ( MAXVALUE *rand()/(RAND_MAX +1.0));
+ return 1+(int) ( MAXVALUE *rand()/(RAND_MAX +1.0));
}
};
template < typename DataType >
DataType processTimeInterval (DataId & dataId,
- typename std::map<DataId, DataType>::const_iterator const & it1) {
+ typename std::map<DataId, DataType>::const_iterator const & it1) {
return (*it1).second;
};
Superv_Component_i::Superv_Component_i(CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName,
- bool notif) :
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId * contId,
+ const char *instanceName,
+ const char *interfaceName,
+ bool notif) :
Engines_DSC_i(orb, poa, contId, instanceName, interfaceName)
{
#ifdef MYDEBUG
setTimeOut();
}
Superv_Component_i::Superv_Component_i(CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- Engines::Container_ptr container,
- const char *instanceName,
- const char *interfaceName,
- bool notif,
+ PortableServer::POA_ptr poa,
+ Engines::Container_ptr container,
+ const char *instanceName,
+ const char *interfaceName,
+ bool notif,
bool regist) :
Engines_DSC_i(orb, poa, container, instanceName, interfaceName,notif,regist)
{
void
Superv_Component_i::register_factory(const std::string & factory_name,
- port_factory * factory_ptr)
+ port_factory * factory_ptr)
{
factory_map_t::iterator it = _factory_map.find(factory_name);
if (rtn_port == NULL)
throw BadFabType( LOC(OSS()<< "No way to get the port factory "
- <<port_fab_type));
+ <<port_fab_type));
return rtn_port;
}
if (rtn_proxy == NULL)
throw BadFabType( LOC(OSS()<< "No way to get the port factory "
- <<port_fab_type));
+ <<port_fab_type));
return rtn_proxy;
}
void
Superv_Component_i::add_port(const char * port_fab_type,
- const char * port_type,
- const char * port_name)
+ const char * port_type,
+ const char * port_name)
throw (PortAlreadyDefined, BadFabType, BadType, BadProperty)
{
assert(port_fab_type);
}
else
throw BadType( LOC(OSS()<< "port_type must be either 'provides' either 'uses' not "
- << port_type));
+ << port_type));
}
void
Superv_Component_i::add_port(provides_port * port,
- const char* provides_port_name)
+ const char* provides_port_name)
throw (PortAlreadyDefined, NilPort, BadProperty)
{
assert(port);
Ports::PortProperties_var portproperties=port->get_port_properties();
Ports::Port_var portref=port->get_port_ref();
Engines_DSC_interface::add_provides_port(portref,
- provides_port_name,
- portproperties);
+ provides_port_name,
+ portproperties);
superv_port_t * new_superv_port = new superv_port_t();
new_superv_port->p_ref = port;
}
catch (const Engines::DSC::PortAlreadyDefined&) {
throw PortAlreadyDefined( LOC(OSS()<< "provides port "
- << provides_port_name <<" already exist."));
+ << provides_port_name <<" already exist."));
}
catch (const Engines::DSC::NilPort&) {
throw NilPort( LOC(OSS()<< "provides port pointer is nul."));
void
Superv_Component_i::add_port(uses_port * port,
- const char* uses_port_name)
+ const char* uses_port_name)
throw (PortAlreadyDefined, NilPort, BadProperty)
{
assert(port);
try {
Ports::PortProperties_var portproperties=port->get_port_properties();
Engines_DSC_interface::add_uses_port(port->get_repository_id(),
- uses_port_name,
- portproperties);
+ uses_port_name,
+ portproperties);
superv_port_t * new_superv_port = new superv_port_t();
new_superv_port->u_ref = port;
my_superv_ports[uses_port_name] = new_superv_port;
}
catch (const Engines::DSC::PortAlreadyDefined&) {
throw PortAlreadyDefined( LOC(OSS()<< "uses port "
- << uses_port_name <<" already exists."));
+ << uses_port_name <<" already exists."));
}
catch (const Engines::DSC::NilPort&) {
throw NilPort( LOC(OSS()<< "uses port pointer is nul."));
void
Superv_Component_i::get_port(provides_port *& port,
- const char * provides_port_name)
+ const char * provides_port_name)
throw (PortNotDefined,PortNotConnected)
{
assert(provides_port_name);
port = my_superv_ports[provides_port_name]->p_ref;
} catch (const Engines::DSC::PortNotDefined&) {
throw PortNotDefined( LOC(OSS()<< "provides port "
- << provides_port_name <<" does not exist."));
+ << provides_port_name <<" does not exist."));
} catch (const Engines::DSC::PortNotConnected&) {
throw PortNotConnected( LOC(OSS()<< "provides port " << provides_port_name
- << " is not connected."));
+ << " is not connected."));
}
}
void
Superv_Component_i::get_port(uses_port *& port,
- const char * uses_port_name)
+ const char * uses_port_name)
throw (PortNotDefined, PortNotConnected)
{
assert(uses_port_name);
port = my_superv_ports[uses_port_name]->u_ref;
} catch (const Engines::DSC::PortNotDefined&) {
throw PortNotDefined( LOC(OSS()<< "uses port "
- << uses_port_name <<" does not exist."));
+ << uses_port_name <<" does not exist."));
} catch (const Engines::DSC::PortNotConnected&) {
throw PortNotConnected( LOC(OSS()<< "uses port " << uses_port_name
- << " is not connected."));
+ << " is not connected."));
}
}
void
Superv_Component_i::provides_port_changed(const char* provides_port_name,
- int connection_nbr,
- const Engines::DSC::Message message)
+ int connection_nbr,
+ const Engines::DSC::Message message)
{
my_superv_ports_it = my_superv_ports.find(provides_port_name);
if (my_superv_ports_it != my_superv_ports.end())
my_superv_ports[provides_port_name]->p_ref->provides_port_changed(connection_nbr,
- message);
+ message);
}
void
Superv_Component_i::uses_port_changed(const char* uses_port_name,
- Engines::DSC::uses_port * new_uses_port,
- const Engines::DSC::Message message)
+ Engines::DSC::uses_port * new_uses_port,
+ const Engines::DSC::Message message)
{
my_superv_ports_it = my_superv_ports.find(uses_port_name);
if (my_superv_ports_it != my_superv_ports.end())
my_superv_ports[uses_port_name]->u_ref->uses_port_changed(new Engines::DSC::uses_port(*new_uses_port),
- message);
+ message);
//delete the copy made by the caller
delete new_uses_port;
}
void
Superv_Component_i::get_uses_port_names(std::vector<std::string> & port_names,
- const std::string servicename) const {
+ const std::string servicename) const {
port_names.reserve(my_superv_ports.size());
{
public:
Superv_Component_i(CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName,
- bool notif = false);
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId * contId,
+ const char *instanceName,
+ const char *interfaceName,
+ bool notif = false);
Superv_Component_i(CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- Engines::Container_ptr container,
- const char *instanceName,
- const char *interfaceName,
- bool notif = false,
+ PortableServer::POA_ptr poa,
+ Engines::Container_ptr container,
+ const char *instanceName,
+ const char *interfaceName,
+ bool notif = false,
bool regist = true );
virtual ~Superv_Component_i();
* \param port_name the name of the port in the component.
*/
virtual void add_port(const char * port_fab_type,
- const char * port_type,
- const char * port_name)
+ const char * port_type,
+ const char * port_name)
throw (PortAlreadyDefined, BadFabType, BadType, BadProperty);
/*!
*/
template < typename SpecificPortType >
SpecificPortType * add_port(const char * port_fab_type,
- const char * port_type,
- const char * port_name)
+ const char * port_type,
+ const char * port_name)
throw (PortAlreadyDefined, BadFabType, BadType, BadCast, BadProperty);
/*!
* \param provides_port_name the name of the port in the component.
*/
virtual void add_port(provides_port * port,
- const char* provides_port_name)
+ const char* provides_port_name)
throw (PortAlreadyDefined, NilPort, BadProperty);
/*!
* \param uses_port_name the name of the port in the component.
*/
virtual void add_port(uses_port * port,
- const char* uses_port_name)
+ const char* uses_port_name)
throw (PortAlreadyDefined, NilPort, BadProperty);
/*!
* \param provides_port_name the name of the port.
*/
virtual void get_port(provides_port *& port,
- const char* provides_port_name)
+ const char* provides_port_name)
throw (PortNotDefined, PortNotConnected);
/*!
* \param uses_port_name the name of the port.
*/
virtual void get_port(uses_port *& port,
- const char* uses_port_name)
+ const char* uses_port_name)
throw (PortNotDefined, PortNotConnected);
/*!
* \param servicename service's name.
*/
virtual void get_uses_port_names(std::vector<std::string> & port_names,
- const std::string servicename="") const;
+ const std::string servicename="") const;
/*!
* Gets a port already added in the component.
* \see DSC_Callbacks::provides_port_changed
*/
virtual void provides_port_changed(const char* provides_port_name,
- int connection_nbr,
- const Engines::DSC::Message message);
+ int connection_nbr,
+ const Engines::DSC::Message message);
/*!
* \see DSC_Callbacks::uses_port_changed
*/
virtual void uses_port_changed(const char* uses_port_name,
- Engines::DSC::uses_port * new_uses_port,
- const Engines::DSC::Message message);
+ Engines::DSC::uses_port * new_uses_port,
+ const Engines::DSC::Message message);
/*!
* \param factory_ptr factory pointer (destroyed by the component)
*/
static void register_factory(const std::string & factory_name,
- port_factory * factory_ptr);
+ port_factory * factory_ptr);
/*!
* Get a factory from the component.
template < typename SpecificPortType > SpecificPortType *
Superv_Component_i::add_port(const char * port_fab_type,
- const char * port_type,
- const char * port_name)
+ const char * port_type,
+ const char * port_name)
throw (PortAlreadyDefined, BadFabType, BadType, BadCast, BadProperty)
{
assert(port_fab_type);
}
else
throw BadType(LOC(OSS()<< "port_type must be either 'provides' either 'uses' not "
- << port_type));
+ << port_type));
return retPort;
};
}
} catch (const Engines::DSC::PortNotDefined&) {
throw PortNotDefined( LOC(OSS()<< "port "
- << port_name <<" does not exist."));
+ << port_name <<" does not exist."));
} catch (const Engines::DSC::PortNotConnected&) {
throw PortNotConnected( LOC(OSS()<< "port " << port_name
- << " is not connected."));
+ << " is not connected."));
}
retPort = dynamic_cast<SpecificPortType *>(port);
* \param message message associated with this connection.
*/
virtual void provides_port_changed(int connection_nbr,
- const Engines::DSC::Message message) {}
+ const Engines::DSC::Message message) {}
};
* \param message message associated with this modification.
*/
virtual void uses_port_changed(Engines::DSC::uses_port * new_uses_port,
- const Engines::DSC::Message message) = 0;
+ const Engines::DSC::Message message) = 0;
};
#include "ParallelDSC_i.hxx"
Engines_ParallelDSC_i::Engines_ParallelDSC_i(CORBA::ORB_ptr orb,
- char * ior,
- int rank,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName,
- bool notif) :
+ char * ior,
+ int rank,
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId * contId,
+ const char *instanceName,
+ const char *interfaceName,
+ bool notif) :
Engines_Parallel_Component_i(orb, ior, rank, poa, contId, instanceName, interfaceName, notif),
Engines::Parallel_DSC_serv(orb, ior, rank),
Engines::Parallel_DSC_base_serv(orb, ior, rank),
void
Engines_ParallelDSC_i::set_paco_proxy(const CORBA::Object_ptr ref,
- const char* provides_port_name,
- Ports::PortProperties_ptr port_prop) {
+ const char* provides_port_name,
+ Ports::PortProperties_ptr port_prop) {
assert(provides_port_name);
Engines_DSC_interface::add_provides_port(Ports::Port::_narrow(ref),
- provides_port_name,
- port_prop);
+ provides_port_name,
+ port_prop);
// Waiting that all the nodes have the proxy
_my_com->paco_barrier();
cerr << "set_paco_proxy node fin" << endl;
Engines_ParallelDSC_i::get_proxy(const char* provides_port_name) {
char * rtn_char = NULL;
Ports::Port_ptr proxy = Engines_DSC_interface::get_provides_port(provides_port_name,
- 0);
+ 0);
if (!CORBA::is_nil(proxy))
rtn_char = (char *) _orb->object_to_string(proxy);
return rtn_char;
CORBA::Boolean
Engines_ParallelDSC_i::add_parallel_provides_proxy_port(const CORBA::Object_ptr ref,
- const char * provides_port_name,
- Ports::PortProperties_ptr port_prop)
+ const char * provides_port_name,
+ Ports::PortProperties_ptr port_prop)
{
assert(provides_port_name);
CORBA::Boolean rtn_bool = false;
{
sleep(1);
try {
- proxy = (char *) get_proxy(provides_port_name);
+ proxy = (char *) get_proxy(provides_port_name);
}
catch(...) {}
}
CORBA::Boolean
Engines_ParallelDSC_i::add_parallel_provides_node_port(Ports::Port_PaCO_ptr ref,
- const char* provides_port_name)
+ const char* provides_port_name)
{
CORBA::Boolean rtn_bool = false;
PaCO::InterfaceParallel_var node = PaCO::InterfaceParallel::_narrow(ref);
{
public:
Engines_ParallelDSC_i(CORBA::ORB_ptr orb,
- char * ior,
- int rank,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName,
- bool notif = false);
+ char * ior,
+ int rank,
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId * contId,
+ const char *instanceName,
+ const char *interfaceName,
+ bool notif = false);
virtual ~Engines_ParallelDSC_i();
* \see Engines::DSC::add_provides_port
*/
virtual void add_provides_port(Ports::Port_ptr ref,
- const char* provides_port_name,
- Ports::PortProperties_ptr port_prop)
+ const char* provides_port_name,
+ Ports::PortProperties_ptr port_prop)
throw (Engines::DSC::PortAlreadyDefined,
- Engines::DSC::NilPort,
- Engines::DSC::BadProperty) {
+ Engines::DSC::NilPort,
+ Engines::DSC::BadProperty) {
Engines_DSC_interface::add_provides_port(ref,
- provides_port_name,
- port_prop);
+ provides_port_name,
+ port_prop);
}
/*!
* \see Engines::DSC::add_uses_port
*/
virtual void add_uses_port(const char* repository_id,
- const char* uses_port_name,
- Ports::PortProperties_ptr port_prop)
+ const char* uses_port_name,
+ Ports::PortProperties_ptr port_prop)
throw (Engines::DSC::PortAlreadyDefined,
- Engines::DSC::BadProperty) {
+ Engines::DSC::BadProperty) {
Engines_DSC_interface::add_uses_port(repository_id,
- uses_port_name,
- port_prop);
+ uses_port_name,
+ port_prop);
}
/*!
* \see Engines::DSC::get_provides_port
*/
virtual Ports::Port_ptr get_provides_port(const char* provides_port_name,
- const CORBA::Boolean connection_error)
+ const CORBA::Boolean connection_error)
throw (Engines::DSC::PortNotDefined,
- Engines::DSC::PortNotConnected) {
+ Engines::DSC::PortNotConnected) {
return Engines_DSC_interface::get_provides_port(provides_port_name,
- connection_error);
+ connection_error);
}
/*!
*/
virtual Engines::DSC::uses_port * get_uses_port(const char* uses_port_name)
throw (Engines::DSC::PortNotDefined,
- Engines::DSC::PortNotConnected) {
+ Engines::DSC::PortNotConnected) {
return Engines_DSC_interface::get_uses_port(uses_port_name);
}
* \see Engines::DSC::connect_uses_port
*/
virtual void connect_uses_port(const char* uses_port_name,
- Ports::Port_ptr provides_port_ref)
+ Ports::Port_ptr provides_port_ref)
throw (Engines::DSC::PortNotDefined,
- Engines::DSC::BadPortType,
- Engines::DSC::NilPort) {
+ Engines::DSC::BadPortType,
+ Engines::DSC::NilPort) {
Engines_DSC_interface::connect_uses_port(uses_port_name,
- provides_port_ref);
+ provides_port_ref);
}
/*!
* \see Engines::DSC::disconnect_provides_port
*/
virtual void disconnect_provides_port(const char* provides_port_name,
- const Engines::DSC::Message message)
+ const Engines::DSC::Message message)
throw (Engines::DSC::PortNotDefined,
- Engines::DSC::PortNotConnected) {
+ Engines::DSC::PortNotConnected) {
Engines_DSC_interface::disconnect_provides_port(provides_port_name,
- message);
+ message);
}
/*!
* \see Engines::DSC::disconnect_uses_port
*/
virtual void disconnect_uses_port(const char* uses_port_name,
- Ports::Port_ptr provides_port_ref,
- const Engines::DSC::Message message)
+ Ports::Port_ptr provides_port_ref,
+ const Engines::DSC::Message message)
throw (Engines::DSC::PortNotDefined,
- Engines::DSC::PortNotConnected,
- Engines::DSC::BadPortReference) {
+ Engines::DSC::PortNotConnected,
+ Engines::DSC::BadPortReference) {
Engines_DSC_interface::disconnect_uses_port(uses_port_name,
- provides_port_ref,
- message);
+ provides_port_ref,
+ message);
}
virtual Ports::PortProperties_ptr get_port_properties(const char* port_name)
* \param port_prop port properties.
*/
virtual void set_paco_proxy(CORBA::Object_ptr ref,
- const char* provides_port_name,
- Ports::PortProperties_ptr port_prop);
+ const char* provides_port_name,
+ Ports::PortProperties_ptr port_prop);
/*!
* This method is used by the node that want to add the parallel proxy port.
* \return true if the proxy is correctly added.
*/
virtual CORBA::Boolean add_parallel_provides_proxy_port(const CORBA::Object_ptr ref,
- const char * provides_port_name,
- Ports::PortProperties_ptr port_prop);
+ const char * provides_port_name,
+ Ports::PortProperties_ptr port_prop);
/*!
* This method by the nodes that do not add the proxy to wait is reference.
* \return true if the node is correctly added.
*/
virtual CORBA::Boolean add_parallel_provides_node_port(Ports::Port_PaCO_ptr ref,
- const char* provides_port_name);
+ const char* provides_port_name);
/*!
* Used to get the proxy of the parallel port.
{
_seq_data = NULL;
- seq_data_termine = false;
+ seq_data_termine = false;
seq_data_mutex = new pthread_mutex_t();
pthread_mutex_init(seq_data_mutex, NULL);
seq_data_condition = new pthread_cond_t();
pthread_cond_init(seq_data_condition, NULL);
- seq_data_termine_cp = true;
+ seq_data_termine_cp = true;
seq_data_mutex_cp = new pthread_mutex_t();
pthread_mutex_init(seq_data_mutex_cp, NULL);
seq_data_condition_cp = new pthread_cond_t();
_seq_results = NULL;
- seq_results_termine = false;
+ seq_results_termine = false;
seq_results_mutex = new pthread_mutex_t();
pthread_mutex_init(seq_results_mutex, NULL);
seq_results_condition = new pthread_cond_t();
pthread_cond_init(seq_results_condition, NULL);
- seq_results_termine_cp = true;
+ seq_results_termine_cp = true;
seq_results_mutex_cp = new pthread_mutex_t();
pthread_mutex_init(seq_results_mutex_cp, NULL);
seq_results_condition_cp = new pthread_cond_t();
Param_Double_Port_provides_i *
Param_Double_Port_provides_i::init_port(Engines_ParallelDSC_i * par_compo,
- std::string port_name,
- CORBA::ORB_ptr orb)
+ std::string port_name,
+ CORBA::ORB_ptr orb)
{
int rank = par_compo->getMyRank();
int totalNode = par_compo->getTotalNode();
// lorsque le composant sera détruit
proxy_node =
new Ports::Param_Double_Port_proxy_impl(CORBA::ORB::_duplicate(orb),
- pfm->get_thread("pdp_thread"));
+ pfm->get_thread("pdp_thread"));
proxy_node->setLibCom("pdp_dummy", proxy_node);
proxy_node->setLibThread("pdp_thread");
PaCO::PacoTopology_t serveur_topo;
// Enregistrement du proxy
par_compo->add_parallel_provides_proxy_port(proxy_node->_this(),
- port_name.c_str(),
- proxy_node_properties->_this());
+ port_name.c_str(),
+ proxy_node_properties->_this());
proxy_node->_remove_ref();
proxy_node_properties->_remove_ref();
}
void
Param_Double_Port_provides_i::wait_init_port(Engines_ParallelDSC_i * par_compo,
- std::string port_name,
- CORBA::ORB_ptr orb)
+ std::string port_name,
+ CORBA::ORB_ptr orb)
{
int rank = par_compo->getMyRank();
int totalNode = par_compo->getTotalNode();
Ports::Param_Double_Port::seq_double * get_data();
void set_data(Ports::Param_Double_Port::seq_double * results);
void configure_set_data(int data_length,
- int totalNbElt,
- int BeginEltPos);
+ int totalNbElt,
+ int BeginEltPos);
// Aide à la création du port
static Param_Double_Port_provides_i * init_port(Engines_ParallelDSC_i * par_compo,
- std::string port_name,
- CORBA::ORB_ptr orb);
+ std::string port_name,
+ CORBA::ORB_ptr orb);
// Méthode temporaire en attendant d'avoir des méthodes parallèles bien synchronisé
static void wait_init_port(Engines_ParallelDSC_i * par_compo,
- std::string port_name,
- CORBA::ORB_ptr orb);
+ std::string port_name,
+ CORBA::ORB_ptr orb);
private:
// Buffers pour la réception et l'envoi
Ports::Param_Double_Port::seq_double * _seq_data;
#include "Param_Double_Port_uses_i.hxx"
Param_Double_Port_uses_i::Param_Double_Port_uses_i(Engines_ParallelDSC_i * par_compo,
- std::string port_name,
- CORBA::ORB_ptr orb)
+ std::string port_name,
+ CORBA::ORB_ptr orb)
{
_orb = CORBA::ORB::_duplicate(orb);
_fake_properties = new PortProperties_i();
Param_Double_Port_uses_i::add_port_to_component()
{
_par_compo->add_uses_port("IDL:Ports/Param_Double_Port:1.0",
- _port_name.c_str(),
- _fake_prop_ref);
+ _port_name.c_str(),
+ _fake_prop_ref);
}
void
{
public :
Param_Double_Port_uses_i(Engines_ParallelDSC_i * par_compo,
- std::string port_name,
- CORBA::ORB_ptr orb);
+ std::string port_name,
+ CORBA::ORB_ptr orb);
virtual ~Param_Double_Port_uses_i();
// Port local init methods
public:
static char* ConvertFromHDFToASCII(const char* thePath,
- bool isReplaced = true,
- const char* theExtension = NULL);
-
+ bool isReplaced = true,
+ const char* theExtension = NULL);
+
static char* ConvertFromASCIIToHDF(const char* thePath);
static bool isASCII(const char* thePath);
case H5T_INTEGER :
size = H5Tget_size(type_id);
if (size == 4)
- type = HDF_INT32;
+ type = HDF_INT32;
else
- type = HDF_INT64;
+ type = HDF_INT64;
break;
case H5T_FLOAT :
public:
HDFdataset(const char *name, HDFcontainerObject *father,hdf_type type,
- hdf_size dim[],int dimsize, hdf_byte_order order = H5T_ORDER_NONE);
+ hdf_size dim[],int dimsize, hdf_byte_order order = H5T_ORDER_NONE);
HDFdataset(const char *name,HDFcontainerObject *father);
virtual ~HDFdataset();
*/
hdf_idt HDFdatasetCreate(hdf_idt pid,char *name,hdf_type type,
- hdf_size *dimd, int ndim, hdf_byte_order order)
+ hdf_size *dimd, int ndim, hdf_byte_order order)
{
hdf_idt dataset, dataspace = 0;
hdf_err ret;
case HDF_STRING :
if((new_type_hdf = H5Tcopy(H5T_C_S1)) < 0)
- return -1;
+ return -1;
if((ret = H5Tset_size(new_type_hdf,1)) < 0)
- return -1;
+ return -1;
break;
default :
if ((dataset = H5Dopen(pid,name)) < 0)
{
- if ((dataspace = H5Screate_simple(ndim, dimd, NULL)) < 0)
- return -1;
+ if ((dataspace = H5Screate_simple(ndim, dimd, NULL)) < 0)
+ return -1;
if ((dataset = H5Dcreate(pid,name,
new_type_hdf < 0 ? type_hdf : new_type_hdf,
dataspace, H5P_DEFAULT)) < 0)
- return -1;
+ return -1;
}
else
return -1;
case H5T_INTEGER :
size = H5Tget_size(type_id);
if (size == 4)
- type = HDF_INT32;
+ type = HDF_INT32;
else
- type = HDF_INT64;
+ type = HDF_INT64;
break;
case H5T_FLOAT :
hdf_size *dim = (hdf_size *) malloc(sizeof(hdf_size)*ndim);
if ((ret = HDFdatasetGetDim(id, dim)) < 0) return -1;
-
+
for(i=0; i<ndim; i++) size+=dim[i];
free(dim);
/*SRN : end of the fix */
hdf_idt fid;
if ((fid = H5Fcreate(name,H5F_ACC_TRUNC,
- H5P_DEFAULT,H5P_DEFAULT)) < 0)
+ H5P_DEFAULT,H5P_DEFAULT)) < 0)
return -1;
return fid;
int idx;
if ((idx = H5Giterate(fid,path,&i,RankInfo,
- name)) < 0)
+ name)) < 0)
return -1;
return 0;
/* HDF object types */
typedef enum {HDF_OBJECT,HDF_FILE,HDF_GROUP,HDF_DATASET,
- HDF_ATTRIBUTE} hdf_object_type;
+ HDF_ATTRIBUTE} hdf_object_type;
#endif /* HDFTYPES_H */
extern
hdf_idt HDFdatasetCreate(hdf_idt pid,char *name,hdf_type type,
- hdf_size *dimd, int ndim, hdf_byte_order order);
+ hdf_size *dimd, int ndim, hdf_byte_order order);
extern
hdf_err HDFdatasetWrite(hdf_idt id, void *val);
MESSAGE( ">> File Exploration " );
for (explorer->Init();explorer->More();explorer->Next())
- {
- object = explorer->Value();
- MESSAGE( "--> Name of the object : " << object->GetName() );
- switch (object->GetObjectType())
- {
- case HDF_FILE :
- MESSAGE( "--> Type of the object : HDF_FILE : " );
- break;
-
- case HDF_GROUP :
- MESSAGE( "--> Type of the object : HDF_GROUP : " );
- break;
-
- case HDF_DATASET :
- MESSAGE( "--> Type of the object : HDF_DATASET : " );
- break;
-
- default :
- MESSAGE( "--> PANIC !!! : " );
- }
- }
+ {
+ object = explorer->Value();
+ MESSAGE( "--> Name of the object : " << object->GetName() );
+ switch (object->GetObjectType())
+ {
+ case HDF_FILE :
+ MESSAGE( "--> Type of the object : HDF_FILE : " );
+ break;
+
+ case HDF_GROUP :
+ MESSAGE( "--> Type of the object : HDF_GROUP : " );
+ break;
+
+ case HDF_DATASET :
+ MESSAGE( "--> Type of the object : HDF_DATASET : " );
+ break;
+
+ default :
+ MESSAGE( "--> PANIC !!! : " );
+ }
+ }
MESSAGE( ">> Group exploration" );
explorer->Reset(hdf_group);
for (explorer->Init();explorer->More();explorer->Next())
- {
- object = explorer->Value();
- MESSAGE( "--> Name of the object : " << object->GetName() );
- switch (object->GetObjectType())
- {
- case HDF_FILE :
- MESSAGE( "--> Type of the object : HDF_FILE : " );
- break;
-
- case HDF_GROUP :
- MESSAGE( "--> Type of the object : HDF_GROUP : " );
- break;
-
- case HDF_DATASET :
- MESSAGE( "--> Type of the object : HDF_DATASET : " );
- break;
-
- default :
- MESSAGE( "--> !!! PANIC !!! : " );
- }
- }
+ {
+ object = explorer->Value();
+ MESSAGE( "--> Name of the object : " << object->GetName() );
+ switch (object->GetObjectType())
+ {
+ case HDF_FILE :
+ MESSAGE( "--> Type of the object : HDF_FILE : " );
+ break;
+
+ case HDF_GROUP :
+ MESSAGE( "--> Type of the object : HDF_GROUP : " );
+ break;
+
+ case HDF_DATASET :
+ MESSAGE( "--> Type of the object : HDF_DATASET : " );
+ break;
+
+ default :
+ MESSAGE( "--> !!! PANIC !!! : " );
+ }
+ }
// memory clean
MESSAGE( ">> MEMORY CLEAN " );
// It is possible to read the name of all (objects) sons in the file
n = hdf_file->nInternalObjects();
for (i=0;i<n;i++)
- {
- hdf_file->InternalObjectIndentify(i,name);
- MESSAGE( "--> First Level Internal Object Name : " << name );
- }
+ {
+ hdf_file->InternalObjectIndentify(i,name);
+ MESSAGE( "--> First Level Internal Object Name : " << name );
+ }
// Or it is possible to ask if an object is in the file
if (hdf_file->ExistInternalObject("MESH"))
- MESSAGE( "--> The object naming 'MESH' is in the file " );
+ MESSAGE( "--> The object naming 'MESH' is in the file " );
// it is possible to determine the type of an object
type = hdf_file->InternalObjectType("MESH");
switch (type)
- {
- case HDF_GROUP :
- MESSAGE( "--> Its type is HDF_GROUP" );
- break;
-
- case HDF_DATASET :
- MESSAGE( "--> Its type is HDF_DATASET" );
- break;
-
- default :
- MESSAGE( "--> !!!! PANIC !!!" );
- }
+ {
+ case HDF_GROUP :
+ MESSAGE( "--> Its type is HDF_GROUP" );
+ break;
+
+ case HDF_DATASET :
+ MESSAGE( "--> Its type is HDF_DATASET" );
+ break;
+
+ default :
+ MESSAGE( "--> !!!! PANIC !!!" );
+ }
hdf_group = new HDFgroup(name,hdf_file);
MESSAGE( ">> A new HDF group object " << name << " is created in memory")
n = hdf_group->nInternalObjects();
MESSAGE( ">> There are " << n << " objects in this group " );
for (i=0;i<n;i++)
- {
- hdf_group->InternalObjectIndentify(i,name);
- type = hdf_group->InternalObjectType(name);
- MESSAGE( "--> First Level Internal Object Name : " << name );
- switch (type)
- {
- case HDF_GROUP :
- MESSAGE( "--> Its type is HDF_GROUP" );
- break;
-
- case HDF_DATASET :
- MESSAGE( "--> Its type is HDF_DATASET" );
- break;
-
- default :
- MESSAGE( "--> !!!! PANIC !!!" );
- }
- }
+ {
+ hdf_group->InternalObjectIndentify(i,name);
+ type = hdf_group->InternalObjectType(name);
+ MESSAGE( "--> First Level Internal Object Name : " << name );
+ switch (type)
+ {
+ case HDF_GROUP :
+ MESSAGE( "--> Its type is HDF_GROUP" );
+ break;
+
+ case HDF_DATASET :
+ MESSAGE( "--> Its type is HDF_DATASET" );
+ break;
+
+ default :
+ MESSAGE( "--> !!!! PANIC !!!" );
+ }
+ }
// The first dataset object 'COORDINATES'
hdf_dataset1 = new HDFdataset("COORDINATES",hdf_group);
data_type = hdf_dataset1->GetType();
switch(data_type)
- {
- case HDF_INT32 :
- MESSAGE( "--> Type of data : HDF_INT32 " );
- break;
- case HDF_INT64 :
- MESSAGE( "--> Type of data : HDF_INT64 " );
- break;
- case HDF_FLOAT64 :
- MESSAGE( "--> Type of data : HDF_FLOAT64 " );
- break;
- default :
- MESSAGE( "--> Type of data : HDF_STRING " );
- }
+ {
+ case HDF_INT32 :
+ MESSAGE( "--> Type of data : HDF_INT32 " );
+ break;
+ case HDF_INT64 :
+ MESSAGE( "--> Type of data : HDF_INT64 " );
+ break;
+ case HDF_FLOAT64 :
+ MESSAGE( "--> Type of data : HDF_FLOAT64 " );
+ break;
+ default :
+ MESSAGE( "--> Type of data : HDF_STRING " );
+ }
ndim = hdf_dataset1->nDim();
MESSAGE( "--> Number of dimensions : " << ndim );
dim = new hdf_size[ndim];
hdf_dataset1->GetDim(dim);
for (i=0;i<ndim;i++)
- MESSAGE( "--> Dimension " << i+1 << " of size : " << dim[i] );
+ MESSAGE( "--> Dimension " << i+1 << " of size : " << dim[i] );
delete dim;
size = hdf_dataset1->GetSize();
hdf_dataset1->ReadFromDisk(val1);
MESSAGE( "--> The values are : ");
for (i=0;i<size;i++)
- MESSAGE( " " << val1[i]);
+ MESSAGE( " " << val1[i]);
MESSAGE();
delete val1;
data_type = hdf_dataset2->GetType();
switch(data_type)
- {
- case HDF_INT32 :
- MESSAGE( "--> Type of data : HDF_INT32 " );
- break;
- case HDF_INT64 :
- MESSAGE( "--> Type of data : HDF_INT64 " );
- break;
- case HDF_FLOAT64 :
- MESSAGE( "--> Type of data : HDF_FLOAT64 " );
- break;
- default :
- MESSAGE( "--> Type of data : HDF_STRING " );
- }
+ {
+ case HDF_INT32 :
+ MESSAGE( "--> Type of data : HDF_INT32 " );
+ break;
+ case HDF_INT64 :
+ MESSAGE( "--> Type of data : HDF_INT64 " );
+ break;
+ case HDF_FLOAT64 :
+ MESSAGE( "--> Type of data : HDF_FLOAT64 " );
+ break;
+ default :
+ MESSAGE( "--> Type of data : HDF_STRING " );
+ }
ndim = hdf_dataset2->nDim();
MESSAGE( "--> Number of dimensions : " << ndim );
dim = new hdf_size[ndim];
hdf_dataset2->GetDim(dim);
for (i=0;i<ndim;i++)
- MESSAGE( "--> Dimension " << i+1 << " of size : " << dim[i] );
+ MESSAGE( "--> Dimension " << i+1 << " of size : " << dim[i] );
delete dim;
size = hdf_dataset2->GetSize();
hdf_dataset2->ReadFromDisk(val2);
MESSAGE( "--> The values are : ");
for (i=0;i<size;i++)
- MESSAGE( " " << val2[i]);
+ MESSAGE( " " << val2[i]);
MESSAGE();
delete val2;
MESSAGE( "--> There are " << m << " objects in the group" );
for (i=0;i<m;i++)
- {
- geom->InternalObjectIndentify(i,name);
- MESSAGE( "--> First Level Internal Object Name : " << name );
- }
+ {
+ geom->InternalObjectIndentify(i,name);
+ MESSAGE( "--> First Level Internal Object Name : " << name );
+ }
geom1 = new HDFgroup("GEOM_1",geom);
MESSAGE( ">> The HDF group object is created for 'GEOM_1' with 'GEOM' as father" );
MESSAGE( ">> The same operations have been done for the file 'mesh.hdf'" )
MESSAGE( " and the groups MESH_1 and MESH_2" )
MESSAGE( "--> This file has been mounted on the group 'MESH' of the file 'study.hdf' ")
-
+
study->CloseOnDisk();
MESSAGE( ">> The study.hdf file is closed" );
from salome_study import *
from salome_iapp import *
+
+#
+# The next block is workaround for the problem of shared symbols loading for the extension modules (e.g. SWIG-generated)
+# that causes RTTI unavailable in some cases. To solve this problem, sys.setdlopenflags() function is used.
+# Depending on the Python version and platform, the dlopen flags can be defined in the dl, DLFUN or ctypes module.
+#
+import sys
+flags = None
+if not flags:
+ try:
+ # dl module can be unavailable
+ import dl
+ flags = dl.RTLD_NOW | dl.RTLD_GLOBAL
+ except:
+ pass
+ pass
+if not flags:
+ try:
+ # DLFCN module can be unavailable
+ import DLFCN
+ flags = DLFCN.RTLD_NOW | DLFCN.RTLD_GLOBAL
+ except:
+ pass
+ pass
+if not flags:
+ try:
+ # ctypes module can be unavailable
+ import ctypes
+ flags = ctypes.RTLD_GLOBAL
+ except:
+ pass
+ pass
+
+if flags:
+ sys.setdlopenflags(flags)
+ pass
+
orb, lcc, naming_service, cm,sg=None,None,None,None,None
myStudyManager, myStudyId, myStudy, myStudyName=None,None,None,None
med_obj = visu_gui.visu.getMedObjectFromStudy()
print "med_obj - ", med_obj
- myField1 = visu_gui.visu.getFieldObjectFromStudy(2,1)
+ myField1 = visu_gui.visu.getFieldObjectFromStudy(3,1)
aMeshName = "maa1"
anEntity = VISU.NODE
aTimeStampId = -1
{
bool rtn = false;
INFOS(std::endl
- << "--- Testing batch Machine :" << std::endl
- << "--- Name : " << _batch_descr.hostname << std::endl
- << "--- hostname : " << _batch_descr.hostname << std::endl
- << "--- Protocol : " << _batch_descr.protocol << std::endl
- << "--- User Name : " << _batch_descr.username << std::endl
- << "--- Batch Type : " << _batch_descr.batch << std::endl
- << "--- MPI Impl : " << _batch_descr.mpiImpl << std::endl
- << "--- Appli Path : " << _batch_descr.applipath << std::endl
+ << "--- Testing batch Machine :" << std::endl
+ << "--- Name : " << _batch_descr.hostname << std::endl
+ << "--- hostname : " << _batch_descr.hostname << std::endl
+ << "--- Protocol : " << _batch_descr.protocol << std::endl
+ << "--- User Name : " << _batch_descr.username << std::endl
+ << "--- Batch Type : " << _batch_descr.batch << std::endl
+ << "--- MPI Impl : " << _batch_descr.mpiImpl << std::endl
+ << "--- Appli Path : " << _batch_descr.applipath << std::endl
);
std::string result_connection("Not Tested");
result_appli = test_appli();
INFOS(std::endl
- << "--- Test results" << std::endl
- << "--- Connection : " << result_connection << std::endl
- << "--- File copy : " << result_filecopy << std::endl
- << "--- Get results : " << result_getresult << std::endl
- << "--- Submit simple job : " << result_jobsubmit_simple << std::endl
- << "--- Submit mpi job : " << result_jobsubmit_mpi << std::endl
- << "--- Application : " << result_appli << std::endl
+ << "--- Test results" << std::endl
+ << "--- Connection : " << result_connection << std::endl
+ << "--- File copy : " << result_filecopy << std::endl
+ << "--- Get results : " << result_getresult << std::endl
+ << "--- Submit simple job : " << result_jobsubmit_simple << std::endl
+ << "--- Submit mpi job : " << result_jobsubmit_mpi << std::endl
+ << "--- Application : " << result_appli << std::endl
);
if (result_connection == "OK" &&
// Build command
command += protocol
- + " "
- + username + "@" + hostname;
+ + " "
+ + username + "@" + hostname;
// Test
status = system(command.c_str());
if(protocol == "rsh")
command = "rcp";
command += " " + _test_filename + " "
- + username + "@" + hostname + ":" + home;
+ + username + "@" + hostname + ":" + home;
// Test
status = system(command.c_str());
if(protocol == "rsh")
command = "rcp";
command += " " + username + "@" + hostname + ":" + home
- + "/" + _base_filename + " " + _test_filename + "_copy";
+ + "/" + _base_filename + " " + _test_filename + "_copy";
// Test
status = system(command.c_str());
if(protocol == "rsh")
command = "rcp";
command += " " + _test_file_simple + " "
- + username + "@" + hostname + ":" + home;
+ + username + "@" + hostname + ":" + home;
status = system(command.c_str());
if(status) {
std::ostringstream oss;
if(protocol == "rsh")
command = "rcp";
command += " "
- + username + "@" + hostname + ":" + home + "/" + _date + "_simple* /tmp";
+ + username + "@" + hostname + ":" + home + "/" + _date + "_simple* /tmp";
status = system(command.c_str());
if(status) {
std::ostringstream oss;
std::ofstream file_script;
file_script.open(_test_file_script.c_str(), std::ofstream::out);
file_script << "#!/bin/bash\n"
- << "echo HELLO MPI\n";
+ << "echo HELLO MPI\n";
file_script.flush();
file_script.close();
#ifdef WIN32
std::ofstream file_mpi;
file_mpi.open(_test_file_mpi.c_str(), std::ofstream::out);
file_mpi << "#!/bin/bash\n"
- << "#PBS -l nodes=1\n"
- << "#PBS -l walltime=00:01:00\n"
- << "#PBS -o " << home << "/" << _date << "_mpi_output.log\n"
- << "#PBS -e " << home << "/" << _date << "_mpi_error.log\n"
- << mpiImpl->boot("${PBS_NODEFILE}", 1)
- << mpiImpl->run("${PBS_NODEFILE}", 1, _base_filename + "_script")
- << mpiImpl->halt();
+ << "#PBS -l nodes=1\n"
+ << "#PBS -l walltime=00:01:00\n"
+ << "#PBS -o " << home << "/" << _date << "_mpi_output.log\n"
+ << "#PBS -e " << home << "/" << _date << "_mpi_error.log\n"
+ << mpiImpl->boot("${PBS_NODEFILE}", 1)
+ << mpiImpl->run("${PBS_NODEFILE}", 1, _base_filename + "_script")
+ << mpiImpl->halt();
file_mpi.flush();
file_mpi.close();
if(protocol == "rsh")
command = "rcp";
command += " " + _test_file_script + " "
- + username + "@" + hostname + ":" + home;
+ + username + "@" + hostname + ":" + home;
status = system(command.c_str());
if(status) {
std::ostringstream oss;
if(protocol == "rsh")
command = "rcp";
command += " " + _test_file_mpi + " "
- + username + "@" + hostname + ":" + home;
+ + username + "@" + hostname + ":" + home;
status = system(command.c_str());
if(status) {
std::ostringstream oss;
if(protocol == "rsh")
command = "rcp";
command += " "
- + username + "@" + hostname + ":" + home + "/" + _date + "_mpi* /tmp";
+ + username + "@" + hostname + ":" + home + "/" + _date + "_mpi* /tmp";
status = system(command.c_str());
if(status) {
std::ostringstream oss;
std::ofstream file_appli;
file_appli.open(_test_file_appli.c_str(), std::ofstream::out);
file_appli << "#!/bin/bash\n"
- << "if [ -f " << applipath << "/runAppli ]\n"
- << "then\n"
- << " echo OK\n"
- << "else\n"
- << " echo NOK\n"
- << "fi\n";
+ << "if [ -f " << applipath << "/runAppli ]\n"
+ << "then\n"
+ << " echo OK\n"
+ << "else\n"
+ << " echo NOK\n"
+ << "fi\n";
file_appli.flush();
file_appli.close();
if(protocol == "rsh")
command = "rcp";
command += " " + _test_file_appli + " "
- + username + "@" + hostname + ":" + home;
+ + username + "@" + hostname + ":" + home;
status = system(command.c_str());
if(status) {
std::ostringstream oss;
// Launch test
command = protocol + " " + username + "@" + hostname
- + " sh " + home + "/" + _base_filename + "_appli_test > "
- + _test_filename + "_appli_test_result";
+ + " sh " + home + "/" + _base_filename + "_appli_test > "
+ + _test_filename + "_appli_test_result";
status = system(command.c_str());
if(status) {
//=============================================================================
long
Launcher_cpp::createJobWithFile(const std::string xmlExecuteFile,
- const std::string clusterName)
+ const std::string clusterName)
{
LAUNCHER_MESSAGE("Begin of Launcher_cpp::createJobWithFile");
Launcher_cpp::createJobWithFile( const std::string xmlExecuteFile, std::string clusterName)
{
throw LauncherException("Method Launcher_cpp::createJobWithFile is not available "
- "(libBatch was not present at compilation time)");
+ "(libBatch was not present at compilation time)");
return 0;
}
void
Launcher::Job::setState(const std::string & state)
{
- // State of a Job: CREATED, QUEUED, RUNNING, FINISHED, ERROR
+ // State of a Job: CREATED, QUEUED, RUNNING, FINISHED, FAILED
if (state != "CREATED" and
state != "QUEUED" and
state != "RUNNING" and
state != "FINISHED" and
- state != "ERROR")
+ state != "FAILED")
{
throw LauncherException("Bad state, this state does not exist: " + state);
}
int i = 0 ;
for (;i < launch_date.size(); i++)
if (launch_date[i] == '/' or
- launch_date[i] == '-' or
- launch_date[i] == ':' or
- launch_date[i] == ' ')
+ launch_date[i] == '-' or
+ launch_date[i] == ':' or
+ launch_date[i] == ' ')
launch_date[i] = '_';
launch_date.erase(--launch_date.end()); // Last caracter is a \n
LAUNCHER_MESSAGE("State received is: " << par[STATE].str());
+ // TODO: Remove this if all tests pass with the new libBatch, otherwise fix the codes in libBatch
// Patch until new LIBBATCH version
// eSSH Client and ePBS Client and eSGE
- if (par[STATE].str() == "Running" or par[STATE].str() == "E" or par[STATE].str() == "R" or par[STATE].str() == "r" or par[STATE].str() == "RUN")
+/* if (par[STATE].str() == "Running" or par[STATE].str() == "E" or par[STATE].str() == "R" or par[STATE].str() == "r" or par[STATE].str() == "RUN")
_state = "RUNNING";
else if (par[STATE].str() == "Stopped")
_state = "PAUSED";
else if (par[STATE].str() == "Dead" or par[STATE].str() == "Eqw")
_state = "ERROR";
else if (par[STATE].str() == "Q" or par[STATE].str() == "qw" or par[STATE].str() == "PEN")
- _state = "QUEUED";
+ _state = "QUEUED";*/
+ _state = par[STATE].str();
}
#endif
return _state;
int i = 0 ;
while ( i < lend ) {
if ( thedate[i] == '/' || thedate[i] == '-' || thedate[i] == ':' ) {
- thedate[i] = '_' ;
+ thedate[i] = '_' ;
}
i++ ;
}
//=============================================================================
CORBA::Long
SALOME_Launcher::createJobWithFile(const char * xmlExecuteFile,
- const char * clusterName)
+ const char * clusterName)
{
CORBA::Long jobId;
try{
if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_machine_list) ){
xmlNodePtr aCurNode2 = aCurNode->xmlChildrenNode;
while(aCurNode2 != NULL){
- if ( !xmlStrcmp(aCurNode2->name,(const xmlChar*)test_machine) ){
- _machp.Clear();
- xmlChar* name = xmlNodeGetContent(aCurNode2);
- string clusterName = (const char*)name;
- xmlFree(name);
-
- if (xmlHasProp(aCurNode2, (const xmlChar*)test_env_file)){
- xmlChar* envfile = xmlGetProp(aCurNode2, (const xmlChar*)test_env_file);
- _machp.EnvFile = (const char*)envfile;
- xmlFree(envfile);
- }
-
- if (xmlHasProp(aCurNode2, (const xmlChar*)test_work_directory)){
- xmlChar* workdirectory = xmlGetProp(aCurNode2, (const xmlChar*)test_work_directory);
- _machp.WorkDirectory = (const char*)workdirectory;
- xmlFree(workdirectory);
- }
- _launch.MachinesList[clusterName]=_machp ;
- }
- aCurNode2 = aCurNode2->next;
+ if ( !xmlStrcmp(aCurNode2->name,(const xmlChar*)test_machine) ){
+ _machp.Clear();
+ xmlChar* name = xmlNodeGetContent(aCurNode2);
+ string clusterName = (const char*)name;
+ xmlFree(name);
+
+ if (xmlHasProp(aCurNode2, (const xmlChar*)test_env_file)){
+ xmlChar* envfile = xmlGetProp(aCurNode2, (const xmlChar*)test_env_file);
+ _machp.EnvFile = (const char*)envfile;
+ xmlFree(envfile);
+ }
+
+ if (xmlHasProp(aCurNode2, (const xmlChar*)test_work_directory)){
+ xmlChar* workdirectory = xmlGetProp(aCurNode2, (const xmlChar*)test_work_directory);
+ _machp.WorkDirectory = (const char*)workdirectory;
+ xmlFree(workdirectory);
+ }
+ _launch.MachinesList[clusterName]=_machp ;
+ }
+ aCurNode2 = aCurNode2->next;
}
}
_launch.RefDirectory = (const char*)refdirectory;
xmlFree(refdirectory);
}
-
+
if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_nb_processes) ){
xmlChar* nbofprocesses = xmlNodeGetContent(aCurNode);
_launch.NbOfProcesses = atoi((const char*)nbofprocesses);
xmlFree(nbofprocesses);
}
-
+
if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_input_file) ){
xmlChar* inputfile = xmlNodeGetContent(aCurNode);
_launch.InputFile.push_back((const char*)inputfile);
xmlFree(inputfile);
}
-
+
if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_output_file) ){
xmlChar* outputfile = xmlNodeGetContent(aCurNode);
_launch.OutputFile.push_back((const char*)outputfile);
xmlFree(outputfile);
}
-
+
if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_command) ){
xmlChar* command = xmlNodeGetContent(aCurNode);
_launch.Command = (const char*)command;
xmlFree(command);
}
-
+
aCurNode = aCurNode->next;
}
//=============================================================================
SALOME_FileTransferCORBA::SALOME_FileTransferCORBA(Engines::fileRef_ptr
- aFileRef)
+ aFileRef)
{
MESSAGE("SALOME_FileTransferCORBA::SALOME_FileTransferCORBA(aFileRef)");
_theFileRef = aFileRef;
//=============================================================================
SALOME_FileTransferCORBA::SALOME_FileTransferCORBA(string refMachine,
- string origFileName,
- string containerName)
+ string origFileName,
+ string containerName)
{
MESSAGE("SALOME_FileTransferCORBA::SALOME_FileTransferCORBA"
- << refMachine << " " << origFileName << " " << containerName);
+ << refMachine << " " << origFileName << " " << containerName);
_refMachine = refMachine;
_origFileName = origFileName;
_containerName = containerName;
if (CORBA::is_nil(_theFileRef))
{
if (_refMachine.empty() || _origFileName.empty())
- {
- INFOS("not enough parameters: machine and file name must be given");
- return "";
- }
+ {
+ INFOS("not enough parameters: machine and file name must be given");
+ return "";
+ }
SALOME_LifeCycleCORBA LCC;
Engines::ContainerManager_var contManager = LCC.getContainerManager();
new_params.mode = CORBA::string_dup("findorstart");
container = contManager->GiveContainer(new_params);
if (CORBA::is_nil(container))
- {
- INFOS("machine " << _refMachine << " unreachable");
- return "";
- }
+ {
+ INFOS("machine " << _refMachine << " unreachable");
+ return "";
+ }
_theFileRef = container->createFileRef(_origFileName.c_str());
if (CORBA::is_nil(_theFileRef))
- {
- INFOS("impossible to create fileRef on " << _refMachine);
- return "";
- }
+ {
+ INFOS("impossible to create fileRef on " << _refMachine);
+ return "";
+ }
}
container = _theFileRef->getContainer();
if (localCopy.empty()) // no existing copy available
{
if (localFile.empty()) // no name provided for local copy
- {
- char bufName[256];
- localCopy = tmpnam(bufName);
- localFile = bufName;
- SCRUTE(localFile);
- }
+ {
+ char bufName[256];
+ localCopy = tmpnam(bufName);
+ localFile = bufName;
+ SCRUTE(localFile);
+ }
FILE* fp;
if ((fp = fopen(localFile.c_str(),"wb")) == NULL)
- {
- INFOS("file " << localFile << " cannot be open for writing");
- return "";
- }
+ {
+ INFOS("file " << localFile << " cannot be open for writing");
+ return "";
+ }
Engines::fileTransfer_var fileTransfer = container->getFileTransfer();
ASSERT(! CORBA::is_nil(fileTransfer));
CORBA::Long fileId = fileTransfer->open(_origFileName.c_str());
if (fileId > 0)
- {
- Engines::fileBlock* aBlock;
- int toFollow = 1;
- int ctr=0;
- while (toFollow)
- {
- ctr++;
- SCRUTE(ctr);
- aBlock = fileTransfer->getBlock(fileId);
- toFollow = aBlock->length();
- SCRUTE(toFollow);
- CORBA::Octet *buf = aBlock->get_buffer();
+ {
+ Engines::fileBlock* aBlock;
+ int toFollow = 1;
+ int ctr=0;
+ while (toFollow)
+ {
+ ctr++;
+ SCRUTE(ctr);
+ aBlock = fileTransfer->getBlock(fileId);
+ toFollow = aBlock->length();
+ SCRUTE(toFollow);
+ CORBA::Octet *buf = aBlock->get_buffer();
#if defined(_DEBUG_) || defined(_DEBUG)
- int nbWri = fwrite(buf, sizeof(CORBA::Octet), toFollow, fp);
- ASSERT(nbWri == toFollow);
+ int nbWri = fwrite(buf, sizeof(CORBA::Octet), toFollow, fp);
+ ASSERT(nbWri == toFollow);
#else
- fwrite(buf, sizeof(CORBA::Octet), toFollow, fp);
+ fwrite(buf, sizeof(CORBA::Octet), toFollow, fp);
#endif
delete aBlock;
- }
- fclose(fp);
- MESSAGE("end of transfer");
- fileTransfer->close(fileId);
- _theFileRef->addRef(myMachine.c_str(), localFile.c_str());
- localCopy = localFile;
- }
+ }
+ fclose(fp);
+ MESSAGE("end of transfer");
+ fileTransfer->close(fileId);
+ _theFileRef->addRef(myMachine.c_str(), localFile.c_str());
+ localCopy = localFile;
+ }
else
- {
- INFOS("open reference file for copy impossible");
- return "";
- }
+ {
+ INFOS("open reference file for copy impossible");
+ return "";
+ }
}
SCRUTE(localCopy);
SALOME_FileTransferCORBA();
SALOME_FileTransferCORBA(Engines::fileRef_ptr aFileRef);
SALOME_FileTransferCORBA(std::string refMachine,
- std::string origFileName,
- std::string containerName="");
+ std::string origFileName,
+ std::string containerName="");
virtual ~SALOME_FileTransferCORBA();
//=============================================================================
Engines::Component_ptr
SALOME_LifeCycleCORBA::FindComponent(const Engines::MachineParameters& params,
- const char *componentName,
- int studyId)
+ const char *componentName,
+ int studyId)
{
if (! isKnownComponentClass(componentName))
return Engines::Component::_nil();
Engines::ResourceList_var listOfResources = _ResManager->GetFittingResources(new_params.resource_params);
Engines::Component_var compo = _FindComponent(new_params,
- componentName,
- studyId,
- listOfResources);
+ componentName,
+ studyId,
+ listOfResources);
return compo._retn();
}
Engines::Component_ptr
SALOME_LifeCycleCORBA::LoadComponent(const Engines::MachineParameters& params,
- const char *componentName,
- int studyId)
+ const char *componentName,
+ int studyId)
{
// --- Check if Component Name is known in ModuleCatalog
new_params.resource_params.resList = listOfResources;
Engines::Component_var compo = _LoadComponent(new_params,
- componentName,
- studyId);
+ componentName,
+ studyId);
return compo._retn();
}
Engines::Component_ptr
SALOME_LifeCycleCORBA::
FindOrLoad_Component(const Engines::MachineParameters& params,
- const char *componentName,
- int studyId)
+ const char *componentName,
+ int studyId)
{
// --- Check if Component Name is known in ModuleCatalog
Engines::ResourceList_var listOfResources = _ResManager->GetFittingResources(new_params.resource_params);
Engines::Component_var compo = _FindComponent(new_params,
- componentName,
- studyId,
- listOfResources);
+ componentName,
+ studyId,
+ listOfResources);
if(CORBA::is_nil(compo))
{
new_params.resource_params.resList = listOfResources;
compo = _LoadComponent(new_params,
- componentName,
- studyId);
+ componentName,
+ studyId);
}
return compo._retn();
Engines::Component_ptr
SALOME_LifeCycleCORBA::
FindOrLoad_Component(const Engines::ContainerParameters& params,
- const char *componentName,
- int studyId)
+ const char *componentName,
+ int studyId)
{
// --- Check if Component Name is known in ModuleCatalog
Engines::ResourceList_var listOfResources = _ResManager->GetFittingResources(new_params.resource_params);
Engines::Component_var compo = _FindComponent(new_params,
- componentName,
- studyId,
- listOfResources);
+ componentName,
+ studyId,
+ listOfResources);
if(CORBA::is_nil(compo))
{
new_params.resource_params.resList = listOfResources;
compo = _LoadComponent(new_params,
- componentName,
- studyId);
+ componentName,
+ studyId);
}
return compo._retn();
Engines::Component_ptr
SALOME_LifeCycleCORBA::FindOrLoad_Component(const char *containerName,
- const char *componentName)
+ const char *componentName)
{
MESSAGE("SALOME_LifeCycleCORBA::FindOrLoad_Component INTERACTIF " << containerName << " " << componentName ) ;
if (CORBA::is_nil (compoInfo))
{
INFOS("Catalog Error: Component not found in the catalog" );
- INFOS( componentName );
+ INFOS( componentName );
return false;
}
else return true;
void
SALOME_LifeCycleCORBA::convert(const Engines::MachineParameters& params_in,
- Engines::ContainerParameters& params_out)
+ Engines::ContainerParameters& params_out)
{
SALOME_LifeCycleCORBA::preSet(params_out);
objLog = inc->resolve(name);
SALOME_Logger::Logger_var logger = SALOME_Logger::Logger::_narrow(objLog);
if ( !CORBA::is_nil(logger) )
- logger->shutdown();
+ logger->shutdown();
}
catch(...)
{
Engines::Component_ptr
SALOME_LifeCycleCORBA::
_FindComponent(const Engines::ContainerParameters& params,
- const char *componentName,
- int studyId,
- const Engines::ResourceList& listOfResources)
+ const char *componentName,
+ int studyId,
+ const Engines::ResourceList& listOfResources)
{
// --- build the list of machines on which the component is already running
const char *containerName = params.container_name;
{
const char * currentResource = listOfResources[i];
CORBA::Object_var obj = _NS->ResolveComponent(currentResource,
- containerName,
- componentName,
- nbproc);
+ containerName,
+ componentName,
+ nbproc);
if (!CORBA::is_nil(obj))
resourcesOK[lghtOfresourcesOK++] = CORBA::string_dup(currentResource);
}
resourcesOK->length(lghtOfresourcesOK);
CORBA::String_var bestResource = _ResManager->FindFirst(resourcesOK);
CORBA::Object_var obj = _NS->ResolveComponent(bestResource,
- containerName,
- componentName,
- nbproc);
+ containerName,
+ componentName,
+ nbproc);
return Engines::Component::_narrow(obj);
}
else
Engines::Component_ptr
SALOME_LifeCycleCORBA::
_LoadComponent(const Engines::ContainerParameters& params,
- const char *componentName,
- int studyId)
+ const char *componentName,
+ int studyId)
{
MESSAGE("_LoadComponent, required " << params.container_name <<
- " " << componentName << " " << NbProc(params));
+ " " << componentName << " " << NbProc(params));
Engines::ContainerParameters local_params(params);
local_params.mode = CORBA::string_dup("findorstart");
Engines::Component_ptr
FindComponent(const Engines::MachineParameters& params,
- const char *componentName,
- int studyId=0);
+ const char *componentName,
+ int studyId=0);
Engines::Component_ptr
LoadComponent(const Engines::MachineParameters& params,
- const char *componentName,
- int studyId=0);
+ const char *componentName,
+ int studyId=0);
Engines::Component_ptr
FindOrLoad_Component(const Engines::MachineParameters& params,
- const char *componentName,
- int studyId =0);
+ const char *componentName,
+ int studyId =0);
// SALOME 6 - Interface
Engines::Component_ptr
FindOrLoad_Component(const Engines::ContainerParameters& params,
- const char *componentName,
- int studyId =0);
+ const char *componentName,
+ int studyId =0);
Engines::Component_ptr
FindOrLoad_Component(const char *containerName,
- const char *componentName); // for compatibility
+ const char *componentName); // for compatibility
// Parallel extension
Engines::Component_ptr
// For SALOME 5.1.x
// Will be deleted on SALOME 6
void convert(const Engines::MachineParameters& params_in,
- Engines::ContainerParameters& params_out);
+ Engines::ContainerParameters& params_out);
protected:
/*! Establish if a component called "componentName" in a container called
*/
Engines::Component_ptr
_FindComponent(const Engines::ContainerParameters& params,
- const char *componentName,
- int studyId,
- const Engines::ResourceList& listOfResources);
+ const char *componentName,
+ int studyId,
+ const Engines::ResourceList& listOfResources);
Engines::Component_ptr
_LoadComponent(const Engines::ContainerParameters& params,
- const char *componentName,
- int studyId);
+ const char *componentName,
+ int studyId);
SALOME_NamingService *_NS;
SALOME_NamingService *_NSnew;
string containerName = "aFarAwayComputer";
containerName += "/theContainer";
// CPPUNIT_ASSERT_THROW(Engines::Component_var mycompo =
-// _LCC.FindOrLoad_Component(containerName.c_str(),"SalomeTestComponent");,SALOME::SALOME_Exception);
+// _LCC.FindOrLoad_Component(containerName.c_str(),"SalomeTestComponent");,SALOME::SALOME_Exception);
try
{
Engines::Component_var mycompo =
- _LCC.FindOrLoad_Component(containerName.c_str(),"SalomeTestComponent");
+ _LCC.FindOrLoad_Component(containerName.c_str(),"SalomeTestComponent");
}
catch(const SALOME::SALOME_Exception &ex)
{
Engines::Component_var mycompo1 =
_LCC.FindOrLoad_Component(containerName.c_str(),"SalomeTestComponent");
CPPUNIT_ASSERT_MESSAGE("Test validity requires connection to remote "\
- "computers from ResourcesCatalog",
- !CORBA::is_nil(mycompo1));
+ "computers from ResourcesCatalog",
+ !CORBA::is_nil(mycompo1));
// --- check narrow
Engines::Component_var mycompo1 =
_LCC.FindOrLoad_Component(params,"SalomeTestComponent");
CPPUNIT_ASSERT_MESSAGE("Test validity requires connection to remote "\
- "computers from ResourcesCatalog",
- !CORBA::is_nil(mycompo1));
+ "computers from ResourcesCatalog",
+ !CORBA::is_nil(mycompo1));
// --- check narrow
Engines::Component_var mycompo1 =
_LCC.FindOrLoad_Component(params,"SalomeTestComponent");
CPPUNIT_ASSERT_MESSAGE("Test validity requires connection to remote "\
- "computers from ResourcesCatalog",
- !CORBA::is_nil(mycompo1));
+ "computers from ResourcesCatalog",
+ !CORBA::is_nil(mycompo1));
// --- check narrow
string origFileName = getenv("KERNEL_ROOT_DIR");
origFileName += "/lib/salome/libSalomeLifeCycleCORBA.so.0.0.0";
SALOME_FileTransferCORBA transfer( Kernel_Utils::GetHostname(),
- origFileName);
+ origFileName);
string local = transfer.getLocalFile();
CPPUNIT_ASSERT(!local.empty());
CPPUNIT_ASSERT_EQUAL(local, origFileName);
string origFileName = getenv("KERNEL_ROOT_DIR");
origFileName += "/lib/salome/libSalomeContainer.so.0.0.0";
SALOME_FileTransferCORBA transfer( GetRemoteHost(),
- origFileName);
+ origFileName);
string local = transfer.getLocalFile();
CPPUNIT_ASSERT(!local.empty());
string local2 = transfer.getLocalFile();
Engines::ResourceDefinition_var resource_definition = resourcesManager->GetResourceDefinition(aMachine);
string machine(resource_definition->hostname.in());
if (machine != localHost)
- {
- remoteHost = machine;
- break;
- }
+ {
+ remoteHost = machine;
+ break;
+ }
}
CPPUNIT_ASSERT(remoteHost != "");
return remoteHost;
if(!CORBA::is_nil(cont)){
std::string basename = Kernel_Utils::GetBaseName(cont->name());
if(basename.compare(0,4,"cycl")==0)
- cycle[cont->getHostName()]++;
+ cycle[cont->getHostName()]++;
if(basename.compare(0,5,"first")==0)
- first[cont->getHostName()]++;
+ first[cont->getHostName()]++;
}
}
_ContManager->ShutdownContainers();
if(cycle[(*iter).first]/nbproc>cmax) cmax=cycle[(*iter).first]/nbproc;
if(first[(*iter).first]/nbproc<fmin) fmin=first[(*iter).first]/nbproc;
if(first[(*iter).first]/nbproc>fmax){
- fmax=first[(*iter).first]/nbproc;
- nbpmax = nbproc;
+ fmax=first[(*iter).first]/nbproc;
+ nbpmax = nbproc;
}
}
}
MESSAGE("FindOrLoadComponent " + containerName + "/" + "SalomeTestComponent" );
Engines::Component_var mycompo =
- _LCC.FindOrLoad_Component(containerName.c_str(),"SalomeTestComponent");
+ _LCC.FindOrLoad_Component(containerName.c_str(),"SalomeTestComponent");
ASSERT(!CORBA::is_nil(mycompo));
Engines::TestComponent_var m1;
m1 = Engines::TestComponent::_narrow(mycompo);
string containerName2 = "otherServer";
Engines::Component_var mycompo2 =
- _LCC.FindOrLoad_Component(containerName2.c_str(),"SALOME_TestComponentPy");
+ _LCC.FindOrLoad_Component(containerName2.c_str(),"SALOME_TestComponentPy");
ASSERT(!CORBA::is_nil(mycompo2));
Engines::TestComponent_var m2;
m2 = Engines::TestComponent::_narrow(mycompo2);
// load an engine, and invoque methods on that engine
Engines::Component_var mycompo3 =
- _LCC.FindOrLoad_Component("totoPy","SALOME_TestComponentPy");
+ _LCC.FindOrLoad_Component("totoPy","SALOME_TestComponentPy");
ASSERT(!CORBA::is_nil(mycompo3));
Engines::TestComponent_var m3 = Engines::TestComponent::_narrow(mycompo3);
ASSERT(!CORBA::is_nil(m3));
string containerName4 = Kernel_Utils::GetHostname();
containerName4 += "/titiPy";
Engines::Component_var mycompo4 =
- _LCC.FindOrLoad_Component(containerName4.c_str(),"SALOME_TestComponentPy");
+ _LCC.FindOrLoad_Component(containerName4.c_str(),"SALOME_TestComponentPy");
ASSERT(!CORBA::is_nil(mycompo4));
Engines::TestComponent_var m4 = Engines::TestComponent::_narrow(mycompo4);
ASSERT(!CORBA::is_nil(m4));
string origFileName = "/home/prascle/petitfichier";
SALOME_FileTransferCORBA transfer( Kernel_Utils::GetHostname(),
- origFileName);
+ origFileName);
string local = transfer.getLocalFile();
SCRUTE(local);
origFileName = "/home/prascle/occ60.tgz";
SALOME_FileTransferCORBA transfer2( "cli76ce",
- origFileName);
+ origFileName);
local = transfer2.getLocalFile();
SCRUTE(local);
local = transfer2.getLocalFile();
myLock.lock();
if (m_putIntoFile)
- m_outputFile << message << std::flush;
+ m_outputFile << message << std::flush;
else
std::cout << message;
myLock.unlock();
public:
//constructor w/o parameters
//all messages will be put into terminal via cout
- Logger();
+ Logger();
//constructor with parameter, filename is output file
//all messages will be put into special file passed as parameter
- Logger(const char *filename);
- virtual ~Logger();
- //put message into one special place for all servers
- void putMessage(const char* message);
+ Logger(const char *filename);
+ virtual ~Logger();
+ //put message into one special place for all servers
+ void putMessage(const char* message);
void ping();
void SetOrb( CORBA::ORB_ptr orb ) { _orb = CORBA::ORB::_duplicate(orb); return; }
- void shutdown() { if(!CORBA::is_nil(_orb)) _orb->shutdown(0); };
+ void shutdown() { if(!CORBA::is_nil(_orb)) _orb->shutdown(0); };
private:
- //if m_putIntoFile is true all messages will be put into special
- //otherwise all messages will be put into terminal via cout
+ //if m_putIntoFile is true all messages will be put into special
+ //otherwise all messages will be put into terminal via cout
bool m_putIntoFile;
- //ofstream class specialized for disk file output
- std::ofstream m_outputFile;
+ //ofstream class specialized for disk file output
+ std::ofstream m_outputFile;
- //synchronisation object
- static omni_mutex myLock;
+ //synchronisation object
+ static omni_mutex myLock;
- CORBA::ORB_ptr _orb;
+ CORBA::ORB_ptr _orb;
};
#endif // !defined(SALOME_Logger_Server_include)
CORBA::ORB_var orb = CORBA::ORB_init(argc, argv) ;
for (i = 1; i <= NumberOfTries; i++)
- {
+ {
#ifndef WIN32
- if (i != 1) nanosleep(&ts_req, &ts_rem);
+ if (i != 1) nanosleep(&ts_req, &ts_rem);
#else
- if (i != 1) Sleep(TIMESleep / 1000000);
+ if (i != 1) Sleep(TIMESleep / 1000000);
#endif
- try
- {
- obj = orb->resolve_initial_references("RootPOA") ;
- if(!CORBA::is_nil(obj))
- poa = PortableServer::POA::_narrow(obj) ;
- pman = poa->the_POAManager();
- // NB. You can activate the POA before or after
- // activating objects in that POA.
-
- // This activates the object in the root POA (by default), and
- // returns a reference to it.
- //NB. You can't use SALOME_NamingService class because it uses MESSAGE macro
- //Otherwise, you will get segmentation fault.
- //Get initial naming context
- if(!CORBA::is_nil(orb))
- theObj = orb->resolve_initial_references("NameService");
- //Narrow to NamingContext
- if (!CORBA::is_nil(theObj))
- inc = CosNaming::NamingContext::_narrow(theObj);
- } catch(CORBA::COMM_FAILURE&) {
- //cout<<"Logger Server: CORBA::COMM_FAILURE: Unable to contact the Naming Service"<<endl;
- } catch(...) {
- //cout<<"Logger Server: Unknown exception dealed with Naming Service" <<endl;
- }
-
- if (!CORBA::is_nil(inc)) {
- // cout<<"Logger Server: Naming Service was found"<<endl;
- break;
- }
+ try
+ {
+ obj = orb->resolve_initial_references("RootPOA") ;
+ if(!CORBA::is_nil(obj))
+ poa = PortableServer::POA::_narrow(obj) ;
+ pman = poa->the_POAManager();
+ // NB. You can activate the POA before or after
+ // activating objects in that POA.
+
+ // This activates the object in the root POA (by default), and
+ // returns a reference to it.
+ //NB. You can't use SALOME_NamingService class because it uses MESSAGE macro
+ //Otherwise, you will get segmentation fault.
+ //Get initial naming context
+ if(!CORBA::is_nil(orb))
+ theObj = orb->resolve_initial_references("NameService");
+ //Narrow to NamingContext
+ if (!CORBA::is_nil(theObj))
+ inc = CosNaming::NamingContext::_narrow(theObj);
+ } catch(CORBA::COMM_FAILURE&) {
+ //cout<<"Logger Server: CORBA::COMM_FAILURE: Unable to contact the Naming Service"<<endl;
+ } catch(...) {
+ //cout<<"Logger Server: Unknown exception dealed with Naming Service" <<endl;
+ }
+
+ if (!CORBA::is_nil(inc)) {
+ // cout<<"Logger Server: Naming Service was found"<<endl;
+ break;
+ }
}
if (argc == 1)
- myLogger = new Logger();
+ myLogger = new Logger();
else
- myLogger = new Logger(argv[1]);
+ myLogger = new Logger(argv[1]);
myLogger->SetOrb(orb);
myLoggerRef = myLogger->_this();
orb->destroy() ;
}
catch(CORBA::COMM_FAILURE& ex)
- {
+ {
std::cerr << "Caught system exception COMM_FAILURE -- unable to contact the "
- << "object." << std::endl;
+ << "object." << std::endl;
}
catch(CORBA::SystemException&)
{
SALOME_Trace& SALOME_Trace::Instance()
{
- static SALOME_Trace instance;
- return instance;
+ static SALOME_Trace instance;
+ return instance;
}
int SALOME_Trace::Initialize(CORBA::ORB_ptr theOrb) {
#ifndef WIN32
if (i != 1) nanosleep(&ts_req,&ts_rem);
#else
- if (i != 1) Sleep(TIMESleep / 1000000);
+ if (i != 1) Sleep(TIMESleep / 1000000);
#endif
try{
if(CORBA::is_nil(obj))
- obj = theOrb->resolve_initial_references("RootPOA");
+ obj = theOrb->resolve_initial_references("RootPOA");
if(CORBA::is_nil(theObj))
- theObj = theOrb->resolve_initial_references("NameService");
+ theObj = theOrb->resolve_initial_references("NameService");
if (!CORBA::is_nil(theObj))
- inc = CosNaming::NamingContext::_narrow(theObj);
+ inc = CosNaming::NamingContext::_narrow(theObj);
if (!CORBA::is_nil(inc)) break;
} catch( CORBA::SystemException& ) {
} catch (...) {
#ifndef WIN32
if (i != 1) nanosleep(&ts_req, &ts_rem);
#else
- if (i != 1) Sleep(TIMESleep / 1000000);
+ if (i != 1) Sleep(TIMESleep / 1000000);
#endif
try {
- obj = inc->resolve(name);
- if (!CORBA::is_nil(obj)) m_pInterfaceLogger = SALOME_Logger::Logger::_narrow(obj);
+ obj = inc->resolve(name);
+ if (!CORBA::is_nil(obj)) m_pInterfaceLogger = SALOME_Logger::Logger::_narrow(obj);
} catch(CosNaming::NamingContext::NotFound) {
} catch(...) {
}
if (!CORBA::is_nil(m_pInterfaceLogger)) {
- //cout<<"SALOME_Trace : Logger Server was found"<<endl;
- m_pInterfaceLogger->ping();
- break;
+ //cout<<"SALOME_Trace : Logger Server was found"<<endl;
+ m_pInterfaceLogger->ping();
+ break;
}
}
if (CORBA::is_nil(m_pInterfaceLogger)) {
class SALOME_Trace : public std::ostringstream
{
public:
- virtual ~SALOME_Trace();
+ virtual ~SALOME_Trace();
static Standard_EXPORT SALOME_Trace& Instance();
- // initializes Logger (if USE_LOGGER variable is set) and returns true, in case success
- int Initialize(CORBA::ORB_ptr theOrb);
- Standard_EXPORT void putMessage(std::ostream& msg);
+ // initializes Logger (if USE_LOGGER variable is set) and returns true, in case success
+ int Initialize(CORBA::ORB_ptr theOrb);
+ Standard_EXPORT void putMessage(std::ostream& msg);
protected:
- //disable creation of instances. It's necessary to use static SALOME_Logger& Instance()
- SALOME_Trace();
- SALOME_Logger::Logger_var m_pInterfaceLogger;// object reference on Logger server.
- int isInitialized;
+ //disable creation of instances. It's necessary to use static SALOME_Logger& Instance()
+ SALOME_Trace();
+ SALOME_Logger::Logger_var m_pInterfaceLogger;// object reference on Logger server.
+ int isInitialized;
};
#define GLogger SALOME_Trace::Instance()
// L'appel au registry SALOME ne se fait que pour le process 0
Engines_MPIContainer_i::Engines_MPIContainer_i(int nbproc, int numproc,
- CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- char * containerName,
- int argc, char *argv[])
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ char * containerName,
+ int argc, char *argv[])
: Engines_Container_i(orb,poa,containerName,argc,argv,false), MPIObject_i(nbproc,numproc)
{
PyObject *globals = PyModule_GetDict(mainmod);
PyObject *pyCont = PyDict_GetItemString(globals, "pyCont");
PyObject *result = PyObject_CallMethod(pyCont,
- (char*)"import_component",
- (char*)"s",componentName);
+ (char*)"import_component",
+ (char*)"s",componentName);
std::string ret= PyString_AsString(result);
SCRUTE(ret);
Py_RELEASE_NEW_THREAD;
if (ret=="") // import possible: Python component
- {
- _library_map[aCompName] = (void *)pyCont; // any non O value OK
- MESSAGE("[" << _numproc << "] import Python: "<<aCompName<<" OK");
- return true;
- }
+ {
+ _library_map[aCompName] = (void *)pyCont; // any non O value OK
+ MESSAGE("[" << _numproc << "] import Python: "<<aCompName<<" OK");
+ return true;
+ }
}
return false;
}
// Create an instance of component
Engines::Component_ptr
Engines_MPIContainer_i::create_component_instance( const char* componentName,
- CORBA::Long studyId)
+ CORBA::Long studyId)
{
pthread_t *th;
if(_numproc == 0){
PyObject *globals = PyModule_GetDict(mainmod);
PyObject *pyCont = PyDict_GetItemString(globals, "pyCont");
PyObject *result = PyObject_CallMethod(pyCont,
- (char*)"create_component_instance",
- (char*)"ssl",
- aCompName.c_str(),
- instanceName.c_str(),
- studyId);
+ (char*)"create_component_instance",
+ (char*)"ssl",
+ aCompName.c_str(),
+ instanceName.c_str(),
+ studyId);
string iors = PyString_AsString(result);
SCRUTE(iors);
Py_RELEASE_NEW_THREAD;
{
void* handle = _library_map[impl_name];
iobject = createMPIInstance(genericRegisterName,
- handle,
- studyId);
+ handle,
+ studyId);
return iobject._retn();
}
Engines::Component_ptr
Engines_MPIContainer_i::createMPIInstance(string genericRegisterName,
- void *handle,
- int studyId)
+ void *handle,
+ int studyId)
{
Engines::Component_var iobject;
Engines::MPIObject_var pobj;
sprintf( aNumI , "%d" , numInstance ) ;
string instanceName = aGenRegisterName + "_inst_" + aNumI ;
string component_registerName =
- _containerName + "/" + instanceName;
+ _containerName + "/" + instanceName;
// --- Instanciate required CORBA object
PortableServer::ObjectId *id ; //not owner, do not delete (nore use var)
id = (MPIComponent_factory) ( _nbproc,_numproc,_orb, _poa, _id, instanceName.c_str(),
- aGenRegisterName.c_str() ) ;
+ aGenRegisterName.c_str() ) ;
// --- get reference & servant from id
pobj = Engines::MPIObject::_narrow(obj) ;
Engines_Component_i *servant =
- dynamic_cast<Engines_Component_i*>(_poa->reference_to_servant(iobject));
+ dynamic_cast<Engines_Component_i*>(_poa->reference_to_servant(iobject));
ASSERT(servant);
//SCRUTE(servant->pd_refCount);
servant->_remove_ref(); // compensate previous id_to_reference
// containerName(.dir)/instanceName(.object)
if( _numproc == 0 ){
- _NS->Register( iobject , component_registerName.c_str() ) ;
- MESSAGE( component_registerName.c_str() << " bound" ) ;
+ _NS->Register( iobject , component_registerName.c_str() ) ;
+ MESSAGE( component_registerName.c_str() << " bound" ) ;
}
// Root recupere les ior des composants des autre process
BCastIOR(_orb,pobj,false);
// Load component
Engines::Component_ptr Engines_MPIContainer_i::load_impl(const char* nameToRegister,
- const char* componentName)
+ const char* componentName)
{
pthread_t *th;
if(_numproc == 0){
// Load component
Engines::Component_ptr Engines_MPIContainer_i::Lload_impl(
- const char* nameToRegister,
- const char* componentName)
+ const char* nameToRegister,
+ const char* componentName)
{
Engines::Component_var iobject;
Engines::MPIObject_var pobj;
dlerror();
PortableServer::ObjectId * (*MPIComponent_factory) (int,int,
- CORBA::ORB_ptr,
- PortableServer::POA_ptr,
- PortableServer::ObjectId *,
- const char *,
- const char *) =
+ CORBA::ORB_ptr,
+ PortableServer::POA_ptr,
+ PortableServer::ObjectId *,
+ const char *,
+ const char *) =
(PortableServer::ObjectId * (*) (int,int,
- CORBA::ORB_ptr,
- PortableServer::POA_ptr,
- PortableServer::ObjectId *,
- const char *,
- const char *))
+ CORBA::ORB_ptr,
+ PortableServer::POA_ptr,
+ PortableServer::ObjectId *,
+ const char *,
+ const char *))
dlsym(handle, factory_name.c_str());
char *error ;
} thread_st;
class Engines_MPIContainer_i : public POA_Engines::MPIContainer,
- public Engines_Container_i,
- public MPIObject_i
+ public Engines_Container_i,
+ public MPIObject_i
{
public:
// Constructor
Engines_MPIContainer_i( int nbproc, int numproc,
- CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- char * containerName,
- int argc, char *argv[]);
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ char * containerName,
+ int argc, char *argv[]);
Engines_MPIContainer_i(int nbproc, int numproc);
// Destructor
~Engines_MPIContainer_i();
// synchronous version for process 0
Engines::Component_ptr
create_component_instance( const char* componentName,
- CORBA::Long studyId); // 0 for multiStudy
+ CORBA::Long studyId); // 0 for multiStudy
// Load a component in current MPI container
// synchronous version for process 0
Engines::Component_ptr load_impl(const char* nameToRegister,
- const char* componentName);
+ const char* componentName);
// Unload a component from current MPI container
// synchronous version for process 0
bool Lload_component_Library(const char* componentName);
Engines::Component_ptr
Lcreate_component_instance( const char* componentName,
- CORBA::Long studyId); // 0 for multiStudy
+ CORBA::Long studyId); // 0 for multiStudy
Engines::Component_ptr Lload_impl(const char* nameToRegister,
- const char* componentName);
+ const char* componentName);
Engines::Component_ptr
createMPIInstance(std::string genericRegisterName,
- void *handle,
- int studyId);
+ void *handle,
+ int studyId);
};
#endif
for(ip=1;ip<_nbproc;ip++){
err = MPI_Recv(&n,1,MPI_INT,ip,ip,MPI_COMM_WORLD,&status);
if(err){
- MESSAGE("[" << _numproc << "] MPI_RECV error");
- exit(1);
+ MESSAGE("[" << _numproc << "] MPI_RECV error");
+ exit(1);
}
// Allocation de la chaine de longueur n
ior = new char[n];
err = MPI_Recv(ior,n,MPI_CHAR,ip,2*ip,MPI_COMM_WORLD,&status);
if(err){
- MESSAGE("[" << _numproc << "] MPI_RECV error");
- exit(1);
+ MESSAGE("[" << _numproc << "] MPI_RECV error");
+ exit(1);
}
iort[ip] = orb->string_to_object(ior);
delete [] ior;
if(CORBA::is_nil(iort[ip]))
- throw POException(ip,"MPI Component not loaded");
+ throw POException(ip,"MPI Component not loaded");
}
// On donne le tableau des ior a l'objet Corba du process 0
if( amiCont )
while ( i != TIMEOUT ) {
sleep(1);
if ( MPI_Lookup_name((char*)service.c_str(), MPI_INFO_NULL, port_name_clt) == MPI_SUCCESS ){
- MESSAGE("[" << _numproc << "] I get the connection with " << service << " at " << port_name_clt << endl);
- break;
+ MESSAGE("[" << _numproc << "] I get the connection with " << service << " at " << port_name_clt << endl);
+ break;
}
i++;
}
char *containerName = (char *)"";
if (argc >1)
{
- containerName = argv[1] ;
+ containerName = argv[1] ;
}
MESSAGE("[" << numproc << "] MPIContainer: load MPIContainer servant");
} ;
typedef vector<PathPrefix> ListOfPathPrefix ;
-
+
#endif // PATH_PREFIX_H
{
_list[ind] = CORBA::string_dup(_Component.interfaces[ind].interfacename);
if(MYDEBUG) MESSAGE("The component " << _Component.name
- << " contains " << _list[ind] << " as interface");
+ << " contains " << _list[ind] << " as interface");
}
if(MYDEBUG) END_OF("GetInterfaceList");
if(MYDEBUG) SCRUTE(interfacename);
SALOME_ModuleCatalog::DefinitionInterface *_interface =
- new SALOME_ModuleCatalog::DefinitionInterface;
+ new SALOME_ModuleCatalog::DefinitionInterface;
bool _find = false ;
for (unsigned int ind = 0; ind < _Component.interfaces.length(); ind++)
{
SALOME_ModuleCatalog::DefinitionInterface &I
- = _Component.interfaces[ind];
+ = _Component.interfaces[ind];
if (strcmp(interfacename, I.interfacename) == 0)
- {
- // wanted interface
- _find = true ;
- duplicate(*_interface, I);
- }
+ {
+ // wanted interface
+ _find = true ;
+ duplicate(*_interface, I);
+ }
}
if(MYDEBUG) SCRUTE(_find);
SALOME_ModuleCatalog::DefinitionInterface & I = _Component.interfaces[ind];
if (strcmp(interfacename, I.interfacename) == 0)
- {
- _find = true ;
- // wanted interface
- // Get the list of services name for this interface
- unsigned int _length_services = I.interfaceservicelist.length();
- _list->length(_length_services);
- for (unsigned int ind1 = 0; ind1 < _length_services ; ind1++)
- {
- _list[ind1] = CORBA::string_dup(I.interfaceservicelist[ind1].ServiceName);
- if(MYDEBUG) MESSAGE("The interface " << interfacename << " of the component "
- << _Component.name << " contains " << _list[ind1] << " as a service")
- }
- }
+ {
+ _find = true ;
+ // wanted interface
+ // Get the list of services name for this interface
+ unsigned int _length_services = I.interfaceservicelist.length();
+ _list->length(_length_services);
+ for (unsigned int ind1 = 0; ind1 < _length_services ; ind1++)
+ {
+ _list[ind1] = CORBA::string_dup(I.interfaceservicelist[ind1].ServiceName);
+ if(MYDEBUG) MESSAGE("The interface " << interfacename << " of the component "
+ << _Component.name << " contains " << _list[ind1] << " as a service")
+ }
+ }
}
if (!_find)
//----------------------------------------------------------------------
SALOME_ModuleCatalog::Service*
SALOME_ModuleCatalog_AcomponentImpl::GetService(const char* interfacename,
- const char* servicename)
+ const char* servicename)
throw(SALOME_ModuleCatalog::NotFound)
{
if(MYDEBUG) BEGIN_OF("GetService");
SALOME_ModuleCatalog::DefinitionInterface &I = _Component.interfaces[ind];
if (strcmp(interfacename, I.interfacename) == 0)
- {
- // wanted interface
- // looking for the specified service
- for (unsigned int ind1 = 0; ind1 < I.interfaceservicelist.length() ; ind1++)
- {
- SALOME_ModuleCatalog::Service &S = I.interfaceservicelist[ind1];
- if(MYDEBUG) SCRUTE(ind1);
- if(MYDEBUG) SCRUTE(S.ServiceName);
-
- if (strcmp(servicename, S.ServiceName) == 0)
- {
- // Wanted Service
- // Affect the service to be returned
- _find = true ;
- duplicate(*service, S);
- }
- }
-
- }
+ {
+ // wanted interface
+ // looking for the specified service
+ for (unsigned int ind1 = 0; ind1 < I.interfaceservicelist.length() ; ind1++)
+ {
+ SALOME_ModuleCatalog::Service &S = I.interfaceservicelist[ind1];
+ if(MYDEBUG) SCRUTE(ind1);
+ if(MYDEBUG) SCRUTE(S.ServiceName);
+
+ if (strcmp(servicename, S.ServiceName) == 0)
+ {
+ // Wanted Service
+ // Affect the service to be returned
+ _find = true ;
+ duplicate(*service, S);
+ }
+ }
+
+ }
}
if(MYDEBUG) SCRUTE(_find);
for (unsigned int ind = 0; ind < _Component.interfaces.length(); ind++)
{
if (strcmp(interfacename, _Component.interfaces[ind].interfacename) == 0)
- {
- // wanted interface
- // looking for the defautl service of the wanted interface
- for (unsigned int ind1 = 0; ind1 < _Component.interfaces[ind].interfaceservicelist.length() ; ind1++)
- {
- if (_Component.interfaces[ind].interfaceservicelist[ind1].Servicebydefault)
- {
- // Default Service
- // affect the service to be returned
- _find = true ;
- duplicate(*_service, _Component.interfaces[ind].interfaceservicelist[ind1]);
- }
- }
-
- }
+ {
+ // wanted interface
+ // looking for the defautl service of the wanted interface
+ for (unsigned int ind1 = 0; ind1 < _Component.interfaces[ind].interfaceservicelist.length() ; ind1++)
+ {
+ if (_Component.interfaces[ind].interfaceservicelist[ind1].Servicebydefault)
+ {
+ // Default Service
+ // affect the service to be returned
+ _find = true ;
+ duplicate(*_service, _Component.interfaces[ind].interfaceservicelist[ind1]);
+ }
+ }
+
+ }
}
if (!_find)
for (unsigned int ind = 0 ; ind < _Component.paths.length() ; ind++)
{
if (strcmp(machinename, _Component.paths[ind].machine) == 0)
- {
- _find = true ;
- // Wanted computer
- // affect the path to be returned
- const char* _temp = _Component.paths[ind].path ;
- _path = new char[strlen(_temp)+1];
- strcpy(_path,_temp);
- }
+ {
+ _find = true ;
+ // Wanted computer
+ // affect the path to be returned
+ const char* _temp = _Component.paths[ind].path ;
+ _path = new char[strlen(_temp)+1];
+ strcpy(_path,_temp);
+ }
}
if(MYDEBUG) SCRUTE(_find);
for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++)
duplicate(S_out.ServiceinParameter[ind2],
- S_in.ServiceinParameter[ind2]);
+ S_in.ServiceinParameter[ind2]);
// duplicate out Parameters
_length = S_in.ServiceoutParameter.length();
for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++)
duplicate(S_out.ServiceoutParameter[ind2],
- S_in.ServiceoutParameter[ind2]);
+ S_in.ServiceoutParameter[ind2]);
// duplicate in DataStreamParameters
_length = S_in.ServiceinDataStreamParameter.length();
for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++)
duplicate(S_out.ServiceinDataStreamParameter[ind2],
- S_in.ServiceinDataStreamParameter[ind2]);
+ S_in.ServiceinDataStreamParameter[ind2]);
// duplicate out DataStreamParameters
_length = S_in.ServiceoutDataStreamParameter.length();
for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++)
duplicate(S_out.ServiceoutDataStreamParameter[ind2],
- S_in.ServiceoutDataStreamParameter[ind2]);
+ S_in.ServiceoutDataStreamParameter[ind2]);
}
for (unsigned int ind1 = 0; ind1 < _length ; ind1 ++)
duplicate(I_out.interfaceservicelist[ind1],
- I_in.interfaceservicelist[ind1]);
+ I_in.interfaceservicelist[ind1]);
}
*/
virtual SALOME_ModuleCatalog::Service*
GetService(const char* interfacename,
- const char* servicename)
+ const char* servicename)
throw(SALOME_ModuleCatalog::NotFound);
//! method to get the default service of an interface of a component
\return the interface
*/
void duplicate(SALOME_ModuleCatalog::DefinitionInterface &I_out,
- const SALOME_ModuleCatalog::DefinitionInterface &I_in);
+ const SALOME_ModuleCatalog::DefinitionInterface &I_in);
//! method to duplicate a service
/*!
\return the service
*/
void duplicate(SALOME_ModuleCatalog::Service & S_out,
- const SALOME_ModuleCatalog::Service &S_in);
+ const SALOME_ModuleCatalog::Service &S_in);
//! method to duplicate a parameter
/*!
\return the parameter
*/
void duplicate(SALOME_ModuleCatalog::ServicesParameter & P_out,
- const SALOME_ModuleCatalog::ServicesParameter & P_in);
+ const SALOME_ModuleCatalog::ServicesParameter & P_in);
//! method to duplicate a parameter
/*!
\return the parameter
*/
void duplicate(SALOME_ModuleCatalog::ServicesDataStreamParameter & P_out,
- const SALOME_ModuleCatalog::ServicesDataStreamParameter &P_in);
+ const SALOME_ModuleCatalog::ServicesDataStreamParameter &P_in);
};
using namespace std;
void PrintService(SALOME_ModuleCatalog::Acomponent_ptr C,
- const string & InterfaceName,
- const string & ServiceName);
+ const string & InterfaceName,
+ const string & ServiceName);
void PrintInterface(SALOME_ModuleCatalog::Acomponent_ptr C,
- const string & InterfaceName);
+ const string & InterfaceName);
void PrintComponent(SALOME_ModuleCatalog::Acomponent_ptr C);
CORBA::Object_var objVar, objVarN;
try {
- // initialize the ORB
+ // initialize the ORB
orb = CORBA::ORB_init (argc, argv);
void PrintInterface(SALOME_ModuleCatalog::Acomponent_ptr C,
- const string & InterfaceName)
+ const string & InterfaceName)
{
unsigned int i, n;
-
+
SALOME_ModuleCatalog::DefinitionInterface_var _interf
= C->GetInterface(InterfaceName.c_str());
MESSAGE ("Interface : " << _interf->interfacename);
}
void PrintService(SALOME_ModuleCatalog::Acomponent_ptr C,
- const string & InterfaceName,
- const string & ServiceName)
+ const string & InterfaceName,
+ const string & ServiceName)
{
int i, n;
for (i = 0; i<n; i++)
{
MESSAGE(" Parameter "
- << Service->ServiceinParameter[i].Parametername);
+ << Service->ServiceinParameter[i].Parametername);
MESSAGE(" Type : "
- << Service->ServiceinParameter[i].Parametertype);
+ << Service->ServiceinParameter[i].Parametertype);
}
MESSAGE("Out Parameter(s):");
for (i = 0; i<n; i++)
{
MESSAGE(" Parameter "
- << Service->ServiceoutParameter[i].Parametername);
+ << Service->ServiceoutParameter[i].Parametername);
MESSAGE(" Type : "
- << Service->ServiceoutParameter[i].Parametertype);
+ << Service->ServiceoutParameter[i].Parametertype);
}
MESSAGE("In DataStreamParameter(s):");
for (i = 0; i<n; i++)
{
MESSAGE(" Parameter "
- << Service->ServiceinDataStreamParameter[i].Parametername);
+ << Service->ServiceinDataStreamParameter[i].Parametername);
MESSAGE(" Type : "
- << Service->ServiceinDataStreamParameter[i].Parametertype);
+ << Service->ServiceinDataStreamParameter[i].Parametertype);
MESSAGE(" Dependency : "
- << Service->ServiceinDataStreamParameter[i].Parametertype);
+ << Service->ServiceinDataStreamParameter[i].Parametertype);
}
MESSAGE("Out DataStreamParameter(s):");
for (i = 0; i<n; i++)
{
MESSAGE(" Parameter "
- << Service->ServiceoutDataStreamParameter[i].Parametername);
+ << Service->ServiceoutDataStreamParameter[i].Parametername);
MESSAGE(" Type : "
- << Service->ServiceoutDataStreamParameter[i].Parametertype);
+ << Service->ServiceoutDataStreamParameter[i].Parametertype);
MESSAGE(" Dependency : "
- << Service->ServiceoutDataStreamParameter[i].Parametertype);
+ << Service->ServiceoutDataStreamParameter[i].Parametertype);
}
}
std::ostream & operator<< (std::ostream & f,
- const ParserDataStreamParameter & P)
+ const ParserDataStreamParameter & P)
{
f << " name : " << P.name << std::endl;
f << " type : " << P.type << std::endl;
}
std::ostream & operator<< (std::ostream & f,
- const ParserService & S)
+ const ParserService & S)
{
int i, n;
f << " name : " << S.name << std::endl;
}
std::ostream & operator<< (std::ostream & f,
- const ParserInterface & I)
+ const ParserInterface & I)
{
int j, n;
f << " name : " << I.name << std::endl;
}
std::ostream & operator<< (std::ostream & f,
- const ParserComponentType & T)
+ const ParserComponentType & T)
{
std::string s;
switch (T) {
}
std::ostream & operator<< (std::ostream & f,
- const ParserComponent & C)
+ const ParserComponent & C)
{
int j, n;
f << std::endl
#include <iostream>
std::ostream & operator<< (std::ostream & f,
- const ParserParameter & P);
+ const ParserParameter & P);
std::ostream & operator<< (std::ostream & f,
- const ParserDataStreamParameter & P);
+ const ParserDataStreamParameter & P);
std::ostream & operator<< (std::ostream & f,
- const ParserService & S);
+ const ParserService & S);
std::ostream & operator<< (std::ostream & f,
- const ParserInterface & I);
+ const ParserInterface & I);
std::ostream & operator<< (std::ostream & f,
- const ParserComponent & C);
+ const ParserComponent & C);
std::ostream & operator<< (std::ostream & f,
- const ParserComponentType & T);
+ const ParserComponentType & T);
#endif
const char * Env = getenv("USE_LOGGER");
int EnvL =0;
if ((Env!=NULL) && (strlen(Env)))
- EnvL=1;
+ EnvL=1;
CosNaming::Name name;
name.length(1);
name[0].id=CORBA::string_dup("Logger");
PortableServer::POAManager_var mgr;
for (int i = 1; i<=NumberOfTries; i++)
- {
- if (i!=1)
+ {
+ if (i!=1)
#ifndef WIN32
- a=nanosleep(&ts_req,&ts_rem);
+ a=nanosleep(&ts_req,&ts_rem);
#else
- Sleep(TIMESleep/1000000);
+ Sleep(TIMESleep/1000000);
#endif
- try
- {
- obj = orb->resolve_initial_references("RootPOA");
- if(!CORBA::is_nil(obj))
- poa = PortableServer::POA::_narrow(obj);
- if(!CORBA::is_nil(poa))
- mgr = poa->the_POAManager();
- if(!CORBA::is_nil(orb))
- theObj = orb->resolve_initial_references("NameService");
- }
- catch( CORBA::SystemException& )
- {
- INFOS( "Module Catalog Server: CORBA::SystemException: Unable to contact the Naming Service" );
- }
- if (!CORBA::is_nil(theObj))
- {
- inc = CosNaming::NamingContext::_narrow(theObj);
- if(!CORBA::is_nil(inc))
- {
- INFOS( "Module Catalog Server: Naming Service was found" );
- if(EnvL==1)
- {
- CORBA::ORB_var orb1 = CORBA::ORB_init(argc,argv) ;
- SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance() ;
- NS.init_orb( orb1 ) ;
- for(int j=1; j<=NumberOfTries; j++)
- {
- if (j!=1)
+ try
+ {
+ obj = orb->resolve_initial_references("RootPOA");
+ if(!CORBA::is_nil(obj))
+ poa = PortableServer::POA::_narrow(obj);
+ if(!CORBA::is_nil(poa))
+ mgr = poa->the_POAManager();
+ if(!CORBA::is_nil(orb))
+ theObj = orb->resolve_initial_references("NameService");
+ }
+ catch( CORBA::SystemException& )
+ {
+ INFOS( "Module Catalog Server: CORBA::SystemException: Unable to contact the Naming Service" );
+ }
+ if (!CORBA::is_nil(theObj))
+ {
+ inc = CosNaming::NamingContext::_narrow(theObj);
+ if(!CORBA::is_nil(inc))
+ {
+ INFOS( "Module Catalog Server: Naming Service was found" );
+ if(EnvL==1)
+ {
+ CORBA::ORB_var orb1 = CORBA::ORB_init(argc,argv) ;
+ SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance() ;
+ NS.init_orb( orb1 ) ;
+ for(int j=1; j<=NumberOfTries; j++)
+ {
+ if (j!=1)
#ifndef WIN32
- a=nanosleep(&ts_req, &ts_rem);
+ a=nanosleep(&ts_req, &ts_rem);
#else
- Sleep(TIMESleep/1000000);
+ Sleep(TIMESleep/1000000);
#endif
- try{
- object = inc->resolve(name);}
- catch(CosNaming::NamingContext::NotFound)
- {
- INFOS( "Logger Server wasn't found" );
- }
- catch(...)
- {
- INFOS( "Module Catalog Server: Unknown exception" ) ;
- }
- if (!CORBA::is_nil(object))
- {
- INFOS( "Module Catalog Server: Logger Server was found" );
- MODULE_CATALOG=1;
- break;
- }
- }
- }
- }
- }
- if ((MODULE_CATALOG==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
- break;
- }
+ try{
+ object = inc->resolve(name);}
+ catch(CosNaming::NamingContext::NotFound)
+ {
+ INFOS( "Logger Server wasn't found" );
+ }
+ catch(...)
+ {
+ INFOS( "Module Catalog Server: Unknown exception" ) ;
+ }
+ if (!CORBA::is_nil(object))
+ {
+ INFOS( "Module Catalog Server: Logger Server was found" );
+ MODULE_CATALOG=1;
+ break;
+ }
+ }
+ }
+ }
+ }
+ if ((MODULE_CATALOG==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
+ break;
+ }
// Active catalog
else
anItem = theString.substr(startPos);
if (anItem.length() > 0)
- aList.push_back(anItem);
+ aList.push_back(anItem);
if(sepPos == string::npos)
break;
startPos = sepPos + sepLen;
string aPath = (*iter);
//remove inverted commas from filename
while (aPath.find('\"') != string::npos)
- aPath.erase(aPath.find('\"'), 1);
+ aPath.erase(aPath.find('\"'), 1);
_parse_xml_file(aPath.c_str(),
- _general_module_list,
- _general_path_list,
+ _general_module_list,
+ _general_path_list,
_typeMap,
_typeList);
}
// Verification of _general_path_list content
if (!_verify_path_prefix(_general_path_list)) {
if(MYDEBUG) MESSAGE( "Error while parsing the general path list, "
- "differents paths are associated to the same computer,"
- "the first one will be choosen");
+ "differents paths are associated to the same computer,"
+ "the first one will be choosen");
} else {
if(MYDEBUG) MESSAGE("General path list OK");
}
// Initialize the _personal_module_list and
// _personal_path_list members with the personal catalog files
_parse_xml_file(_personal_path,
- _personal_module_list,
- _personal_path_list,
+ _personal_module_list,
+ _personal_path_list,
_typeMap,
_typeList);
// Verification of _general_path_list content
if(!_verify_path_prefix(_personal_path_list)){
- if(MYDEBUG) MESSAGE("Error while parsing the personal path list, "
- "differents paths are associated to the same computer, "
- "the first one will be choosen" );
+ if(MYDEBUG) MESSAGE("Error while parsing the personal path list, "
+ "differents paths are associated to the same computer, "
+ "the first one will be choosen" );
}else {
- if(MYDEBUG) MESSAGE("Personal path list OK");
+ if(MYDEBUG) MESSAGE("Personal path list OK");
}
}else
if(MYDEBUG) MESSAGE("No personal catalog indicated or error while "
- "opening the personal catalog");
+ "opening the personal catalog");
}
}
for (unsigned int ind = 0 ; ind < _personal_path_list.size() ; ind++)
{
for (unsigned int ind1 = 0 ; ind1 < _personal_path_list[ind].listOfComputer.size() ; ind1++)
- {
- if (strcmp(machinename, _personal_path_list[ind].listOfComputer[ind1].c_str()) == 0)
- {
- _find = true ;
- // Wanted computer
- // affect the path to be returned
- const char* _temp = _personal_path_list[ind].path.c_str() ;
- _path = new char[strlen(_temp)+1];
- strcpy(_path,_temp);
- }
- }
+ {
+ if (strcmp(machinename, _personal_path_list[ind].listOfComputer[ind1].c_str()) == 0)
+ {
+ _find = true ;
+ // Wanted computer
+ // affect the path to be returned
+ const char* _temp = _personal_path_list[ind].path.c_str() ;
+ _path = new char[strlen(_temp)+1];
+ strcpy(_path,_temp);
+ }
+ }
}
if (!_find)
for (unsigned int ind = 0 ; ind < _general_path_list.size() ; ind++)
{
for (unsigned int ind1 = 0 ; ind1 < _general_path_list[ind].listOfComputer.size() ; ind1++)
- {
- if (strcmp(machinename, _general_path_list[ind].listOfComputer[ind1].c_str()) == 0)
- {
- _find = true ;
- // Wanted computer
- // affect the path to be returned
- const char* _temp = _general_path_list[ind].path.c_str() ;
- _path = new char[strlen(_temp)+1];
- strcpy(_path,_temp);
- }
- }
+ {
+ if (strcmp(machinename, _general_path_list[ind].listOfComputer[ind1].c_str()) == 0)
+ {
+ _find = true ;
+ // Wanted computer
+ // affect the path to be returned
+ const char* _temp = _general_path_list[ind].path.c_str() ;
+ _path = new char[strlen(_temp)+1];
+ strcpy(_path,_temp);
+ }
+ }
}
}
// searching if the component is already defined in
// the personal catalog
if ((_general_module_list[ind].name.compare(_personal_module_list[ind1].name)) == 0)
- _find = true;
+ _find = true;
}
if(!_find){
if(MYDEBUG) MESSAGE("A new component " << _general_module_list[ind].name
- << " has to be to added in the list");
+ << " has to be to added in the list");
_list_components->length(indice+1);
// The component is not already defined => has to be taken
_list_components[indice]=(_general_module_list[ind].name).c_str();
indice++;
}else{
if(MYDEBUG) MESSAGE("The component " <<_general_module_list[ind].name
- << " was already defined in the personal catalog") ;
+ << " was already defined in the personal catalog") ;
}
}
// searching if the component is aleready defined in
// the personal catalog
if((_general_module_list[ind].name.compare(_personal_module_list[ind1].name)) == 0)
- _find = true;
+ _find = true;
}
if(!_find){
- // if(MYDEBUG) MESSAGE("A new component " << _general_module_list[ind].name << " has to be to added in the list");
+ // if(MYDEBUG) MESSAGE("A new component " << _general_module_list[ind].name << " has to be to added in the list");
_list_components_icone->length(indice+1);
// The component is not already defined => has to be taken
_list_components_icone[indice].modulename=_general_module_list[ind].name.c_str();
for (unsigned int ind=0; ind < _personal_module_list.size();ind++)
{
if (_personal_module_list[ind].type == _temp_component_type)
- {
- _list_typed_component->length(_j + 1);
+ {
+ _list_typed_component->length(_j + 1);
_list_typed_component[_j] = _personal_module_list[ind].name.c_str();
- //if(MYDEBUG) SCRUTE(_list_typed_component[_j]);
- _j++;
- }
+ //if(MYDEBUG) SCRUTE(_list_typed_component[_j]);
+ _j++;
+ }
}
int indice = _list_typed_component->length() ;
_find = false;
if(_general_module_list[ind].type == _temp_component_type)
- {
- for (unsigned int ind1=0; ind1 < _personal_module_list.size();ind1++)
- {
- // searching if the component is aleready defined in
- // the personal catalog
- if ((_general_module_list[ind].name.compare(_personal_module_list[ind1].name)) == 0)
- _find = true;
- }
- if (!_find)
- {
- //if(MYDEBUG) MESSAGE("A new component " << _general_module_list[ind].name << " has to be to added in the list");
+ {
+ for (unsigned int ind1=0; ind1 < _personal_module_list.size();ind1++)
+ {
+ // searching if the component is aleready defined in
+ // the personal catalog
+ if ((_general_module_list[ind].name.compare(_personal_module_list[ind1].name)) == 0)
+ _find = true;
+ }
+ if (!_find)
+ {
+ //if(MYDEBUG) MESSAGE("A new component " << _general_module_list[ind].name << " has to be to added in the list");
_list_typed_component->length(indice+1);
- // The component is not already defined => has to be taken
- _list_typed_component[indice]=(_general_module_list[ind].name).c_str();
- //if(MYDEBUG) SCRUTE(_list_typed_component[indice]) ;
-
- indice++;
- }
- //else
- //if(MYDEBUG) MESSAGE("The component " <<_general_module_list[ind].name << " was already defined in the personal catalog") ;
+ // The component is not already defined => has to be taken
+ _list_typed_component[indice]=(_general_module_list[ind].name).c_str();
+ //if(MYDEBUG) SCRUTE(_list_typed_component[indice]) ;
+
+ indice++;
+ }
+ //else
+ //if(MYDEBUG) MESSAGE("The component " <<_general_module_list[ind].name << " was already defined in the personal catalog") ;
}
}
// Not found in the personal catalog and in the general catalog
// return NULL object
if(MYDEBUG) MESSAGE("Component with name " << name
- << " not found in catalog");
+ << " not found in catalog");
}
return compo;
if (!C_parser)
for (unsigned int ind=0; ind < _personal_module_list.size();ind++)
{
- if (name.compare(_personal_module_list[ind].name) == 0)
- {
- if(MYDEBUG) MESSAGE("Component named " << name
- << " found in the personal catalog");
- C_parser = &(_personal_module_list[ind]);
- break;
- }
+ if (name.compare(_personal_module_list[ind].name) == 0)
+ {
+ if(MYDEBUG) MESSAGE("Component named " << name
+ << " found in the personal catalog");
+ C_parser = &(_personal_module_list[ind]);
+ break;
+ }
}
if (!C_parser)
for (unsigned int ind=0; ind < _general_module_list.size();ind++)
{
- if (name.compare(_general_module_list[ind].name) == 0)
- {
- // if(MYDEBUG) MESSAGE("Component named " << name
- // << " found in the general catalog");
- C_parser = &(_general_module_list[ind]);
- break;
- }
+ if (name.compare(_general_module_list[ind].name) == 0)
+ {
+ // if(MYDEBUG) MESSAGE("Component named " << name
+ // << " found in the general catalog");
+ C_parser = &(_general_module_list[ind]);
+ break;
+ }
}
return C_parser;
//----------------------------------------------------------------------
void
SALOME_ModuleCatalogImpl::_parse_xml_file(const char* file,
- ParserComponents& modulelist,
- ParserPathPrefixes& pathList,
+ ParserComponents& modulelist,
+ ParserPathPrefixes& pathList,
ParserTypes& typeMap,
TypeList& typeList)
{
xmlDocPtr aDoc = xmlReadFile(file, NULL, 0);
if (aDoc != NULL)
- handler->ProcessXmlDocument(aDoc);
+ handler->ProcessXmlDocument(aDoc);
else
- MESSAGE("ModuleCatalog: could not parse file "<<file);
+ MESSAGE("ModuleCatalog: could not parse file "<<file);
xmlFreeDoc(aDoc);
fclose(aFile);
for ( i = 0; i < _moduleList.size(); i++) {
for (j=0; j<modulelist.size(); j++) {
if (modulelist[j].name == _moduleList[i].name)
- break;
+ break;
}
if (j < modulelist.size())
modulelist[j] = _moduleList[i];
for (unsigned int ind1 = 0; ind1 < _length ; ind1 ++)
duplicate(I_corba.interfaceservicelist[ind1],
- I_parser.services[ind1]);
+ I_parser.services[ind1]);
}
//----------------------------------------------------------------------
for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++)
duplicate(S_corba.ServiceinParameter[ind2],
- S_parser.inParameters[ind2]);
+ S_parser.inParameters[ind2]);
// duplicate out Parameters
_length = S_parser.outParameters.size();
for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++)
duplicate(S_corba.ServiceoutParameter[ind2],
- S_parser.outParameters[ind2]);
+ S_parser.outParameters[ind2]);
// duplicate in DataStreamParameters
_length = S_parser.inDataStreamParameters.size();
for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++)
duplicate(S_corba.ServiceinDataStreamParameter[ind2],
- S_parser.inDataStreamParameters[ind2]);
+ S_parser.inDataStreamParameters[ind2]);
// duplicate out DataStreamParameters
_length = S_parser.outDataStreamParameters.size();
for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++)
duplicate(S_corba.ServiceoutDataStreamParameter[ind2],
- S_parser.outDataStreamParameters[ind2]);
+ S_parser.outDataStreamParameters[ind2]);
}
//----------------------------------------------------------------------
//----------------------------------------------------------------------
void
SALOME_ModuleCatalogImpl::duplicate(ParserPathPrefixes &L_out,
- const ParserPathPrefixes &L_in)
+ const ParserPathPrefixes &L_in)
{
L_out = L_in;
}
for (unsigned int ind = 0; ind < pathList.size(); ind++)
{
for (unsigned int ind1 = 0 ; ind1 < pathList[ind].listOfComputer.size(); ind1++)
- {
- _machine_list.push_back(pathList[ind].listOfComputer[ind1]);
- }
+ {
+ _machine_list.push_back(pathList[ind].listOfComputer[ind1]);
+ }
}
// Parse if a computer name is twice in the list of computers
{
for (unsigned int ind1 = ind+1 ; ind1 < _machine_list.size(); ind1++)
{
- if(_machine_list[ind].compare(_machine_list[ind1]) == 0)
- {
- if(MYDEBUG) MESSAGE( "The computer " << _machine_list[ind] << " is indicated more than once in the path list");
- _return_value = false;
- }
+ if(_machine_list[ind].compare(_machine_list[ind1]) == 0)
+ {
+ if(MYDEBUG) MESSAGE( "The computer " << _machine_list[ind] << " is indicated more than once in the path list");
+ _return_value = false;
+ }
}
}
return _return_value;
//----------------------------------------------------------------------
bool
SALOME_ModuleCatalogImpl::_parseArguments(int argc, char **argv,
- char **_general,
- char** _personal)
+ char **_general,
+ char** _personal)
{
bool _return_value = true;
*_general = NULL;
{
if (strcmp(argv[ind],"-help") == 0)
- {
- INFOS( "Usage: " << argv[0]
- << " -common 'path to general catalog' "
- " -personal 'path to personal catalog' "
- " -ORBInitRef NameService=corbaname::localhost");
- _return_value = false ;
- }
+ {
+ INFOS( "Usage: " << argv[0]
+ << " -common 'path to general catalog' "
+ " -personal 'path to personal catalog' "
+ " -ORBInitRef NameService=corbaname::localhost");
+ _return_value = false ;
+ }
if (strcmp(argv[ind],"-common") == 0)
- {
- if (ind + 1 < argc)
- {
- // General catalog file
- *_general = argv[ind + 1] ;
- }
- }
+ {
+ if (ind + 1 < argc)
+ {
+ // General catalog file
+ *_general = argv[ind + 1] ;
+ }
+ }
else if (strcmp(argv[ind],"-personal") == 0)
- {
- if (ind + 1 < argc)
- {
- // Personal catalog file
- *_personal = argv[ind + 1] ;
- }
- }
+ {
+ if (ind + 1 < argc)
+ {
+ // Personal catalog file
+ *_personal = argv[ind + 1] ;
+ }
+ }
}
return _return_value;
}
\param typeMap ParserTypes arguments
*/
virtual void _parse_xml_file(const char* file,
- ParserComponents & modulelist,
- ParserPathPrefixes & pathlist,
+ ParserComponents & modulelist,
+ ParserPathPrefixes & pathlist,
ParserTypes& typeMap,
TypeList& typeList);
\param C_parser const ParserComponent argument
*/
void duplicate(SALOME_ModuleCatalog::ComponentDef & C_corba,
- const ParserComponent & C_parser);
+ const ParserComponent & C_parser);
//! method to create a CORBA interface description from parser
/*!
\param I_parser const ParserInterface argument
*/
void duplicate(SALOME_ModuleCatalog::DefinitionInterface & I_corba,
- const ParserInterface & I_parser);
+ const ParserInterface & I_parser);
//! method to create a CORBA service description from parser
/*!
\param S_parser const ParserService argument
*/
void duplicate(SALOME_ModuleCatalog::Service & S_corba,
- const ParserService & service);
+ const ParserService & service);
//! method to create a CORBA parameter description from parser
/*!
\param P_parser const ParserParameter argument
*/
void duplicate(SALOME_ModuleCatalog::ServicesParameter & P_corba,
- const ParserParameter & P_parser);
+ const ParserParameter & P_parser);
//! method to create a CORBA datastream parameter description from parser
/*!
\param P_parser const ParserDataStreamParameter argument
*/
void duplicate(SALOME_ModuleCatalog::ServicesDataStreamParameter & P_corba,
- const ParserDataStreamParameter & P_parser);
+ const ParserDataStreamParameter & P_parser);
//! method to create the path prefix structures from the catalog parsing
/*!
\return true if parsing is OK
*/
virtual bool _parseArguments(int argc, char **argv,
- char **_general, char** _personal);
+ char **_general, char** _personal);
// Theses variables will contain the path to the general and personal catalogs
void NamingService_WaitForServerReadiness(SALOME_NamingService* NS,
- string serverName)
+ string serverName)
{
long TIMESleep = 500000000; // 500 ms.
int NumberOfTries = 40; // total wait = 20 s.
for (int itry=0; itry < NumberOfTries; itry++)
{
try
- {
- if (serverName.length() == 0)
- {
+ {
+ if (serverName.length() == 0)
+ {
CORBA::String_var dummyadr = NS->getIORaddr(); // to wait for naming service
- found = 1;
- break; // naming service found
- }
- else
- {
- CORBA::Object_var obj = NS->Resolve(serverName.c_str());
- if (! CORBA::is_nil(obj))
- {
- found =1;
- break; // server found, no more try to do
- }
- MESSAGE("Server "<< serverName <<" not yet ready, waiting...");
+ found = 1;
+ break; // naming service found
+ }
+ else
+ {
+ CORBA::Object_var obj = NS->Resolve(serverName.c_str());
+ if (! CORBA::is_nil(obj))
+ {
+ found =1;
+ break; // server found, no more try to do
+ }
+ MESSAGE("Server "<< serverName <<" not yet ready, waiting...");
#ifndef WIN32
nanosleep(&ts_req,&ts_rem); // wait before retry
#else
Sleep(TIMESleep/1000000);
#endif
- }
- }
+ }
+ }
catch( ServiceUnreachable& )
- {
- MESSAGE("CORBA::COMM_FAILURE: Naming Service not yet ready, waiting...");
+ {
+ MESSAGE("CORBA::COMM_FAILURE: Naming Service not yet ready, waiting...");
#ifndef WIN32
nanosleep(&ts_req,&ts_rem); // wait before retry
#else
Sleep(TIMESleep/1000000);
#endif
- }
+ }
}
if (!found)
{
#include <string>
void NAMINGSERVICE_EXPORT NamingService_WaitForServerReadiness(SALOME_NamingService* NS,
- std::string serverName);
+ std::string serverName);
#endif
CosNaming::Name context_name;
vector<string> splitPath;
int dimension_resultat = _createContextNameDir(Path,
- context_name,
- splitPath,
- true);
+ context_name,
+ splitPath,
+ true);
CORBA::Boolean not_exist = false;
catch (CORBA::SystemException&){
INFOS("Register() : CORBA::SystemException: "
- << "unable to contact the naming service");
+ << "unable to contact the naming service");
throw ServiceUnreachable();
}
if (not_exist){
try{
- context_name.length(1);
- for (int i = 0 ; i < dimension_resultat ;i++){
- context_name[0].id = CORBA::string_dup(splitPath[i].c_str());
- context_name[0].kind = CORBA::string_dup("dir");
- // SCRUTE(_context_name[0].id);
- // --- check if the path is created
- try{
- // --- if the context is already created, nothing to do
- CORBA::Object_var obj = _current_context->resolve(context_name);
- _current_context = CosNaming::NamingContext::_narrow(obj);
- }
-
- catch (CosNaming::NamingContext::NotFound &){
- try{
- // --- the context must be created
- CosNaming::NamingContext_var temp_context =
- _current_context->bind_new_context(context_name);
- _current_context = temp_context;
- }
- catch (CosNaming::NamingContext::AlreadyBound&){
- CORBA::Object_var obj = _current_context->resolve(context_name);
- _current_context = CosNaming::NamingContext::_narrow(obj);
- }
- }
- }
+ context_name.length(1);
+ for (int i = 0 ; i < dimension_resultat ;i++){
+ context_name[0].id = CORBA::string_dup(splitPath[i].c_str());
+ context_name[0].kind = CORBA::string_dup("dir");
+ // SCRUTE(_context_name[0].id);
+ // --- check if the path is created
+ try{
+ // --- if the context is already created, nothing to do
+ CORBA::Object_var obj = _current_context->resolve(context_name);
+ _current_context = CosNaming::NamingContext::_narrow(obj);
+ }
+
+ catch (CosNaming::NamingContext::NotFound &){
+ try{
+ // --- the context must be created
+ CosNaming::NamingContext_var temp_context =
+ _current_context->bind_new_context(context_name);
+ _current_context = temp_context;
+ }
+ catch (CosNaming::NamingContext::AlreadyBound&){
+ CORBA::Object_var obj = _current_context->resolve(context_name);
+ _current_context = CosNaming::NamingContext::_narrow(obj);
+ }
+ }
+ }
}
catch (CosNaming::NamingContext::AlreadyBound&){
- INFOS("Register() : CosNaming::NamingContext::AlreadyBound");
+ INFOS("Register() : CosNaming::NamingContext::AlreadyBound");
}
catch (CosNaming::NamingContext::NotFound& ex){
- CosNaming::Name n = ex.rest_of_name;
+ CosNaming::Name n = ex.rest_of_name;
- if (ex.why == CosNaming::NamingContext::missing_node)
- INFOS("Register() : " << (char *) n[0].id
- << " (" << (char *) n[0].kind << ") not found");
+ if (ex.why == CosNaming::NamingContext::missing_node)
+ INFOS("Register() : " << (char *) n[0].id
+ << " (" << (char *) n[0].kind << ") not found");
- if (ex.why == CosNaming::NamingContext::not_context)
- INFOS("Register() : " << (char *) n[0].id
- << " (" << (char *) n[0].kind
- << ") is not a context");
+ if (ex.why == CosNaming::NamingContext::not_context)
+ INFOS("Register() : " << (char *) n[0].id
+ << " (" << (char *) n[0].kind
+ << ") is not a context");
- if (ex.why == CosNaming::NamingContext::not_object)
- INFOS("Register() : " << (char *) n[0].id
- << " (" << (char *) n[0].kind
- << ") is not an object");
+ if (ex.why == CosNaming::NamingContext::not_object)
+ INFOS("Register() : " << (char *) n[0].id
+ << " (" << (char *) n[0].kind
+ << ") is not an object");
}
catch (CosNaming::NamingContext::CannotProceed&){
- INFOS("Register(): CosNaming::NamingContext::CannotProceed");
+ INFOS("Register(): CosNaming::NamingContext::CannotProceed");
}
catch (CosNaming::NamingContext::InvalidName&){
- INFOS("Register(): CosNaming::NamingContext::InvalidName");
+ INFOS("Register(): CosNaming::NamingContext::InvalidName");
}
catch (CORBA::SystemException&){
- INFOS("Register():CORBA::SystemException: "
- << "unable to contact the naming service");
- throw ServiceUnreachable();
+ INFOS("Register():CORBA::SystemException: "
+ << "unable to contact the naming service");
+ throw ServiceUnreachable();
}
}
}
CosNaming::Name n = ex.rest_of_name;
if (ex.why == CosNaming::NamingContext::missing_node)
- INFOS("Register() : " << (char *) n[0].id
- << " (" << (char *) n[0].kind << ") not found");
+ INFOS("Register() : " << (char *) n[0].id
+ << " (" << (char *) n[0].kind << ") not found");
if (ex.why == CosNaming::NamingContext::not_context)
- INFOS("Register() : " << (char *) n[0].id
- << " (" << (char *) n[0].kind
- << ") is not a context");
+ INFOS("Register() : " << (char *) n[0].id
+ << " (" << (char *) n[0].kind
+ << ") is not a context");
if (ex.why == CosNaming::NamingContext::not_object)
- INFOS("Register() : " << (char *) n[0].id
- << " (" << (char *) n[0].kind
- << ") is not an object");
+ INFOS("Register() : " << (char *) n[0].id
+ << " (" << (char *) n[0].kind
+ << ") is not an object");
}
catch (CosNaming::NamingContext::CannotProceed&){
catch (CosNaming::NamingContext::AlreadyBound&){
INFOS("Register(): CosNaming::NamingContext::AlreadyBound, "
- << "object will be rebind");
+ << "object will be rebind");
_current_context->rebind(context_name, ObjRef);
}
catch (CORBA::SystemException&){
INFOS("!!!Register(): CORBA::SystemException: "
- << "unable to contact the naming service");
+ << "unable to contact the naming service");
throw ServiceUnreachable();
}
}
CosNaming::Name context_name;
vector<string> splitPath;
_createContextNameDir(Path,
- context_name,
- splitPath,
- false);
+ context_name,
+ splitPath,
+ false);
ASSERT(!CORBA::is_nil(_current_context));
vector<string>::iterator its = listElem.begin();
while (its != listElem.end())
- {
- MESSAGE(*its);
-
- if ((*its).find(name) == 0)
- {
- return Resolve((*its).c_str());
- }
-
- its++;
- }
+ {
+ MESSAGE(*its);
+
+ if ((*its).find(name) == 0)
+ {
+ return Resolve((*its).c_str());
+ }
+
+ its++;
+ }
}
return obj._retn();
CORBA::Object_ptr
SALOME_NamingService::ResolveComponent(const char* hostname,
- const char* containerName,
- const char* componentName,
- const int nbproc)
+ const char* containerName,
+ const char* componentName,
+ const int nbproc)
throw(ServiceUnreachable)
{
// MESSAGE("ResolveComponent");
char *newContainerName = new char[strlen(containerName) + 8];
sprintf(newContainerName, "%s_%d", containerName, nbproc);
name += newContainerName;
- delete [] newContainerName;
+ delete [] newContainerName;
}
else
SCRUTE(name);
string basename = name;
if (Change_Directory(basename.c_str()))
- {
- vector<string> contList = list_subdirs();
-
- for (unsigned int ind = 0; ind < contList.size(); ind++)
- {
- name = contList[ind].c_str();
-
- if ( nbproc >= 1 )
- {
- char *str_nbproc = new char[8];
- sprintf(str_nbproc, "_%d", nbproc);
- if( strstr(name.c_str(),str_nbproc) == NULL)
- continue; // check only containers with _%d in name
- delete [] str_nbproc;
- }
-
- name += "/";
- name += componentName;
- SCRUTE(name);
- CORBA::Object_ptr obj = ResolveFirst(name.c_str());
-
- if ( !CORBA::is_nil(obj) )
- return obj;
+ {
+ vector<string> contList = list_subdirs();
+
+ for (unsigned int ind = 0; ind < contList.size(); ind++)
+ {
+ name = contList[ind].c_str();
+
+ if ( nbproc >= 1 )
+ {
+ char *str_nbproc = new char[8];
+ sprintf(str_nbproc, "_%d", nbproc);
+ if( strstr(name.c_str(),str_nbproc) == NULL)
+ continue; // check only containers with _%d in name
+ delete [] str_nbproc;
+ }
+
+ name += "/";
+ name += componentName;
+ SCRUTE(name);
+ CORBA::Object_ptr obj = ResolveFirst(name.c_str());
+
+ if ( !CORBA::is_nil(obj) )
+ return obj;
else
Change_Directory(basename.c_str());
- }
- }
+ }
+ }
return CORBA::Object::_nil();
}
// ============================================================================
string SALOME_NamingService::BuildContainerNameForNS(const char *containerName,
- const char *hostname)
+ const char *hostname)
{
string ret = "/Containers/";
ret += hostname;
string
SALOME_NamingService::
BuildContainerNameForNS(const Engines::MachineParameters& params,
- const char *hostname)
+ const char *hostname)
{
string ret = "/Containers/";
ret += hostname;
string
SALOME_NamingService::
BuildContainerNameForNS(const Engines::ContainerParameters& params,
- const char *hostname)
+ const char *hostname)
{
string ret = "/Containers/";
ret += hostname;
CosNaming::Name context_name;
vector<string> splitPath;
_createContextNameDir(path.c_str(),
- context_name,
- splitPath,
- true);
+ context_name,
+ splitPath,
+ true);
// --- Context creation
CosNaming::Name n = ex.rest_of_name;
if (ex.why == CosNaming::NamingContext::missing_node)
- MESSAGE( "Change_Directory() : " << (char *) n[0].id
- << " (" << (char *) n[0].kind << ") not found");
+ MESSAGE( "Change_Directory() : " << (char *) n[0].id
+ << " (" << (char *) n[0].kind << ") not found");
if (ex.why == CosNaming::NamingContext::not_context)
- INFOS("Change_Directory() : " << (char *) n[0].id
- << " (" << (char *) n[0].kind
- << ") is not a context" );
+ INFOS("Change_Directory() : " << (char *) n[0].id
+ << " (" << (char *) n[0].kind
+ << ") is not a context" );
if (ex.why == CosNaming::NamingContext::not_object)
- INFOS( "Change_Directory() : " << (char *) n[0].id
- << " (" << (char *) n[0].kind
- << ") is not an object" );
+ INFOS( "Change_Directory() : " << (char *) n[0].id
+ << " (" << (char *) n[0].kind
+ << ") is not an object" );
}
catch (CosNaming::NamingContext::CannotProceed&)
catch (CORBA::SystemException&)
{
INFOS("Change_Directory():CORBA::SystemException : unable to contact"
- << "the naming service");
+ << "the naming service");
throw ServiceUnreachable();
}
if (! CORBA::is_nil(binding_iterator))
{
while (binding_iterator->next_one(binding))
- {
- CosNaming::Name bindingName = binding->binding_name;
-
- if (binding->binding_type == CosNaming::ncontext)
- {
- MESSAGE( "Context : " << bindingName[0].id );
-
- try
- {
- Change_Directory(bindingName[0].id);
- }
-
- catch (ServiceUnreachable&)
- {
- INFOS( "list(): ServiceUnreachable" )
- throw ServiceUnreachable();
- }
-
- list();
- _current_context = ref_context ;
- }
-
- else if (binding->binding_type == CosNaming::nobject)
- {
- MESSAGE( "Object : " << bindingName[0].id );
- }
- }
+ {
+ CosNaming::Name bindingName = binding->binding_name;
+
+ if (binding->binding_type == CosNaming::ncontext)
+ {
+ MESSAGE( "Context : " << bindingName[0].id );
+
+ try
+ {
+ Change_Directory(bindingName[0].id);
+ }
+
+ catch (ServiceUnreachable&)
+ {
+ INFOS( "list(): ServiceUnreachable" )
+ throw ServiceUnreachable();
+ }
+
+ list();
+ _current_context = ref_context ;
+ }
+
+ else if (binding->binding_type == CosNaming::nobject)
+ {
+ MESSAGE( "Object : " << bindingName[0].id );
+ }
+ }
binding_iterator->destroy();
}
CosNaming::Name context_name;
vector<string> splitPath;
int dimension_resultat = _createContextNameDir(path.c_str(),
- context_name,
- splitPath,
- true);
+ context_name,
+ splitPath,
+ true);
bool exist = false;
{
CORBA::Object_var obj = _current_context->resolve(context_name);
_current_context = CosNaming::NamingContext::_narrow(obj);
- exist = true;
+ exist = true;
}
catch (CosNaming::NamingContext::NotFound &ex)
if (ex.why == CosNaming::NamingContext::missing_node)
INFOS( "Destroy_Name(): " << (char *) n[0].id
<< " (" << (char *) n[0].kind << ") not found" );
- if (ex.why == CosNaming::NamingContext::not_context)
- INFOS( "Destroy_Name() : " << (char *) n[0].id
- << " (" << (char *) n[0].kind
- << ") is not a context" );
- if (ex.why == CosNaming::NamingContext::not_object)
- INFOS( "Destroy_Name() : " << (char *) n[0].id
- << " (" << (char *) n[0].kind
- << ") is not an object" );
+ if (ex.why == CosNaming::NamingContext::not_context)
+ INFOS( "Destroy_Name() : " << (char *) n[0].id
+ << " (" << (char *) n[0].kind
+ << ") is not a context" );
+ if (ex.why == CosNaming::NamingContext::not_object)
+ INFOS( "Destroy_Name() : " << (char *) n[0].id
+ << " (" << (char *) n[0].kind
+ << ") is not an object" );
}
catch (CosNaming::NamingContext::InvalidName &)
context_name.length(1);
try
- {
- // --- the last element is an object and not a directory
+ {
+ // --- the last element is an object and not a directory
- context_name[0].id =
- CORBA::string_dup(splitPath[dimension_resultat].c_str());
- context_name[0].kind = CORBA::string_dup("object");
- SCRUTE(context_name[0].id);
+ context_name[0].id =
+ CORBA::string_dup(splitPath[dimension_resultat].c_str());
+ context_name[0].kind = CORBA::string_dup("object");
+ SCRUTE(context_name[0].id);
- _current_context->unbind(context_name);
- MESSAGE("The object " << context_name[0].id << " has been deleted");
- }
+ _current_context->unbind(context_name);
+ MESSAGE("The object " << context_name[0].id << " has been deleted");
+ }
catch (CosNaming::NamingContext::NotFound& ex)
- {
- CosNaming::Name n = ex.rest_of_name;
-
- if (ex.why == CosNaming::NamingContext::missing_node)
- INFOS( "Destroy_Name() : " << (char *) n[0].id
- << " (" << (char *) n[0].kind << ") not found" );
- if (ex.why == CosNaming::NamingContext::not_context)
- INFOS( "Destroy_Name() : " << (char *) n[0].id
- << " (" << (char *) n[0].kind
- << ") is not a context" );
+ {
+ CosNaming::Name n = ex.rest_of_name;
+
+ if (ex.why == CosNaming::NamingContext::missing_node)
+ INFOS( "Destroy_Name() : " << (char *) n[0].id
+ << " (" << (char *) n[0].kind << ") not found" );
+ if (ex.why == CosNaming::NamingContext::not_context)
+ INFOS( "Destroy_Name() : " << (char *) n[0].id
+ << " (" << (char *) n[0].kind
+ << ") is not a context" );
if (ex.why == CosNaming::NamingContext::not_object)
INFOS( "Destroy_Name() : " << (char *) n[0].id
<< " (" << (char *) n[0].kind
}
catch (CosNaming::NamingContext::CannotProceed&)
- {
- INFOS( "Destroy_Name(): CosNaming::NamingContext::CannotProceed");
- }
+ {
+ INFOS( "Destroy_Name(): CosNaming::NamingContext::CannotProceed");
+ }
catch (CosNaming::NamingContext::InvalidName&)
- {
- INFOS( "Destroy_Name(): CosNaming::NamingContext::InvalidName");
- }
+ {
+ INFOS( "Destroy_Name(): CosNaming::NamingContext::InvalidName");
+ }
catch (CORBA::SystemException&)
- {
- INFOS( "Destroy_Name(): CORBA::SystemException: unable to contact"
- << " the naming service");
- throw ServiceUnreachable();
- }
+ {
+ INFOS( "Destroy_Name(): CORBA::SystemException: unable to contact"
+ << " the naming service");
+ throw ServiceUnreachable();
+ }
}
}
CosNaming::Name context_name;
vector<string> splitPath;
int dimension_resultat = _createContextNameDir(path.c_str(),
- context_name,
- splitPath,
- true);
+ context_name,
+ splitPath,
+ true);
bool exist = false;
if (dimension_resultat > 0)
{
CORBA::Object_var obj = _current_context->resolve(context_name);
_current_context = CosNaming::NamingContext::_narrow(obj);
- exist = true;
+ exist = true;
}
catch (CosNaming::NamingContext::NotFound &ex)
if (ex.why == CosNaming::NamingContext::missing_node)
INFOS( "Destroy_Directory(): " << (char *) n[0].id
<< " (" << (char *) n[0].kind << ") not found" );
- if (ex.why == CosNaming::NamingContext::not_context)
- INFOS( "Destroy_Directory() : " << (char *) n[0].id
- << " (" << (char *) n[0].kind
- << ") is not a context" );
- if (ex.why == CosNaming::NamingContext::not_object)
- INFOS( "Destroy_Directory() : " << (char *) n[0].id
- << " (" << (char *) n[0].kind
- << ") is not an object" );
+ if (ex.why == CosNaming::NamingContext::not_context)
+ INFOS( "Destroy_Directory() : " << (char *) n[0].id
+ << " (" << (char *) n[0].kind
+ << ") is not a context" );
+ if (ex.why == CosNaming::NamingContext::not_object)
+ INFOS( "Destroy_Directory() : " << (char *) n[0].id
+ << " (" << (char *) n[0].kind
+ << ") is not an object" );
}
catch (CosNaming::NamingContext::InvalidName &)
if (isContextDestroyed)
{
try
- {
- _current_context->unbind(context_name);
- MESSAGE( "The bind to the context "
- << context_name[0].id
- << " has been deleted" );
- }
+ {
+ _current_context->unbind(context_name);
+ MESSAGE( "The bind to the context "
+ << context_name[0].id
+ << " has been deleted" );
+ }
catch (CosNaming::NamingContext::NotFound& ex)
- {
- CosNaming::Name n = ex.rest_of_name;
-
- if (ex.why == CosNaming::NamingContext::missing_node)
- INFOS( "Destroy_Directory() : " << (char *) n[0].id
- << " (" << (char *) n[0].kind << ") not found" );
- if (ex.why == CosNaming::NamingContext::not_context)
- INFOS( "Destroy_Directory() : " << (char *) n[0].id
- << " (" << (char *) n[0].kind
- << ") is not a context" );
- if (ex.why == CosNaming::NamingContext::not_object)
- INFOS( "Destroy_Directory() : " << (char *) n[0].id
- << " (" << (char *) n[0].kind
- << ") is not an object" );
- }
+ {
+ CosNaming::Name n = ex.rest_of_name;
+
+ if (ex.why == CosNaming::NamingContext::missing_node)
+ INFOS( "Destroy_Directory() : " << (char *) n[0].id
+ << " (" << (char *) n[0].kind << ") not found" );
+ if (ex.why == CosNaming::NamingContext::not_context)
+ INFOS( "Destroy_Directory() : " << (char *) n[0].id
+ << " (" << (char *) n[0].kind
+ << ") is not a context" );
+ if (ex.why == CosNaming::NamingContext::not_object)
+ INFOS( "Destroy_Directory() : " << (char *) n[0].id
+ << " (" << (char *) n[0].kind
+ << ") is not an object" );
+ }
catch (CosNaming::NamingContext::CannotProceed&)
- {
- INFOS("Destroy_Directory: CosNaming::NamingContext::CannotProceed");
- }
+ {
+ INFOS("Destroy_Directory: CosNaming::NamingContext::CannotProceed");
+ }
catch (CosNaming::NamingContext::InvalidName&)
- {
- INFOS("Destroy_Directory: CosNaming::NamingContext::InvalidName");
- }
+ {
+ INFOS("Destroy_Directory: CosNaming::NamingContext::InvalidName");
+ }
catch (CORBA::SystemException&)
- {
- INFOS("Destroy_Directory:CORBA::SystemException : unable to contact"
- << " the naming service");
- throw ServiceUnreachable();
- }
+ {
+ INFOS("Destroy_Directory:CORBA::SystemException : unable to contact"
+ << " the naming service");
+ throw ServiceUnreachable();
+ }
}
}
vector<string> contList = list_directory();
for (unsigned int ind = 0; ind < contList.size(); ind++)
- Destroy_Name(contList[ind].c_str());
+ Destroy_Name(contList[ind].c_str());
Destroy_Directory(Path);
}
int
SALOME_NamingService::_createContextNameDir(string path,
- CosNaming::Name& context_name,
- vector<string>& splitPath,
- bool onlyDir)
+ CosNaming::Name& context_name,
+ vector<string>& splitPath,
+ bool onlyDir)
{
if (path.empty())
return 0;
{
endIdx = path.find_first_of(delims, begIdx);
if (endIdx == path.length()-1)
- endWithDelim = true;
+ endWithDelim = true;
if (endIdx == string::npos)
- endIdx = path.length();
+ endIdx = path.length();
int lsub = endIdx - begIdx;
if (lsub >= 1)
- splitPath.push_back(path.substr(begIdx, lsub));
+ splitPath.push_back(path.substr(begIdx, lsub));
begIdx = path.find_first_not_of(delims, endIdx);
}
{
dim = splitPath.size()-1; // omit final object
if (endWithDelim) // unless the path ends with a delimiter
- dim++;
+ dim++;
endWithDelim = true;
}
else
// SCRUTE(splitPath[i]);
context_name[i].id = CORBA::string_dup(splitPath[i].c_str());
if (!endWithDelim && (i == dim-1)) // here, the last string is an object
- {
- context_name[i].kind = CORBA::string_dup("object");
-// MESSAGE("--- " <<splitPath[i] <<".object");
- }
+ {
+ context_name[i].kind = CORBA::string_dup("object");
+// MESSAGE("--- " <<splitPath[i] <<".object");
+ }
else
- {
- context_name[i].kind = CORBA::string_dup("dir");
-// MESSAGE("--- " <<splitPath[i] <<".dir");
- }
+ {
+ context_name[i].kind = CORBA::string_dup("dir");
+// MESSAGE("--- " <<splitPath[i] <<".dir");
+ }
}
return dim;
}
if (! CORBA::is_nil(binding_iterator))
{
while (binding_iterator->next_one(binding))
- {
- CosNaming::Name bindingName = binding->binding_name;
-
- if (binding->binding_type == CosNaming::ncontext)
- {
- // --- We work on a directory,
- // the search should be done in this directory
-
- Change_Directory(bindingName[0].id);
- _Find(name, occurence_number);
-
- // --- We'll go back to the initial context
-
- _current_context = ref_context ;
- }
-
- else if (binding->binding_type == CosNaming::nobject)
- {
- // --- We work on an object...
-
- if (!strcmp( bindingName[0].id, name))
- {
- //MESSAGE("One occurence was found");
- occurence_number++;
-
- // --- We keep in memory the directory where
- // one occurence was found
-
- found_context = _current_context ;
- }
- }
- }
+ {
+ CosNaming::Name bindingName = binding->binding_name;
+
+ if (binding->binding_type == CosNaming::ncontext)
+ {
+ // --- We work on a directory,
+ // the search should be done in this directory
+
+ Change_Directory(bindingName[0].id);
+ _Find(name, occurence_number);
+
+ // --- We'll go back to the initial context
+
+ _current_context = ref_context ;
+ }
+
+ else if (binding->binding_type == CosNaming::nobject)
+ {
+ // --- We work on an object...
+
+ if (!strcmp( bindingName[0].id, name))
+ {
+ //MESSAGE("One occurence was found");
+ occurence_number++;
+
+ // --- We keep in memory the directory where
+ // one occurence was found
+
+ found_context = _current_context ;
+ }
+ }
+ }
binding_iterator->destroy();
}
void
SALOME_NamingService::
_current_directory(vector<string>& splitPath,
- int& lengthResult,
- CosNaming::NamingContext_var contextToFind,
- bool& notFound)
+ int& lengthResult,
+ CosNaming::NamingContext_var contextToFind,
+ bool& notFound)
{
MESSAGE("BEGIN OF _current_Directory");
// --- directory, search in it
const char* bindingNameid=bindingName[0].id;
- splitPath.push_back(bindingNameid);
+ splitPath.push_back(bindingNameid);
lengthResult++;
CORBA::Object_var obj = _current_context->resolve(bindingName);
SCRUTE(bindingName[0].id);
Change_Directory(bindingName[0].id);
_current_directory(splitPath,
- lengthResult,
+ lengthResult,
contextToFind,
- notFound);
+ notFound);
if (notFound)
{
_current_context = ref_context;
MESSAGE("Just before the delete of "
- << splitPath[lengthResult-1]);
- splitPath.pop_back();
+ << splitPath[lengthResult-1]);
+ splitPath.pop_back();
lengthResult--;
}
}
// ============================================================================
void SALOME_NamingService::_list_directory_recurs(vector<string>& myList,
- string relativeSubDir,
- string absCurDirectory)
+ string relativeSubDir,
+ string absCurDirectory)
{
CosNaming::BindingList_var binding_list;
CosNaming::BindingIterator_var binding_iterator;
if (! CORBA::is_nil(binding_iterator))
{
while (binding_iterator->next_one(binding))
- {
- CosNaming::Name bindingName = binding->binding_name;
-
- if (binding->binding_type == CosNaming::ncontext)
- {
- string relativeSdir(bindingName[0].id);
- _list_directory_recurs(myList, relativeSdir, absDir);
- }
-
- else if (binding->binding_type == CosNaming::nobject)
- {
- string objName(bindingName[0].id);
- string elt = absDir + "/" + objName;
- SCRUTE(elt);
- myList.push_back(elt);
- }
- }
+ {
+ CosNaming::Name bindingName = binding->binding_name;
+
+ if (binding->binding_type == CosNaming::ncontext)
+ {
+ string relativeSdir(bindingName[0].id);
+ _list_directory_recurs(myList, relativeSdir, absDir);
+ }
+
+ else if (binding->binding_type == CosNaming::nobject)
+ {
+ string objName(bindingName[0].id);
+ string elt = absDir + "/" + objName;
+ SCRUTE(elt);
+ myList.push_back(elt);
+ }
+ }
binding_iterator->destroy();
}
void init_orb(CORBA::ORB_ptr orb=0);
void Register(CORBA::Object_ptr ObjRef,
- const char* Path)
+ const char* Path)
throw(ServiceUnreachable);
CORBA::Object_ptr Resolve(const char* Path)
throw( ServiceUnreachable);
CORBA::Object_ptr ResolveFirst(const char* Path)
throw( ServiceUnreachable);
CORBA::Object_ptr ResolveComponent(const char* hostname,
- const char* containerName,
- const char* componentName,
- const int nbproc=0)
+ const char* containerName,
+ const char* componentName,
+ const int nbproc=0)
throw(ServiceUnreachable);
std::string ContainerName(const char *ContainerName);
std::string ContainerName(const Engines::ContainerParameters& params);
std::string BuildContainerNameForNS(const char *ContainerName,
- const char *hostname);
+ const char *hostname);
std::string
BuildContainerNameForNS(const Engines::ContainerParameters& params,
- const char *hostname);
+ const char *hostname);
// Will Be deleted on SALOME 6
std::string ContainerName(const Engines::MachineParameters& params);
std::string
BuildContainerNameForNS(const Engines::MachineParameters& params,
- const char *hostname);
+ const char *hostname);
int Find(const char* name)
throw(ServiceUnreachable);
bool Create_Directory(const char* Path)
void _initialize_root_context();
int _createContextNameDir(std::string path,
- CosNaming::Name& context_name,
- std::vector<std::string>& splitPath,
- bool onlyDir);
+ CosNaming::Name& context_name,
+ std::vector<std::string>& splitPath,
+ bool onlyDir);
void _Find(const char* name, CORBA::Long& occurence_number);
void _current_directory(std::vector<std::string>& splitPath,
- int& lengthResult,
- CosNaming::NamingContext_var contextToFind,
- bool& notFound);
+ int& lengthResult,
+ CosNaming::NamingContext_var contextToFind,
+ bool& notFound);
void _list_directory_recurs(std::vector<std::string>& myList,
- std::string relativeSubDir,
- std::string absCurDirectory);
+ std::string relativeSubDir,
+ std::string absCurDirectory);
};
ServiceUnreachable::ServiceUnreachable( void ): SALOME_Exception( "ServiceUnreachable" )
{
- ;
+ ;
}
ServiceUnreachable::ServiceUnreachable( const ServiceUnreachable &ex ): SALOME_Exception( ex )
{
- ;
+ ;
}
class NAMINGSERVICE_EXPORT ServiceUnreachable : public SALOME_Exception
{
public :
- ServiceUnreachable( void );
- ServiceUnreachable( const ServiceUnreachable &ex );
+ ServiceUnreachable( void );
+ ServiceUnreachable( const ServiceUnreachable &ex );
} ;
-#endif /* #if ( !defined SERVICEUNREACHABLE_H ) */
+#endif /* #if ( !defined SERVICEUNREACHABLE_H ) */
NSTEST::echo_var anEchoRef = myFactory->createInstance();
_NS.Register(anEchoRef,
- "/Containers/theHostName/theContainerName/theComponentName");
+ "/Containers/theHostName/theContainerName/theComponentName");
obj = _NS.ResolveComponent("theHostName",
- "theContainerName",
- "theComponentName");
+ "theContainerName",
+ "theComponentName");
CPPUNIT_ASSERT(!CORBA::is_nil(obj));
NSTEST::echo_var anEchoRefa = NSTEST::echo::_narrow(obj);
CPPUNIT_ASSERT(!CORBA::is_nil(anEchoRefa));
NSTEST::echo_var anEchoRef2 = myFactory->createInstance();
_NS.Register(anEchoRef2,
- "/Containers/theHostName/theContainerName_2/theComponentName");
+ "/Containers/theHostName/theContainerName_2/theComponentName");
obj = _NS.ResolveComponent("theHostName",
- "theContainerName",
- "theComponentName",
- 2);
+ "theContainerName",
+ "theComponentName",
+ 2);
CPPUNIT_ASSERT(!CORBA::is_nil(obj));
NSTEST::echo_var anEchoRefb = NSTEST::echo::_narrow(obj);
CPPUNIT_ASSERT(!CORBA::is_nil(anEchoRefb));
NSTEST::echo_var anEchoRef = myFactory->createInstance();
_NS.Register(anEchoRef,
- "/Containers/theHostName/theContainerName/theComponentName");
+ "/Containers/theHostName/theContainerName/theComponentName");
obj = _NS.ResolveComponent("",
- "theContainerName",
- "theComponentName");
+ "theContainerName",
+ "theComponentName");
CPPUNIT_ASSERT(CORBA::is_nil(obj));
}
NSTEST::echo_var anEchoRef = myFactory->createInstance();
_NS.Register(anEchoRef,
- "/Containers/theHostName/theContainerName/theComponentName");
+ "/Containers/theHostName/theContainerName/theComponentName");
obj = _NS.ResolveComponent("anUnknownHostName",
- "theContainerName",
- "theComponentName");
+ "theContainerName",
+ "theComponentName");
CPPUNIT_ASSERT(CORBA::is_nil(obj));
}
NSTEST::echo_var anEchoRef = myFactory->createInstance();
_NS.Register(anEchoRef,
- "/Containers/theHostName/theContainerName/theComponentName");
+ "/Containers/theHostName/theContainerName/theComponentName");
NSTEST::echo_var anEchoRef2 = myFactory->createInstance();
_NS.Register(anEchoRef2,
- "/Containers/theHostName/aContainerName/aComponentName");
+ "/Containers/theHostName/aContainerName/aComponentName");
NSTEST::echo_var anEchoRef3 = myFactory->createInstance();
_NS.Register(anEchoRef3,
- "/Containers/theHostName/otherContainerName/theComponentName");
+ "/Containers/theHostName/otherContainerName/theComponentName");
obj = _NS.ResolveComponent("anUnknownHostName",
- "",
- "theComponentName");
+ "",
+ "theComponentName");
CPPUNIT_ASSERT(CORBA::is_nil(obj));
obj = _NS.ResolveComponent("theHostName",
- "",
- "theComponentName");
+ "",
+ "theComponentName");
CPPUNIT_ASSERT(!CORBA::is_nil(obj));
NSTEST::echo_var anEchoRefa = NSTEST::echo::_narrow(obj);
CPPUNIT_ASSERT(!CORBA::is_nil(anEchoRefa));
NSTEST::echo_var anEchoRef = myFactory->createInstance();
_NS.Register(anEchoRef,
- "/Containers/theHostName/theContainerName/theComponentName");
+ "/Containers/theHostName/theContainerName/theComponentName");
NSTEST::echo_var anEchoRef2 = myFactory->createInstance();
_NS.Register(anEchoRef2,
- "/Containers/theHostName/aContainerName/aComponentName");
+ "/Containers/theHostName/aContainerName/aComponentName");
NSTEST::echo_var anEchoRef3 = myFactory->createInstance();
_NS.Register(anEchoRef3,
- "/Containers/theHostName/otherContainerName/theComponentName");
+ "/Containers/theHostName/otherContainerName/theComponentName");
obj = _NS.ResolveComponent("theHostName",
- "anUnknownContainerName",
- "theComponentName");
+ "anUnknownContainerName",
+ "theComponentName");
CPPUNIT_ASSERT(CORBA::is_nil(obj));
}
NSTEST::echo_var anEchoRef = myFactory->createInstance();
_NS.Register(anEchoRef,
- "/Containers/theHostName/theContainerName/theComponentName");
+ "/Containers/theHostName/theContainerName/theComponentName");
NSTEST::echo_var anEchoRef2 = myFactory->createInstance();
_NS.Register(anEchoRef2,
- "/Containers/theHostName/EmptyContainerName/");
+ "/Containers/theHostName/EmptyContainerName/");
obj = _NS.ResolveComponent("theHostName",
- "EmptyContainerName",
- "");
+ "EmptyContainerName",
+ "");
CPPUNIT_ASSERT(CORBA::is_nil(obj));
}
NSTEST::echo_var anEchoRef = myFactory->createInstance();
_NS.Register(anEchoRef,
- "/Containers/theHostName/theContainerName/theComponentName");
+ "/Containers/theHostName/theContainerName/theComponentName");
obj = _NS.ResolveComponent("theHostName",
- "theContainerName",
- "anUnknownComponentName");
+ "theContainerName",
+ "anUnknownComponentName");
CPPUNIT_ASSERT(CORBA::is_nil(obj));
}
NSTEST::echo_var anEchoRef = myFactory->createInstance();
_NS.Register(anEchoRef,
- "/Containers/theHostName/theContainerName/theComponentName");
+ "/Containers/theHostName/theContainerName/theComponentName");
obj = _NS.ResolveComponent("theHostName",
- "theContainerName",
- "theComponentName",
- 25);
+ "theContainerName",
+ "theComponentName",
+ 25);
CPPUNIT_ASSERT(CORBA::is_nil(obj));
obj = _NS.ResolveComponent("theHostName",
- "theContainerName",
- "theComponentName",
- -25);
+ "theContainerName",
+ "theComponentName",
+ -25);
CPPUNIT_ASSERT(! CORBA::is_nil(obj));
}
NSTEST::echo_var anEchoRef = myFactory->createInstance();
_NS.Register(anEchoRef,
- "/Containers/theHostName/theContainerName/theComponentName");
+ "/Containers/theHostName/theContainerName/theComponentName");
NSTEST::echo_var anEchoRef2 = myFactory->createInstance();
_NS.Register(anEchoRef2,
- "/Containers/theHostName/aContainerName/aComponentName");
+ "/Containers/theHostName/aContainerName/aComponentName");
NSTEST::echo_var anEchoRef3 = myFactory->createInstance();
_NS.Register(anEchoRef3,
- "/Containers/theHostName/otherContainerName/theComponentName");
+ "/Containers/theHostName/otherContainerName/theComponentName");
NSTEST::echo_var anEchoRef4 = myFactory->createInstance();
_NS.Register(anEchoRef4,
- "/Containers/anHostName/oneContainerName/theComponentName");
+ "/Containers/anHostName/oneContainerName/theComponentName");
_NS.Change_Directory("/Containers");
int occ= _NS.Find("theComponentName");
NSTEST::echo_var anEchoRef = myFactory->createInstance();
_NS.Register(anEchoRef,
- "/Containers/theHostName/theContainerName/theComponentName");
+ "/Containers/theHostName/theContainerName/theComponentName");
NSTEST::echo_var anEchoRef2 = myFactory->createInstance();
_NS.Register(anEchoRef2,
- "/Containers/theHostName/aContainerName/aComponentName");
+ "/Containers/theHostName/aContainerName/aComponentName");
NSTEST::echo_var anEchoRef3 = myFactory->createInstance();
_NS.Register(anEchoRef3,
- "/Containers/theHostName/otherContainerName/theComponentName");
+ "/Containers/theHostName/otherContainerName/theComponentName");
NSTEST::echo_var anEchoRef4 = myFactory->createInstance();
_NS.Register(anEchoRef4,
- "/Containers/anHostName/oneContainerName/theComponentName");
+ "/Containers/anHostName/oneContainerName/theComponentName");
_NS.Change_Directory("/Containers/theHostName/otherContainerName");
obj = _NS.Resolve("theComponentName");
{
vector<string> subdirs = _NS.list_subdirs();
for (int i=0; i<subdirs.size(); i++)
- {
- string subpath=path + "/" +subdirs[i];
- _destroyDirectoryRecurs(subpath);
- }
+ {
+ string subpath=path + "/" +subdirs[i];
+ _destroyDirectoryRecurs(subpath);
+ }
if (_NS.Change_Directory(path.c_str()))
- {
- _NS.Destroy_FullDirectory(path.c_str());
- }
+ {
+ _NS.Destroy_FullDirectory(path.c_str());
+ }
}
}
#include CORBA_SERVER_HEADER(nstest)
class NSTEST_echo_i : public virtual POA_NSTEST::echo,
- public virtual PortableServer::ServantBase
+ public virtual PortableServer::ServantBase
{
public:
NSTEST_echo_i();
};
class NSTEST_aFactory_i : public virtual POA_NSTEST::aFactory,
- public virtual PortableServer::ServantBase
+ public virtual PortableServer::ServantBase
{
public:
NSTEST_aFactory_i();
// XXX TODO: need typedefs and defines for
// XXX compilers that do not support M::x syntax
-typedef CosN::AdminProperties CosN_AdminProperties;
-typedef CosN::AdminPropertiesAdmin CosN_AdminPropertiesAdmin;
-#define CosN_AnyOrder CosN::AnyOrder
-#define CosN_BAD_PROPERTY CosN::BAD_PROPERTY
-#define CosN_BAD_TYPE CosN::BAD_TYPE
-#define CosN_BAD_VALUE CosN::BAD_VALUE
-#define CosN_BestEffort CosN::BestEffort
-#define CosN_ConnectionReliability CosN::ConnectionReliability
-#define CosN_DeadlineOrder CosN::DeadlineOrder
-#define CosN_DefaultPriority CosN::DefaultPriority
-#define CosN_DiscardPolicy CosN::DiscardPolicy
-typedef CosN::EventBatch CosN_EventBatch;
-#define CosN_EventReliability CosN::EventReliability
-typedef CosN::EventType CosN_EventType;
-typedef CosN::EventTypeSeq CosN_EventTypeSeq;
-#define CosN_FifoOrder CosN::FifoOrder
-#define CosN_HighestPriority CosN::HighestPriority
-#define CosN_LifoOrder CosN::LifoOrder
-#define CosN_LowestPriority CosN::LowestPriority
-#define CosN_MaxEventsPerConsumer CosN::MaxEventsPerConsumer
-#define CosN_MaximumBatchSize CosN::MaximumBatchSize
-#define CosN_NamedPropertyRangeSeq CosN::NamedPropertyRangeSeq
-#define CosN_OrderPolicy CosN::OrderPolicy
-#define CosN_PacingInterval CosN::PacingInterval
-#define CosN_Persistent CosN::Persistent
-#define CosN_Priority CosN::Priority
-#define CosN_PriorityOrder CosN::PriorityOrder
-typedef CosN::Property CosN_Property;
-typedef CosN::PropertyError CosN_PropertyError;
-typedef CosN::PropertyErrorSeq CosN_PropertyErrorSeq;
-typedef CosN::PropertyRange CosN_PropertyRange;
-typedef CosN::PropertySeq CosN_PropertySeq;
-typedef CosN::QoSAdmin CosN_QoSAdmin;
-typedef CosN::QoSError_code CosN_QoSError_code;
-typedef CosN::QoSProperties CosN_QoSProperties;
-#define CosN_RejectNewEvents CosN::RejectNewEvents
-#define CosN_StartTimeSupported CosN::StartTimeSupported
-#define CosN_StopTimeSupported CosN::StopTimeSupported
-typedef CosN::StructuredEvent CosN_StructuredEvent;
-#define CosN_Timeout CosN::Timeout
-#define CosN_UNAVAILABLE_PROPERTY CosN::UNAVAILABLE_PROPERTY
-#define CosN_UNAVAILABLE_VALUE CosN::UNAVAILABLE_VALUE
-#define CosN_UNSUPPORTED_PROPERTY CosN::UNSUPPORTED_PROPERTY
-#define CosN_UNSUPPORTED_VALUE CosN::UNSUPPORTED_VALUE
-typedef CosN::UnsupportedAdmin CosN_UnsupportedAdmin;
-typedef CosN::UnsupportedQoS CosN_UnsupportedQoS;
+typedef CosN::AdminProperties CosN_AdminProperties;
+typedef CosN::AdminPropertiesAdmin CosN_AdminPropertiesAdmin;
+#define CosN_AnyOrder CosN::AnyOrder
+#define CosN_BAD_PROPERTY CosN::BAD_PROPERTY
+#define CosN_BAD_TYPE CosN::BAD_TYPE
+#define CosN_BAD_VALUE CosN::BAD_VALUE
+#define CosN_BestEffort CosN::BestEffort
+#define CosN_ConnectionReliability CosN::ConnectionReliability
+#define CosN_DeadlineOrder CosN::DeadlineOrder
+#define CosN_DefaultPriority CosN::DefaultPriority
+#define CosN_DiscardPolicy CosN::DiscardPolicy
+typedef CosN::EventBatch CosN_EventBatch;
+#define CosN_EventReliability CosN::EventReliability
+typedef CosN::EventType CosN_EventType;
+typedef CosN::EventTypeSeq CosN_EventTypeSeq;
+#define CosN_FifoOrder CosN::FifoOrder
+#define CosN_HighestPriority CosN::HighestPriority
+#define CosN_LifoOrder CosN::LifoOrder
+#define CosN_LowestPriority CosN::LowestPriority
+#define CosN_MaxEventsPerConsumer CosN::MaxEventsPerConsumer
+#define CosN_MaximumBatchSize CosN::MaximumBatchSize
+#define CosN_NamedPropertyRangeSeq CosN::NamedPropertyRangeSeq
+#define CosN_OrderPolicy CosN::OrderPolicy
+#define CosN_PacingInterval CosN::PacingInterval
+#define CosN_Persistent CosN::Persistent
+#define CosN_Priority CosN::Priority
+#define CosN_PriorityOrder CosN::PriorityOrder
+typedef CosN::Property CosN_Property;
+typedef CosN::PropertyError CosN_PropertyError;
+typedef CosN::PropertyErrorSeq CosN_PropertyErrorSeq;
+typedef CosN::PropertyRange CosN_PropertyRange;
+typedef CosN::PropertySeq CosN_PropertySeq;
+typedef CosN::QoSAdmin CosN_QoSAdmin;
+typedef CosN::QoSError_code CosN_QoSError_code;
+typedef CosN::QoSProperties CosN_QoSProperties;
+#define CosN_RejectNewEvents CosN::RejectNewEvents
+#define CosN_StartTimeSupported CosN::StartTimeSupported
+#define CosN_StopTimeSupported CosN::StopTimeSupported
+typedef CosN::StructuredEvent CosN_StructuredEvent;
+#define CosN_Timeout CosN::Timeout
+#define CosN_UNAVAILABLE_PROPERTY CosN::UNAVAILABLE_PROPERTY
+#define CosN_UNAVAILABLE_VALUE CosN::UNAVAILABLE_VALUE
+#define CosN_UNSUPPORTED_PROPERTY CosN::UNSUPPORTED_PROPERTY
+#define CosN_UNSUPPORTED_VALUE CosN::UNSUPPORTED_VALUE
+typedef CosN::UnsupportedAdmin CosN_UnsupportedAdmin;
+typedef CosN::UnsupportedQoS CosN_UnsupportedQoS;
-#define CosNA_ALL_NOW_UPDATES_OFF CosNA::ALL_NOW_UPDATES_OFF
-#define CosNA_ALL_NOW_UPDATES_ON CosNA::ALL_NOW_UPDATES_ON
-#define CosNA_AND_OP CosNA::AND_OP
-#define CosNA_ANY_EVENT CosNA::ANY_EVENT
-typedef CosNA::AdminID CosNA_AdminID;
-typedef CosNA::AdminIDSeq CosNA_AdminIDSeq;
-typedef CosNA::AdminLimit CosNA_AdminLimit;
-typedef CosNA::AdminLimitExceeded CosNA_AdminLimitExceeded;
-typedef CosNA::AdminNotFound CosNA_AdminNotFound;
-typedef CosNA::ChannelID CosNA_ChannelID;
-typedef CosNA::ChannelIDSeq CosNA_ChannelIDSeq;
-typedef CosNA::ChannelNotFound CosNA_ChannelNotFound;
-typedef CosNA::ClientType CosNA_ClientType;
-typedef CosNA::ConnectionAlreadyActive CosNA_ConnectionAlreadyActive;
-typedef CosNA::ConnectionAlreadyInactive CosNA_ConnectionAlreadyInactive;
-typedef CosNA::ConsumerAdmin CosNA_ConsumerAdmin;
-typedef CosNA::ConsumerAdmin_ptr CosNA_ConsumerAdmin_ptr;
-typedef CosNA::ConsumerAdmin_var CosNA_ConsumerAdmin_var;
-typedef CosNA::EventChannel CosNA_EventChannel;
-typedef CosNA::EventChannelFactory CosNA_EventChannelFactory;
-typedef CosNA::EventChannelFactory_ptr CosNA_EventChannelFactory_ptr;
-typedef CosNA::EventChannelFactory_var CosNA_EventChannelFactory_var;
-typedef CosNA::EventChannel_ptr CosNA_EventChannel_ptr;
-typedef CosNA::EventChannel_var CosNA_EventChannel_var;
-typedef CosNA::InterFilterGroupOperator CosNA_InterFilterGroupOperator;
-#define CosNA_NONE_NOW_UPDATES_OFF CosNA::NONE_NOW_UPDATES_OFF
-#define CosNA_NONE_NOW_UPDATES_ON CosNA::NONE_NOW_UPDATES_ON
-typedef CosNA::NotConnected CosNA_NotConnected;
-#define CosNA_OR_OP CosNA::OR_OP
-typedef CosNA::ObtainInfoMode CosNA_ObtainInfoMode;
-#define CosNA_PULL_ANY CosNA::PULL_ANY
-#define CosNA_PULL_SEQUENCE CosNA::PULL_SEQUENCE
-#define CosNA_PULL_STRUCTURED CosNA::PULL_STRUCTURED
-#define CosNA_PUSH_ANY CosNA::PUSH_ANY
-#define CosNA_PUSH_SEQUENCE CosNA::PUSH_SEQUENCE
-#define CosNA_PUSH_STRUCTURED CosNA::PUSH_STRUCTURED
-#define CosNA_PUSH_TYPED CosNA::PUSH_TYPED
-#define CosNA_PULL_TYPED CosNA::PULL_TYPED
-typedef CosNA::ProxyConsumer CosNA_ProxyConsumer;
-typedef CosNA::ProxyConsumer_ptr CosNA_ProxyConsumer_ptr;
-typedef CosNA::ProxyConsumer_var CosNA_ProxyConsumer_var;
-typedef CosNA::ProxyID CosNA_ProxyID;
-typedef CosNA::ProxyIDSeq CosNA_ProxyIDSeq;
-typedef CosNA::ProxyNotFound CosNA_ProxyNotFound;
-typedef CosNA::ProxyPullConsumer CosNA_ProxyPullConsumer;
-typedef CosNA::ProxyPullConsumer_ptr CosNA_ProxyPullConsumer_ptr;
-typedef CosNA::ProxyPullConsumer_var CosNA_ProxyPullConsumer_var;
-typedef CosNA::ProxyPullSupplier CosNA_ProxyPullSupplier;
-typedef CosNA::ProxyPullSupplier_ptr CosNA_ProxyPullSupplier_ptr;
-typedef CosNA::ProxyPullSupplier_var CosNA_ProxyPullSupplier_var;
-typedef CosNA::ProxyPushConsumer CosNA_ProxyPushConsumer;
-typedef CosNA::ProxyPushConsumer_ptr CosNA_ProxyPushConsumer_ptr;
-typedef CosNA::ProxyPushConsumer_var CosNA_ProxyPushConsumer_var;
-typedef CosNA::ProxyPushSupplier CosNA_ProxyPushSupplier;
-typedef CosNA::ProxyPushSupplier_ptr CosNA_ProxyPushSupplier_ptr;
-typedef CosNA::ProxyPushSupplier_var CosNA_ProxyPushSupplier_var;
-typedef CosNA::ProxySupplier CosNA_ProxySupplier;
-typedef CosNA::ProxySupplier_ptr CosNA_ProxySupplier_ptr;
-typedef CosNA::ProxySupplier_var CosNA_ProxySupplier_var;
-typedef CosNA::ProxyType CosNA_ProxyType;
-#define CosNA_SEQUENCE_EVENT CosNA::SEQUENCE_EVENT
-#define CosNA_STRUCTURED_EVENT CosNA::STRUCTURED_EVENT
-typedef CosNA::SequenceProxyPullConsumer CosNA_SequenceProxyPullConsumer;
-typedef CosNA::SequenceProxyPullConsumer_ptr CosNA_SequenceProxyPullConsumer_ptr;
-typedef CosNA::SequenceProxyPullConsumer_var CosNA_SequenceProxyPullConsumer_var;
-typedef CosNA::SequenceProxyPullSupplier CosNA_SequenceProxyPullSupplier;
-typedef CosNA::SequenceProxyPullSupplier_ptr CosNA_SequenceProxyPullSupplier_ptr;
-typedef CosNA::SequenceProxyPullSupplier_var CosNA_SequenceProxyPullSupplier_var;
-typedef CosNA::SequenceProxyPushConsumer CosNA_SequenceProxyPushConsumer;
-typedef CosNA::SequenceProxyPushConsumer_ptr CosNA_SequenceProxyPushConsumer_ptr;
-typedef CosNA::SequenceProxyPushConsumer_var CosNA_SequenceProxyPushConsumer_var;
-typedef CosNA::SequenceProxyPushSupplier CosNA_SequenceProxyPushSupplier;
-typedef CosNA::SequenceProxyPushSupplier_ptr CosNA_SequenceProxyPushSupplier_ptr;
-typedef CosNA::SequenceProxyPushSupplier_var CosNA_SequenceProxyPushSupplier_var;
-typedef CosNA::StructuredProxyPullConsumer CosNA_StructuredProxyPullConsumer;
-typedef CosNA::StructuredProxyPullConsumer_ptr CosNA_StructuredProxyPullConsumer_ptr;
-typedef CosNA::StructuredProxyPullConsumer_var CosNA_StructuredProxyPullConsumer_var;
-typedef CosNA::StructuredProxyPullSupplier CosNA_StructuredProxyPullSupplier;
-typedef CosNA::StructuredProxyPullSupplier_ptr CosNA_StructuredProxyPullSupplier_ptr;
-typedef CosNA::StructuredProxyPullSupplier_var CosNA_StructuredProxyPullSupplier_var;
-typedef CosNA::StructuredProxyPushConsumer CosNA_StructuredProxyPushConsumer;
-typedef CosNA::StructuredProxyPushConsumer_ptr CosNA_StructuredProxyPushConsumer_ptr;
-typedef CosNA::StructuredProxyPushConsumer_var CosNA_StructuredProxyPushConsumer_var;
-typedef CosNA::StructuredProxyPushSupplier CosNA_StructuredProxyPushSupplier;
-typedef CosNA::StructuredProxyPushSupplier_ptr CosNA_StructuredProxyPushSupplier_ptr;
-typedef CosNA::StructuredProxyPushSupplier_var CosNA_StructuredProxyPushSupplier_var;
-typedef CosNA::SupplierAdmin CosNA_SupplierAdmin;
-typedef CosNA::SupplierAdmin_ptr CosNA_SupplierAdmin_ptr;
-typedef CosNA::SupplierAdmin_var CosNA_SupplierAdmin_var;
+#define CosNA_ALL_NOW_UPDATES_OFF CosNA::ALL_NOW_UPDATES_OFF
+#define CosNA_ALL_NOW_UPDATES_ON CosNA::ALL_NOW_UPDATES_ON
+#define CosNA_AND_OP CosNA::AND_OP
+#define CosNA_ANY_EVENT CosNA::ANY_EVENT
+typedef CosNA::AdminID CosNA_AdminID;
+typedef CosNA::AdminIDSeq CosNA_AdminIDSeq;
+typedef CosNA::AdminLimit CosNA_AdminLimit;
+typedef CosNA::AdminLimitExceeded CosNA_AdminLimitExceeded;
+typedef CosNA::AdminNotFound CosNA_AdminNotFound;
+typedef CosNA::ChannelID CosNA_ChannelID;
+typedef CosNA::ChannelIDSeq CosNA_ChannelIDSeq;
+typedef CosNA::ChannelNotFound CosNA_ChannelNotFound;
+typedef CosNA::ClientType CosNA_ClientType;
+typedef CosNA::ConnectionAlreadyActive CosNA_ConnectionAlreadyActive;
+typedef CosNA::ConnectionAlreadyInactive CosNA_ConnectionAlreadyInactive;
+typedef CosNA::ConsumerAdmin CosNA_ConsumerAdmin;
+typedef CosNA::ConsumerAdmin_ptr CosNA_ConsumerAdmin_ptr;
+typedef CosNA::ConsumerAdmin_var CosNA_ConsumerAdmin_var;
+typedef CosNA::EventChannel CosNA_EventChannel;
+typedef CosNA::EventChannelFactory CosNA_EventChannelFactory;
+typedef CosNA::EventChannelFactory_ptr CosNA_EventChannelFactory_ptr;
+typedef CosNA::EventChannelFactory_var CosNA_EventChannelFactory_var;
+typedef CosNA::EventChannel_ptr CosNA_EventChannel_ptr;
+typedef CosNA::EventChannel_var CosNA_EventChannel_var;
+typedef CosNA::InterFilterGroupOperator CosNA_InterFilterGroupOperator;
+#define CosNA_NONE_NOW_UPDATES_OFF CosNA::NONE_NOW_UPDATES_OFF
+#define CosNA_NONE_NOW_UPDATES_ON CosNA::NONE_NOW_UPDATES_ON
+typedef CosNA::NotConnected CosNA_NotConnected;
+#define CosNA_OR_OP CosNA::OR_OP
+typedef CosNA::ObtainInfoMode CosNA_ObtainInfoMode;
+#define CosNA_PULL_ANY CosNA::PULL_ANY
+#define CosNA_PULL_SEQUENCE CosNA::PULL_SEQUENCE
+#define CosNA_PULL_STRUCTURED CosNA::PULL_STRUCTURED
+#define CosNA_PUSH_ANY CosNA::PUSH_ANY
+#define CosNA_PUSH_SEQUENCE CosNA::PUSH_SEQUENCE
+#define CosNA_PUSH_STRUCTURED CosNA::PUSH_STRUCTURED
+#define CosNA_PUSH_TYPED CosNA::PUSH_TYPED
+#define CosNA_PULL_TYPED CosNA::PULL_TYPED
+typedef CosNA::ProxyConsumer CosNA_ProxyConsumer;
+typedef CosNA::ProxyConsumer_ptr CosNA_ProxyConsumer_ptr;
+typedef CosNA::ProxyConsumer_var CosNA_ProxyConsumer_var;
+typedef CosNA::ProxyID CosNA_ProxyID;
+typedef CosNA::ProxyIDSeq CosNA_ProxyIDSeq;
+typedef CosNA::ProxyNotFound CosNA_ProxyNotFound;
+typedef CosNA::ProxyPullConsumer CosNA_ProxyPullConsumer;
+typedef CosNA::ProxyPullConsumer_ptr CosNA_ProxyPullConsumer_ptr;
+typedef CosNA::ProxyPullConsumer_var CosNA_ProxyPullConsumer_var;
+typedef CosNA::ProxyPullSupplier CosNA_ProxyPullSupplier;
+typedef CosNA::ProxyPullSupplier_ptr CosNA_ProxyPullSupplier_ptr;
+typedef CosNA::ProxyPullSupplier_var CosNA_ProxyPullSupplier_var;
+typedef CosNA::ProxyPushConsumer CosNA_ProxyPushConsumer;
+typedef CosNA::ProxyPushConsumer_ptr CosNA_ProxyPushConsumer_ptr;
+typedef CosNA::ProxyPushConsumer_var CosNA_ProxyPushConsumer_var;
+typedef CosNA::ProxyPushSupplier CosNA_ProxyPushSupplier;
+typedef CosNA::ProxyPushSupplier_ptr CosNA_ProxyPushSupplier_ptr;
+typedef CosNA::ProxyPushSupplier_var CosNA_ProxyPushSupplier_var;
+typedef CosNA::ProxySupplier CosNA_ProxySupplier;
+typedef CosNA::ProxySupplier_ptr CosNA_ProxySupplier_ptr;
+typedef CosNA::ProxySupplier_var CosNA_ProxySupplier_var;
+typedef CosNA::ProxyType CosNA_ProxyType;
+#define CosNA_SEQUENCE_EVENT CosNA::SEQUENCE_EVENT
+#define CosNA_STRUCTURED_EVENT CosNA::STRUCTURED_EVENT
+typedef CosNA::SequenceProxyPullConsumer CosNA_SequenceProxyPullConsumer;
+typedef CosNA::SequenceProxyPullConsumer_ptr CosNA_SequenceProxyPullConsumer_ptr;
+typedef CosNA::SequenceProxyPullConsumer_var CosNA_SequenceProxyPullConsumer_var;
+typedef CosNA::SequenceProxyPullSupplier CosNA_SequenceProxyPullSupplier;
+typedef CosNA::SequenceProxyPullSupplier_ptr CosNA_SequenceProxyPullSupplier_ptr;
+typedef CosNA::SequenceProxyPullSupplier_var CosNA_SequenceProxyPullSupplier_var;
+typedef CosNA::SequenceProxyPushConsumer CosNA_SequenceProxyPushConsumer;
+typedef CosNA::SequenceProxyPushConsumer_ptr CosNA_SequenceProxyPushConsumer_ptr;
+typedef CosNA::SequenceProxyPushConsumer_var CosNA_SequenceProxyPushConsumer_var;
+typedef CosNA::SequenceProxyPushSupplier CosNA_SequenceProxyPushSupplier;
+typedef CosNA::SequenceProxyPushSupplier_ptr CosNA_SequenceProxyPushSupplier_ptr;
+typedef CosNA::SequenceProxyPushSupplier_var CosNA_SequenceProxyPushSupplier_var;
+typedef CosNA::StructuredProxyPullConsumer CosNA_StructuredProxyPullConsumer;
+typedef CosNA::StructuredProxyPullConsumer_ptr CosNA_StructuredProxyPullConsumer_ptr;
+typedef CosNA::StructuredProxyPullConsumer_var CosNA_StructuredProxyPullConsumer_var;
+typedef CosNA::StructuredProxyPullSupplier CosNA_StructuredProxyPullSupplier;
+typedef CosNA::StructuredProxyPullSupplier_ptr CosNA_StructuredProxyPullSupplier_ptr;
+typedef CosNA::StructuredProxyPullSupplier_var CosNA_StructuredProxyPullSupplier_var;
+typedef CosNA::StructuredProxyPushConsumer CosNA_StructuredProxyPushConsumer;
+typedef CosNA::StructuredProxyPushConsumer_ptr CosNA_StructuredProxyPushConsumer_ptr;
+typedef CosNA::StructuredProxyPushConsumer_var CosNA_StructuredProxyPushConsumer_var;
+typedef CosNA::StructuredProxyPushSupplier CosNA_StructuredProxyPushSupplier;
+typedef CosNA::StructuredProxyPushSupplier_ptr CosNA_StructuredProxyPushSupplier_ptr;
+typedef CosNA::StructuredProxyPushSupplier_var CosNA_StructuredProxyPushSupplier_var;
+typedef CosNA::SupplierAdmin CosNA_SupplierAdmin;
+typedef CosNA::SupplierAdmin_ptr CosNA_SupplierAdmin_ptr;
+typedef CosNA::SupplierAdmin_var CosNA_SupplierAdmin_var;
-typedef CosNC::InvalidEventType CosNC_InvalidEventType;
-typedef CosNC::NotifyPublish CosNC_NotifyPublish;
-typedef CosNC::NotifyPublish_ptr CosNC_NotifyPublish_ptr;
-typedef CosNC::NotifyPublish_var CosNC_NotifyPublish_var;
-typedef CosNC::NotifySubscribe CosNC_NotifySubscribe;
-typedef CosNC::NotifySubscribe_ptr CosNC_NotifySubscribe_ptr;
-typedef CosNC::NotifySubscribe_var CosNC_NotifySubscribe_var;
-typedef CosNC::PullConsumer CosNC_PullConsumer;
-typedef CosNC::PullConsumer_ptr CosNC_PullConsumer_ptr;
-typedef CosNC::PullConsumer_var CosNC_PullConsumer_var;
-typedef CosNC::PullSupplier CosNC_PullSupplier;
-typedef CosNC::PullSupplier_ptr CosNC_PullSupplier_ptr;
-typedef CosNC::PullSupplier_var CosNC_PullSupplier_var;
-typedef CosNC::PushConsumer CosNC_PushConsumer;
-typedef CosNC::PushConsumer_ptr CosNC_PushConsumer_ptr;
-typedef CosNC::PushConsumer_var CosNC_PushConsumer_var;
-typedef CosNC::PushSupplier CosNC_PushSupplier;
-typedef CosNC::PushSupplier_ptr CosNC_PushSupplier_ptr;
-typedef CosNC::PushSupplier_var CosNC_PushSupplier_var;
-typedef CosNC::SequencePullConsumer CosNC_SequencePullConsumer;
-typedef CosNC::SequencePullConsumer_ptr CosNC_SequencePullConsumer_ptr;
-typedef CosNC::SequencePullConsumer_var CosNC_SequencePullConsumer_var;
-typedef CosNC::SequencePullSupplier CosNC_SequencePullSupplier;
-typedef CosNC::SequencePullSupplier_ptr CosNC_SequencePullSupplier_ptr;
-typedef CosNC::SequencePullSupplier_var CosNC_SequencePullSupplier_var;
-typedef CosNC::SequencePushConsumer CosNC_SequencePushConsumer;
-typedef CosNC::SequencePushConsumer_ptr CosNC_SequencePushConsumer_ptr;
-typedef CosNC::SequencePushConsumer_var CosNC_SequencePushConsumer_var;
-typedef CosNC::SequencePushSupplier CosNC_SequencePushSupplier;
-typedef CosNC::SequencePushSupplier_ptr CosNC_SequencePushSupplier_ptr;
-typedef CosNC::SequencePushSupplier_var CosNC_SequencePushSupplier_var;
-typedef CosNC::StructuredPullConsumer CosNC_StructuredPullConsumer;
-typedef CosNC::StructuredPullConsumer_ptr CosNC_StructuredPullConsumer_ptr;
-typedef CosNC::StructuredPullConsumer_var CosNC_StructuredPullConsumer_var;
-typedef CosNC::StructuredPullSupplier CosNC_StructuredPullSupplier;
-typedef CosNC::StructuredPullSupplier_ptr CosNC_StructuredPullSupplier_ptr;
-typedef CosNC::StructuredPullSupplier_var CosNC_StructuredPullSupplier_var;
-typedef CosNC::StructuredPushConsumer CosNC_StructuredPushConsumer;
-typedef CosNC::StructuredPushConsumer_ptr CosNC_StructuredPushConsumer_ptr;
-typedef CosNC::StructuredPushConsumer_var CosNC_StructuredPushConsumer_var;
-typedef CosNC::StructuredPushSupplier CosNC_StructuredPushSupplier;
-typedef CosNC::StructuredPushSupplier_ptr CosNC_StructuredPushSupplier_ptr;
-typedef CosNC::StructuredPushSupplier_var CosNC_StructuredPushSupplier_var;
+typedef CosNC::InvalidEventType CosNC_InvalidEventType;
+typedef CosNC::NotifyPublish CosNC_NotifyPublish;
+typedef CosNC::NotifyPublish_ptr CosNC_NotifyPublish_ptr;
+typedef CosNC::NotifyPublish_var CosNC_NotifyPublish_var;
+typedef CosNC::NotifySubscribe CosNC_NotifySubscribe;
+typedef CosNC::NotifySubscribe_ptr CosNC_NotifySubscribe_ptr;
+typedef CosNC::NotifySubscribe_var CosNC_NotifySubscribe_var;
+typedef CosNC::PullConsumer CosNC_PullConsumer;
+typedef CosNC::PullConsumer_ptr CosNC_PullConsumer_ptr;
+typedef CosNC::PullConsumer_var CosNC_PullConsumer_var;
+typedef CosNC::PullSupplier CosNC_PullSupplier;
+typedef CosNC::PullSupplier_ptr CosNC_PullSupplier_ptr;
+typedef CosNC::PullSupplier_var CosNC_PullSupplier_var;
+typedef CosNC::PushConsumer CosNC_PushConsumer;
+typedef CosNC::PushConsumer_ptr CosNC_PushConsumer_ptr;
+typedef CosNC::PushConsumer_var CosNC_PushConsumer_var;
+typedef CosNC::PushSupplier CosNC_PushSupplier;
+typedef CosNC::PushSupplier_ptr CosNC_PushSupplier_ptr;
+typedef CosNC::PushSupplier_var CosNC_PushSupplier_var;
+typedef CosNC::SequencePullConsumer CosNC_SequencePullConsumer;
+typedef CosNC::SequencePullConsumer_ptr CosNC_SequencePullConsumer_ptr;
+typedef CosNC::SequencePullConsumer_var CosNC_SequencePullConsumer_var;
+typedef CosNC::SequencePullSupplier CosNC_SequencePullSupplier;
+typedef CosNC::SequencePullSupplier_ptr CosNC_SequencePullSupplier_ptr;
+typedef CosNC::SequencePullSupplier_var CosNC_SequencePullSupplier_var;
+typedef CosNC::SequencePushConsumer CosNC_SequencePushConsumer;
+typedef CosNC::SequencePushConsumer_ptr CosNC_SequencePushConsumer_ptr;
+typedef CosNC::SequencePushConsumer_var CosNC_SequencePushConsumer_var;
+typedef CosNC::SequencePushSupplier CosNC_SequencePushSupplier;
+typedef CosNC::SequencePushSupplier_ptr CosNC_SequencePushSupplier_ptr;
+typedef CosNC::SequencePushSupplier_var CosNC_SequencePushSupplier_var;
+typedef CosNC::StructuredPullConsumer CosNC_StructuredPullConsumer;
+typedef CosNC::StructuredPullConsumer_ptr CosNC_StructuredPullConsumer_ptr;
+typedef CosNC::StructuredPullConsumer_var CosNC_StructuredPullConsumer_var;
+typedef CosNC::StructuredPullSupplier CosNC_StructuredPullSupplier;
+typedef CosNC::StructuredPullSupplier_ptr CosNC_StructuredPullSupplier_ptr;
+typedef CosNC::StructuredPullSupplier_var CosNC_StructuredPullSupplier_var;
+typedef CosNC::StructuredPushConsumer CosNC_StructuredPushConsumer;
+typedef CosNC::StructuredPushConsumer_ptr CosNC_StructuredPushConsumer_ptr;
+typedef CosNC::StructuredPushConsumer_var CosNC_StructuredPushConsumer_var;
+typedef CosNC::StructuredPushSupplier CosNC_StructuredPushSupplier;
+typedef CosNC::StructuredPushSupplier_ptr CosNC_StructuredPushSupplier_ptr;
+typedef CosNC::StructuredPushSupplier_var CosNC_StructuredPushSupplier_var;
-typedef CosNF::CallbackID CosNF_CallbackID;
-typedef CosNF::CallbackIDSeq CosNF_CallbackIDSeq;
-typedef CosNF::ConstraintExp CosNF_ConstraintExp;
-typedef CosNF::ConstraintExpSeq CosNF_ConstraintExpSeq;
-typedef CosNF::ConstraintID CosNF_ConstraintID;
-typedef CosNF::ConstraintIDSeq CosNF_ConstraintIDSeq;
-typedef CosNF::ConstraintInfoSeq CosNF_ConstraintInfoSeq;
-typedef CosNF::ConstraintInfoSeq_var CosNF_ConstraintInfoSeq_var;
-typedef CosNF::ConstraintNotFound CosNF_ConstraintNotFound;
-typedef CosNF::Filter CosNF_Filter;
-typedef CosNF::FilterAdmin CosNF_FilterAdmin;
-typedef CosNF::FilterAdmin_ptr CosNF_FilterAdmin_ptr;
-typedef CosNF::FilterFactory CosNF_FilterFactory;
-typedef CosNF::FilterFactory_ptr CosNF_FilterFactory_ptr;
-typedef CosNF::FilterFactory_var CosNF_FilterFactory_var;
-typedef CosNF::FilterID CosNF_FilterID;
-typedef CosNF::FilterIDSeq CosNF_FilterIDSeq;
-typedef CosNF::FilterNotFound CosNF_FilterNotFound;
-typedef CosNF::Filter_ptr CosNF_Filter_ptr;
-typedef CosNF::Filter_var CosNF_Filter_var;
-typedef CosNF::InvalidConstraint CosNF_InvalidConstraint;
-typedef CosNF::InvalidGrammar CosNF_InvalidGrammar;
-typedef CosNF::MappingConstraintInfoSeq CosNF_MappingConstraintInfoSeq;
-typedef CosNF::MappingConstraintPairSeq CosNF_MappingConstraintPairSeq;
-typedef CosNF::MappingFilter CosNF_MappingFilter;
-typedef CosNF::MappingFilter_ptr CosNF_MappingFilter_ptr;
-typedef CosNF::MappingFilter_var CosNF_MappingFilter_var;
+typedef CosNF::CallbackID CosNF_CallbackID;
+typedef CosNF::CallbackIDSeq CosNF_CallbackIDSeq;
+typedef CosNF::ConstraintExp CosNF_ConstraintExp;
+typedef CosNF::ConstraintExpSeq CosNF_ConstraintExpSeq;
+typedef CosNF::ConstraintID CosNF_ConstraintID;
+typedef CosNF::ConstraintIDSeq CosNF_ConstraintIDSeq;
+typedef CosNF::ConstraintInfoSeq CosNF_ConstraintInfoSeq;
+typedef CosNF::ConstraintInfoSeq_var CosNF_ConstraintInfoSeq_var;
+typedef CosNF::ConstraintNotFound CosNF_ConstraintNotFound;
+typedef CosNF::Filter CosNF_Filter;
+typedef CosNF::FilterAdmin CosNF_FilterAdmin;
+typedef CosNF::FilterAdmin_ptr CosNF_FilterAdmin_ptr;
+typedef CosNF::FilterFactory CosNF_FilterFactory;
+typedef CosNF::FilterFactory_ptr CosNF_FilterFactory_ptr;
+typedef CosNF::FilterFactory_var CosNF_FilterFactory_var;
+typedef CosNF::FilterID CosNF_FilterID;
+typedef CosNF::FilterIDSeq CosNF_FilterIDSeq;
+typedef CosNF::FilterNotFound CosNF_FilterNotFound;
+typedef CosNF::Filter_ptr CosNF_Filter_ptr;
+typedef CosNF::Filter_var CosNF_Filter_var;
+typedef CosNF::InvalidConstraint CosNF_InvalidConstraint;
+typedef CosNF::InvalidGrammar CosNF_InvalidGrammar;
+typedef CosNF::MappingConstraintInfoSeq CosNF_MappingConstraintInfoSeq;
+typedef CosNF::MappingConstraintPairSeq CosNF_MappingConstraintPairSeq;
+typedef CosNF::MappingFilter CosNF_MappingFilter;
+typedef CosNF::MappingFilter_ptr CosNF_MappingFilter_ptr;
+typedef CosNF::MappingFilter_var CosNF_MappingFilter_var;
#endif
};
if (status) {
- //omniORB 4.1.x requiries using only CORBA types instead C types
+ //omniORB 4.1.x requiries using only CORBA types instead C types
const char* Asender;
const char* Agraph;
const char* Atype;
CORBA::ULong Astamp;
const char* Adate;
const char* Anode;
- const char* Amessage;
+ const char* Amessage;
event->filterable_data[0].value >>= Asender;
event->filterable_data[1].value >>= Agraph;
event->filterable_data[2].value >>= Atype;
#include "utilities.h"
Parallel_Salome_file_i::Parallel_Salome_file_i(CORBA::ORB_ptr orb,
- const char * ior,
- int rank) :
+ const char * ior,
+ int rank) :
InterfaceParallel_impl(orb,ior,rank),
Engines::Salome_file_serv(orb,ior,rank),
Engines::Salome_file_base_serv(orb,ior,rank),
std::string file_name = begin->first;
if (_fileManaged[file_name].node > 0 && getMyRank() == 0) {
if (parallel_file == NULL)
- parallel_file = Engines::PaCO_Parallel_Salome_file::PaCO_narrow(proxy, _orb);
+ parallel_file = Engines::PaCO_Parallel_Salome_file::PaCO_narrow(proxy, _orb);
parallel_file->connect(source_Salome_file, _fileManaged[file_name].node);
}
}
void
Parallel_Salome_file_i::connectDistributedFile(const char * file_name,
- Engines::Salome_file_ptr source_Salome_file) {
+ Engines::Salome_file_ptr source_Salome_file) {
Salome_file_i::connectDistributedFile(file_name, source_Salome_file);
// Test if the file is managed in an another node
void
Parallel_Salome_file_i::setDistributedSourceFile(const char* file_name,
- const char * source_file_name) {
+ const char * source_file_name) {
Salome_file_i::setDistributedSourceFile(file_name, source_file_name);
// Test if the file is managed in an another node
// If yes, node is updated
// Test if the file is local or distributed
if (std::string(file_infos.type.in()) == "local")
{
- if (std::string(file_infos.status.in()) == "not_ok")
- result = checkLocalFile(file_infos.file_name.in());
+ if (std::string(file_infos.status.in()) == "not_ok")
+ result = checkLocalFile(file_infos.file_name.in());
}
else
{
- if (std::string(file_infos.status.in()) == "not_ok") {
- // 2 cases :
- // Source file is a Salome_file
- // Source file is a Parallel_Salome_file
- PaCO::InterfaceManager_var interface_manager =
- PaCO::InterfaceManager::_narrow(_fileDistributedSource[file_infos.file_name.in()]);
- if (CORBA::is_nil(interface_manager))
- result = getDistributedFile(file_infos.file_name.in());
- else
- result = getParallelDistributedFile(file_infos.file_name.in());
- }
+ if (std::string(file_infos.status.in()) == "not_ok") {
+ // 2 cases :
+ // Source file is a Salome_file
+ // Source file is a Parallel_Salome_file
+ PaCO::InterfaceManager_var interface_manager =
+ PaCO::InterfaceManager::_narrow(_fileDistributedSource[file_infos.file_name.in()]);
+ if (CORBA::is_nil(interface_manager))
+ result = getDistributedFile(file_infos.file_name.in());
+ else
+ result = getParallelDistributedFile(file_infos.file_name.in());
+ }
}
// if the result is false
// we add this file to files_not_ok
if (!result)
{
- files_not_ok.append(" ");
- files_not_ok.append(file_infos.file_name.in());
+ files_not_ok.append(" ");
+ files_not_ok.append(file_infos.file_name.in());
}
}
}
Engines::Container_ptr cont = parallel_file->updateFile(_fileManaged[fname], node);
parallel_file->connectDistributedFile(fname.c_str(),
- _fileDistributedSource[fname],
- node);
+ _fileDistributedSource[fname],
+ node);
// Update file infos with the new reference of the container
_fileManaged[fname].container = Engines::Container::_duplicate(cont);
{
public:
Parallel_Salome_file_i(CORBA::ORB_ptr orb,
- const char * ior,
- int rank);
+ const char * ior,
+ int rank);
virtual ~Parallel_Salome_file_i();
virtual void setFileNode(const char* file_name, CORBA::Long node);
virtual void save_all(const char* hdf5_file);
virtual void connect(Engines::Salome_file_ptr source_Salome_file);
virtual void connectDistributedFile(const char * file_name,
- Engines::Salome_file_ptr source_Salome_file);
+ Engines::Salome_file_ptr source_Salome_file);
virtual void setDistributedSourceFile(const char* file_name,
- const char * source_file_name);
+ const char * source_file_name);
virtual void recvFiles();
virtual void recvFiles_node();
virtual void setContainer(Engines::Container_ptr container);
//=============================================================================
Engines_Parallel_Component_i::Engines_Parallel_Component_i(CORBA::ORB_ptr orb, char * ior, int rank,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName,
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId * contId,
+ const char *instanceName,
+ const char *interfaceName,
bool notif,
- bool regist) :
+ bool regist) :
InterfaceParallel_impl(orb,ior,rank),
Engines::Component_serv(orb,ior,rank),
Engines::Component_base_serv(orb,ior,rank),
{
CORBA::String_var the_ior = _orb->object_to_string(o);
_myConnexionToRegistry = new RegistryConnexion(0, 0, the_ior,"theSession",
- _instanceName.c_str());
+ _instanceName.c_str());
}
_notifSupplier = new NOTIFICATION_Supplier(instanceName, notif);
_graphName = graphName;
_nodeName = nodeName;
MESSAGE("Engines_Parallel_Component_i::Names( '" << _graphName << "' , '"
- << _nodeName << "' )");
+ << _nodeName << "' )");
}
//=============================================================================
#endif
{
if ( _Sleeping )
- {
- return false ;
- }
+ {
+ return false ;
+ }
else
{
#ifndef WIN32
- RetVal = Killer( _ThreadId ,SIGINT ) ;
+ RetVal = Killer( _ThreadId ,SIGINT ) ;
#else
- RetVal = Killer( *_ThreadId ,SIGINT ) ;
+ RetVal = Killer( *_ThreadId ,SIGINT ) ;
#endif
- //if ( RetVal ) _Sleeping = true;
+ //if ( RetVal ) _Sleeping = true;
}
}
{
if ( _Sleeping )
{
- _Sleeping = false ;
- RetVal = true ;
+ _Sleeping = false ;
+ RetVal = true ;
}
else
{
- RetVal = false ;
+ RetVal = false ;
}
}
return RetVal ;
#else
if ( pthread_self().p != _ThreadId->p )
#endif
- {
+ {
if ( _Sleeping )
- {
- }
+ {
+ }
else
- {
- // Get Cpu in the appropriate thread with that object !...
- theEngines_Component = this ;
+ {
+ // Get Cpu in the appropriate thread with that object !...
+ theEngines_Component = this ;
#ifndef WIN32
- Killer( _ThreadId ,SIGUSR1 ) ;
+ Killer( _ThreadId ,SIGUSR1 ) ;
#else
- Killer( *_ThreadId ,SIGUSR11 ) ;
+ Killer( *_ThreadId ,SIGUSR11 ) ;
#endif
- }
+ }
cpu = _ThreadCpuUsed ;
- }
+ }
else
- {
- _ThreadCpuUsed = CpuUsed() ;
- cpu = _ThreadCpuUsed ;
- // cout << pthread_self() << " Engines_Parallel_Component_i::CpuUsed_impl "
- // << _serviceName << " " << cpu << endl ;
+ {
+ _ThreadCpuUsed = CpuUsed() ;
+ cpu = _ThreadCpuUsed ;
+ // cout << pthread_self() << " Engines_Parallel_Component_i::CpuUsed_impl "
+ // << _serviceName << " " << cpu << endl ;
}
}
else
{
- cpu = _ThreadCpuUsed ;
- // cout << pthread_self() << " Engines_Parallel_Component_i::CpuUsed_impl "
- // << _serviceName << " " << cpu<< endl ;
+ cpu = _ThreadCpuUsed ;
+ // cout << pthread_self() << " Engines_Parallel_Component_i::CpuUsed_impl "
+ // << _serviceName << " " << cpu<< endl ;
}
}
else
{
#ifndef WIN32
MESSAGE(pthread_self() << "Send BeginService notification for " <<serviceName
- << endl << "Parallel Component instance : " << _instanceName << endl << endl);
+ << endl << "Parallel Component instance : " << _instanceName << endl << endl);
#else
MESSAGE(pthread_self().p << "Send BeginService notification for " <<serviceName
- << endl << "Parallel Component instance : " << _instanceName << endl << endl);
+ << endl << "Parallel Component instance : " << _instanceName << endl << endl);
#endif
#ifndef WIN32
_ThreadId = pthread_self() ;
{
std::string cle((*it).first);
if ((*it).second.type()->kind() == CORBA::tk_string)
- {
- const char* value;
- (*it).second >>= value;
- // ---todo: replace __GNUC__ test by an autoconf macro AC_CHECK_FUNC.
+ {
+ const char* value;
+ (*it).second >>= value;
+ // ---todo: replace __GNUC__ test by an autoconf macro AC_CHECK_FUNC.
#if defined __GNUC__
- //int ret = setenv(cle.c_str(), value, overwrite);
- setenv(cle.c_str(), value, overwrite);
+ //int ret = setenv(cle.c_str(), value, overwrite);
+ setenv(cle.c_str(), value, overwrite);
#else
- //CCRT porting : setenv not defined in stdlib.h
- std::string s(cle);
- s+='=';
- s+=value;
- // char* cast because 1st arg of linux putenv function
- // is not a const char* !
- //int ret=putenv((char *)s.c_str());
- putenv((char *)s.c_str());
- //End of CCRT porting
+ //CCRT porting : setenv not defined in stdlib.h
+ std::string s(cle);
+ s+='=';
+ s+=value;
+ // char* cast because 1st arg of linux putenv function
+ // is not a const char* !
+ //int ret=putenv((char *)s.c_str());
+ putenv((char *)s.c_str());
+ //End of CCRT porting
#endif
- MESSAGE("--- setenv: "<<cle<<" = "<< value);
- }
+ MESSAGE("--- setenv: "<<cle<<" = "<< value);
+ }
}
}
#ifndef WIN32
MESSAGE(pthread_self() << " Send EndService notification for " << serviceName
- << endl << " Parallel Component instance : " << _instanceName << " StartUsed "
+ << endl << " Parallel Component instance : " << _instanceName << " StartUsed "
<< _StartUsed << " _ThreadCpuUsed "<< _ThreadCpuUsed << endl <<endl);
#else
MESSAGE(pthread_self().p << " Send EndService notification for " << serviceName
- << endl << " Parallel Component instance : " << _instanceName << " StartUsed "
+ << endl << " Parallel Component instance : " << _instanceName << " StartUsed "
<< _StartUsed << " _ThreadCpuUsed "<< _ThreadCpuUsed << endl <<endl);
#endif
_ThreadId = 0 ;
#endif
{
if ( signum == 0 )
- {
- if ( pthread_cancel( ThreadId ) )
- {
- perror("Killer pthread_cancel error") ;
- return false ;
- }
- else
- {
+ {
+ if ( pthread_cancel( ThreadId ) )
+ {
+ perror("Killer pthread_cancel error") ;
+ return false ;
+ }
+ else
+ {
#ifndef WIN32
- MESSAGE(pthread_self() << "Killer : ThreadId " << ThreadId
- << " pthread_canceled") ;
+ MESSAGE(pthread_self() << "Killer : ThreadId " << ThreadId
+ << " pthread_canceled") ;
#else
MESSAGE(pthread_self().p << "Killer : ThreadId " << ThreadId.p
- << " pthread_canceled") ;
+ << " pthread_canceled") ;
#endif
- }
- }
+ }
+ }
else
- {
- if ( pthread_kill( ThreadId , signum ) == -1 )
- {
- perror("Killer pthread_kill error") ;
- return false ;
- }
- else
- {
+ {
+ if ( pthread_kill( ThreadId , signum ) == -1 )
+ {
+ perror("Killer pthread_kill error") ;
+ return false ;
+ }
+ else
+ {
#ifndef WIN32
MESSAGE(pthread_self() << "Killer : ThreadId " << ThreadId
- << " pthread_killed(" << signum << ")") ;
+ << " pthread_killed(" << signum << ")") ;
#else
MESSAGE(pthread_self().p << "Killer : ThreadId " << ThreadId.p
- << " pthread_killed(" << signum << ")") ;
+ << " pthread_killed(" << signum << ")") ;
#endif
- }
- }
+ }
+ }
}
return true ;
}
if ( _ThreadId || _Executed )
{
if ( getrusage( RUSAGE_SELF , &usage ) == -1 )
- {
- perror("Engines_Parallel_Component_i::CpuUsed") ;
- return 0 ;
- }
+ {
+ perror("Engines_Parallel_Component_i::CpuUsed") ;
+ return 0 ;
+ }
cpu = usage.ru_utime.tv_sec - _StartUsed ;
// cout << pthread_self() << " Engines_Parallel_Component_i::CpuUsed " << " "
// << _serviceName << usage.ru_utime.tv_sec << " - " << _StartUsed
// << _StartUsed << endl ;
}
#else
- // NOT implementet yet
+ // NOT implementet yet
#endif
//=============================================================================
void Engines_Parallel_Component_i::sendMessage(const char *event_type,
- const char *message)
+ const char *message)
{
_notifSupplier->Send(graphName(), nodeName(), event_type, message);
}
//=============================================================================
Engines::TMPFile* Engines_Parallel_Component_i::DumpPython(CORBA::Object_ptr theStudy,
- CORBA::Boolean isPublished,
- CORBA::Boolean& isValidScript)
+ CORBA::Boolean isPublished,
+ CORBA::Boolean& isValidScript)
{
const char* aScript = "def RebuildData(theStudy): pass";
char* aBuffer = new char[strlen(aScript)+1];
Engines::Salome_file_ptr
Engines_Parallel_Component_i::setInputFileToService(const char* service_name,
- const char* Salome_file_name)
+ const char* Salome_file_name)
{
// Try to find the service, if it doesn't exist, we add it.
_Service_file_map_it = _Input_Service_file_map.find(service_name);
Engines::Parallel_Salome_file_proxy_impl * proxy = NULL;
if (getMyRank() == 0) {
proxy = new Engines::Parallel_Salome_file_proxy_impl(CORBA::ORB::_duplicate(_orb),
- new paco_omni_fabrique());
+ new paco_omni_fabrique());
proxy->copyGlobalContext(this);
PaCO::PacoTopology_t serveur_topo;
serveur_topo.total = getTotalNode();
// We send the reference to all the nodes...
Engines::Parallel_Component_var component_proxy =
- Engines::Parallel_Component::_narrow(InterfaceParallel_impl::_proxy);
+ Engines::Parallel_Component::_narrow(InterfaceParallel_impl::_proxy);
component_proxy->send_parallel_proxy_object(proxy_ref);
// Adding proxy into the map
// into the proxy.
for (int i = 0; i < getTotalNode(); i++) {
if (i == getMyRank()) {
- Parallel_Salome_file_i * servant =
- new Parallel_Salome_file_i(CORBA::ORB::_duplicate(_orb),
- proxy_ior.c_str(),
- i);
- servant->copyGlobalContext(this);
-
- // We register the CORBA objet into the POA
- servant->POA_PaCO::InterfaceParallel::_this();
-
- // Register the servant
- servant->deploy();
-
- // Adding servant to the map
- (*_map)[Salome_file_name] = servant;
+ Parallel_Salome_file_i * servant =
+ new Parallel_Salome_file_i(CORBA::ORB::_duplicate(_orb),
+ proxy_ior.c_str(),
+ i);
+ servant->copyGlobalContext(this);
+
+ // We register the CORBA objet into the POA
+ servant->POA_PaCO::InterfaceParallel::_this();
+
+ // Register the servant
+ servant->deploy();
+
+ // Adding servant to the map
+ (*_map)[Salome_file_name] = servant;
}
_my_com->paco_barrier();
// start parallel object
if (getMyRank() == 0) {
- proxy->start();
- _my_com->paco_barrier();
+ proxy->start();
+ _my_com->paco_barrier();
}
else
- _my_com->paco_barrier();
+ _my_com->paco_barrier();
}
// Parallel_Salome_file is created and deployed
delete _proxy;
Engines::Salome_file_ptr
Engines_Parallel_Component_i::setOutputFileToService(const char* service_name,
- const char* Salome_file_name)
+ const char* Salome_file_name)
{
// Try to find the service, if it doesn't exist, we add it.
_Service_file_map_it = _Output_Service_file_map.find(service_name);
// of the Salome_file and transmit his
// reference to the other nodes.
if (getMyRank() == 0) {
- proxy = new Engines::Parallel_Salome_file_proxy_impl(CORBA::ORB::_duplicate(_orb),
- new paco_omni_fabrique());
+ proxy = new Engines::Parallel_Salome_file_proxy_impl(CORBA::ORB::_duplicate(_orb),
+ new paco_omni_fabrique());
proxy->copyGlobalContext(this);
PaCO::PacoTopology_t serveur_topo;
serveur_topo.total = getTotalNode();
// We send the reference to all the nodes...
Engines::Parallel_Component_var component_proxy =
- Engines::Parallel_Component::_narrow(InterfaceParallel_impl::_proxy);
+ Engines::Parallel_Component::_narrow(InterfaceParallel_impl::_proxy);
component_proxy->send_parallel_proxy_object(proxy_ref);
// Adding proxy into the map
// into the proxy.
for (int i = 0; i < getTotalNode(); i++) {
if (i == getMyRank()) {
- Parallel_Salome_file_i * servant =
- new Parallel_Salome_file_i(CORBA::ORB::_duplicate(_orb),
- proxy_ior.c_str(),
- i);
- servant->copyGlobalContext(this);
-
- // We register the CORBA objet into the POA
- servant->POA_PaCO::InterfaceParallel::_this();
-
- // Register the servant
- servant->deploy();
-
- // Adding servant to the map
- (*_map)[Salome_file_name] = servant;
+ Parallel_Salome_file_i * servant =
+ new Parallel_Salome_file_i(CORBA::ORB::_duplicate(_orb),
+ proxy_ior.c_str(),
+ i);
+ servant->copyGlobalContext(this);
+
+ // We register the CORBA objet into the POA
+ servant->POA_PaCO::InterfaceParallel::_this();
+
+ // Register the servant
+ servant->deploy();
+
+ // Adding servant to the map
+ (*_map)[Salome_file_name] = servant;
}
_my_com->paco_barrier();
// start parallel object
if (getMyRank() == 0) {
- proxy->start();
- _my_com->paco_barrier();
+ proxy->start();
+ _my_com->paco_barrier();
}
else
- _my_com->paco_barrier();
+ _my_com->paco_barrier();
}
// Parallel_Salome_file is created and deployed
Engines::Salome_file_ptr
Engines_Parallel_Component_i::getInputFileToService(const char* service_name,
- const char* Salome_file_name)
+ const char* Salome_file_name)
{
// Try to find the service, if it doesn't exist, we throw an exception.
_Proxy_Service_file_map_it = _Proxy_Input_Service_file_map.find(service_name);
Engines::Salome_file_ptr
Engines_Parallel_Component_i::getOutputFileToService(const char* service_name,
- const char* Salome_file_name)
+ const char* Salome_file_name)
{
// Try to find the service, if it doesn't exist, we throw an exception.
_Proxy_Service_file_map_it = _Proxy_Output_Service_file_map.find(service_name);
//=============================================================================
void
Engines_Parallel_Component_i::configureSalome_file(std::string service_name,
- std::string file_port_name,
- Engines::Parallel_Salome_file_proxy_impl * file)
+ std::string file_port_name,
+ Engines::Parallel_Salome_file_proxy_impl * file)
{
// By default this method does nothing
}
{
public:
Engines_Parallel_Component_i(CORBA::ORB_ptr orb, char * ior, int rank,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName,
- bool notif = false,
- bool regist = true);
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId * contId,
+ const char *instanceName,
+ const char *interfaceName,
+ bool notif = false,
+ bool regist = true);
virtual ~Engines_Parallel_Component_i();
CORBA::Long CpuUsed_impl() ;
virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
- CORBA::Boolean isPublished,
- CORBA::Boolean& isValidScript);
+ CORBA::Boolean isPublished,
+ CORBA::Boolean& isValidScript);
// CORBA operations for Salome_file
virtual Engines::Salome_file_ptr getInputFileToService(const char* service_name,
- const char* Salome_file_name);
+ const char* Salome_file_name);
virtual Engines::Salome_file_ptr getOutputFileToService(const char* service_name,
- const char* Salome_file_name);
+ const char* Salome_file_name);
virtual void checkInputFilesToService(const char* service_name);
virtual Engines::Salome_file_ptr setInputFileToService(const char* service_name,
- const char* Salome_file_name);
+ const char* Salome_file_name);
virtual void checkOutputFilesToService(const char* service_name);
virtual Engines::Salome_file_ptr setOutputFileToService(const char* service_name,
- const char* Salome_file_name);
+ const char* Salome_file_name);
void send_parallel_proxy_object(CORBA::Object_ptr proxy_ref);
char * get_parallel_proxy_object();
virtual void configureSalome_file(std::string service_name,
- std::string file_port_name,
- Engines::Parallel_Salome_file_proxy_impl * file);
+ std::string file_port_name,
+ Engines::Parallel_Salome_file_proxy_impl * file);
protected:
int _studyId; // -1: not initialised; 0: multiStudy; >0: study
long _ThreadCpuUsed ;
bool _Executed ;
bool _CanceledThread ;
- bool _destroyed;
+ bool _destroyed;
};
#endif
SALOME_NamingService * ns = new SALOME_NamingService(orb);
// Get the proxy
string proxyNameInNS = ns->BuildContainerNameForNS(containerName.c_str(),
- proxy_hostname.c_str());
+ proxy_hostname.c_str());
obj = ns->Resolve(proxyNameInNS.c_str());
char * proxy_ior = orb->object_to_string(obj);
// Creating a node
string node_name = containerName + "Node";
Engines_Parallel_Container_i * servant = new Engines_Parallel_Container_i(CORBA::ORB::_duplicate(orb),
- proxy_ior,
- myid,
- root_poa,
- node_name);
+ proxy_ior,
+ myid,
+ root_poa,
+ node_name);
// PaCO++ init
paco_fabrique_manager * pfm = paco_getFabriqueManager();
pfm->register_com("dummy", new paco_dummy_fabrique());
snprintf(buffer, 5, "%d", myid);
node_name = node_name + buffer;
string _containerName = ns->BuildContainerNameForNS((char*) node_name.c_str(),
- hostname.c_str());
+ hostname.c_str());
cerr << "---------" << _containerName << "----------" << endl;
ns->Register(obj, _containerName.c_str());
pman->activate();
KERNEL_PYTHON::init_python(argc,argv);
// Code pour choisir le reseau infiniband .....
- /* string hostname_temp = GetHostname();
- hostent * t = gethostbyname(hostname_temp.c_str());
- cerr << " AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA " << t->h_addr << " " << hostname_temp << endl;
- cerr << t->h_addr << endl;
- in_addr * address=(in_addr * ) t->h_addr;
- cerr << inet_ntoa(* address) << endl;
- string ip = inet_ntoa(* address);
- cerr << " AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA " << endl;
- string com = "giop:tcp:" + ip + ":";
- const char* options[][2] = { { "endPoint", com.c_str() }, { 0, 0 } };
- CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "omniORB4", options);
- */
+ /* string hostname_temp = GetHostname();
+ hostent * t = gethostbyname(hostname_temp.c_str());
+ cerr << " AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA " << t->h_addr << " " << hostname_temp << endl;
+ cerr << t->h_addr << endl;
+ in_addr * address=(in_addr * ) t->h_addr;
+ cerr << inet_ntoa(* address) << endl;
+ string ip = inet_ntoa(* address);
+ cerr << " AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA " << endl;
+ string com = "giop:tcp:" + ip + ":";
+ const char* options[][2] = { { "endPoint", com.c_str() }, { 0, 0 } };
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "omniORB4", options);
+ */
std::string containerName("");
containerName = argv[1];
SALOME_NamingService * ns = new SALOME_NamingService(CORBA::ORB::_duplicate(orb));
// On récupère le proxy
string proxyNameInNS = ns->BuildContainerNameForNS(containerName.c_str(),
- proxy_hostname.c_str());
+ proxy_hostname.c_str());
obj = ns->Resolve(proxyNameInNS.c_str());
char * proxy_ior = orb->object_to_string(obj);
// Node creation
string node_name = containerName + "Node";
Engines_Parallel_Container_i * servant = new Engines_Parallel_Container_i(CORBA::ORB::_duplicate(orb),
- proxy_ior,
- myid,
- root_poa,
- node_name);
+ proxy_ior,
+ myid,
+ root_poa,
+ node_name);
// PaCO++ init
paco_fabrique_manager * pfm = paco_getFabriqueManager();
pfm->register_com("mpi", new paco_mpi_fabrique());
// We register nodes in two different parts
// In the real machine name and in the proxy machine
string _containerName = ns->BuildContainerNameForNS(node_name.c_str(),
- hostname.c_str());
+ hostname.c_str());
string _proxymachine_containerName = ns->BuildContainerNameForNS(node_name.c_str(),
- proxy_hostname.c_str());
+ proxy_hostname.c_str());
cerr << "Register container node : " << _containerName << endl;
cerr << "Register container node : " << _proxymachine_containerName << endl;
ns->Register(obj, _containerName.c_str());
Container_proxy_impl_final * proxy =
new Container_proxy_impl_final(orb,
- pfm->get_thread("omnithread"),
- root_poa,
- containerName);
+ pfm->get_thread("omnithread"),
+ root_poa,
+ containerName);
proxy->setLibCom("dummy", proxy);
proxy->setLibThread("omnithread");
// Topo of the parallel object
string hostname = Kernel_Utils::GetHostname();
Engines::Container_var pCont = Engines::Container::_narrow(obj);
string _containerName = ns->BuildContainerNameForNS(containerName.c_str(),
- hostname.c_str());
+ hostname.c_str());
cerr << "---------" << _containerName << "----------" << endl;
ns->Register(pCont, _containerName.c_str());
pman->activate();
pfm->register_thread("omnithread", new paco_omni_fabrique());
Container_proxy_impl_final * proxy = new Container_proxy_impl_final(orb,
- pfm->get_thread("omnithread"),
- root_poa,
- containerName);
+ pfm->get_thread("omnithread"),
+ root_poa,
+ containerName);
// PaCO++ code
proxy->setLibCom("dummy", proxy);
string hostname = Kernel_Utils::GetHostname();
Engines::Container_var pCont = Engines::Container::_narrow(obj);
string _containerName = ns->BuildContainerNameForNS(containerName.c_str(),
- hostname.c_str());
+ hostname.c_str());
cerr << "---------" << _containerName << "----------" << endl;
ns->Register(pCont, _containerName.c_str());
pman->activate();
#include "SALOME_ParallelContainerProxy_i.hxx"
Container_proxy_impl_final::Container_proxy_impl_final(CORBA::ORB_ptr orb,
- paco_fabrique_thread * fab_thread,
- PortableServer::POA_ptr poa,
- std::string containerName,
- bool is_a_return_proxy) :
+ paco_fabrique_thread * fab_thread,
+ PortableServer::POA_ptr poa,
+ std::string containerName,
+ bool is_a_return_proxy) :
Engines::PACO_Container_proxy_impl(orb, fab_thread, is_a_return_proxy),
Engines::Container_proxy_impl(orb, fab_thread, is_a_return_proxy),
InterfaceManager_impl(orb, fab_thread, is_a_return_proxy)
{
try
{
- node->Shutdown();
- MESSAGE("Shutdown done node : " << i);
+ node->Shutdown();
+ MESSAGE("Shutdown done node : " << i);
}
catch (...)
{
- INFOS("Exception catch during Shutdown of node : " << i);
+ INFOS("Exception catch during Shutdown of node : " << i);
}
}
else
#endif
if (paco_test_fct)
{
- // PaCO Component found
- MESSAGE("PACO LIB FOUND");
- _libtype_map[aCompName] = "par";
+ // PaCO Component found
+ MESSAGE("PACO LIB FOUND");
+ _libtype_map[aCompName] = "par";
}
else
{
- MESSAGE("SEQ LIB FOUND");
+ MESSAGE("SEQ LIB FOUND");
#ifndef WIN32
- MESSAGE("dlerror() result is : " << dlerror());
+ MESSAGE("dlerror() result is : " << dlerror());
#endif
}
}
PyObject *globals = PyModule_GetDict(mainmod);
PyObject *pyCont = PyDict_GetItemString(globals, "pyCont");
PyObject *result = PyObject_CallMethod(pyCont,
- (char*)"import_component",
- (char*)"s",componentName);
+ (char*)"import_component",
+ (char*)"s",componentName);
std::string ret_p= PyString_AsString(result);
Py_XDECREF(result);
Py_RELEASE_NEW_THREAD;
if (ret_p=="") // import possible: Python component
{
- MESSAGE("import Python: " << aCompName <<" OK");
+ MESSAGE("import Python: " << aCompName <<" OK");
}
else
{
- MESSAGE("Error in importing Python component : " << aCompName);
- ret = false;
+ MESSAGE("Error in importing Python component : " << aCompName);
+ ret = false;
}
}
_numInstanceMutex.unlock();
Engines::Container_var node = Engines::Container::_narrow(object);
if (!CORBA::is_nil(node))
{
- try
- {
- node->load_component_Library(componentName);
- MESSAGE("Call load_component_Library done node : " << i);
- }
- catch (...)
- {
- INFOS("Exception catch during load_component_Library of node : " << i);
- ret = false;
- }
+ try
+ {
+ node->load_component_Library(componentName);
+ MESSAGE("Call load_component_Library done node : " << i);
+ }
+ catch (...)
+ {
+ INFOS("Exception catch during load_component_Library of node : " << i);
+ ret = false;
+ }
}
else
{
- INFOS("Cannot call load_component_Library node " << i << " ref is nil !");
- ret = false;
+ INFOS("Cannot call load_component_Library node " << i << " ref is nil !");
+ ret = false;
}
}
}
Container_proxy_impl_final::proxy_object * proxy = new Container_proxy_impl_final::proxy_object();
proxy->proxy_id = (component_proxy_factory) (_orb,
- _fab_thread,
- _poa,
- _id,
- &(proxy->proxy_regist),
- instanceName.c_str(),
- _parallel_object_topology.total);
+ _fab_thread,
+ _poa,
+ _id,
+ &(proxy->proxy_regist),
+ instanceName.c_str(),
+ _parallel_object_topology.total);
// --- get reference & servant from id
CORBA::Object_var obj = _poa->id_to_reference(*(proxy->proxy_id));
{
try
{
- node->create_paco_component_node_instance(componentName, _containerName.c_str(), studyId);
- MESSAGE("Call create_paco_component_node_instance done on node : " << i);
+ node->create_paco_component_node_instance(componentName, _containerName.c_str(), studyId);
+ MESSAGE("Call create_paco_component_node_instance done on node : " << i);
}
catch (SALOME::SALOME_Exception & ex)
{
- INFOS("SALOME_EXCEPTION : " << ex.details.text);
- return Engines::Component::_nil();
+ INFOS("SALOME_EXCEPTION : " << ex.details.text);
+ return Engines::Component::_nil();
}
catch (...)
{
- INFOS("Unknown Exception catch during create_paco_component_node_instance on node : " << i);
- return Engines::Component::_nil();
+ INFOS("Unknown Exception catch during create_paco_component_node_instance on node : " << i);
+ return Engines::Component::_nil();
}
}
else
{
public:
Container_proxy_impl_final(CORBA::ORB_ptr orb,
- paco_fabrique_thread * fab_thread,
- PortableServer::POA_ptr poa,
- std::string containerName,
- bool is_a_return_proxy = false);
+ paco_fabrique_thread * fab_thread,
+ PortableServer::POA_ptr poa,
+ std::string containerName,
+ bool is_a_return_proxy = false);
virtual ~Container_proxy_impl_final();
{
Engines::Component_var proxy_corba_ref;
PortableServer::ObjectId * proxy_id;
- RegistryConnexion * proxy_regist;
+ RegistryConnexion * proxy_regist;
};
// Cette liste contient les references vers les différentes
// parallèles ou sequentiels
typedef void (*PACO_TEST_FUNCTION) ();
typedef PortableServer::ObjectId * (*FACTORY_FUNCTION) (CORBA::ORB_ptr,
- paco_fabrique_thread *,
- PortableServer::POA_ptr,
- PortableServer::ObjectId *,
- RegistryConnexion **,
- const char *,
- int);
+ paco_fabrique_thread *,
+ PortableServer::POA_ptr,
+ PortableServer::ObjectId *,
+ RegistryConnexion **,
+ const char *,
+ int);
int _numInstance;
std::string _hostname;
std::string _containerName;
//=============================================================================
Engines_Parallel_Container_i::Engines_Parallel_Container_i (CORBA::ORB_ptr orb,
- char * ior,
- int rank,
- PortableServer::POA_ptr poa,
- std::string containerName,
- bool isServantAloneInProcess) :
+ char * ior,
+ int rank,
+ PortableServer::POA_ptr poa,
+ std::string containerName,
+ bool isServantAloneInProcess) :
InterfaceParallel_impl(orb,ior,rank),
Engines::PACO_Container_serv(orb,ior,rank),
Engines::PACO_Container_base_serv(orb,ior,rank),
PyObject *globals = PyModule_GetDict(mainmod);
PyObject *pyCont = PyDict_GetItemString(globals, "pyCont");
PyObject *result = PyObject_CallMethod(pyCont,
- (char*)"import_component",
- (char*)"s",componentName);
+ (char*)"import_component",
+ (char*)"s",componentName);
std::string ret_p= PyString_AsString(result);
Py_XDECREF(result);
Py_RELEASE_NEW_THREAD;
Engines::Component_ptr
Engines_Parallel_Container_i::create_component_instance(const char*genericRegisterName,
- CORBA::Long studyId)
+ CORBA::Long studyId)
{
MESSAGE("Begin of create_component_instance in node : " << getMyRank());
//=============================================================================
Engines::Component_ptr Engines_Parallel_Container_i::find_component_instance( const char* registeredName,
- CORBA::Long studyId)
+ CORBA::Long studyId)
{
Engines::Component_var anEngine = Engines::Component::_nil();
map<string,Engines::Component_var>::iterator itm =_listInstances_map.begin();
anEngine = (*itm).second;
if (studyId == anEngine->getStudyId())
{
- return anEngine._retn();
+ return anEngine._retn();
}
}
itm++;
//=============================================================================
Engines::Component_ptr Engines_Parallel_Container_i::load_impl( const char* genericRegisterName,
- const char* componentName )
+ const char* componentName )
{
Engines::Component_var iobject = Engines::Component::_nil();
if (load_component_Library(genericRegisterName))
bool Engines_Parallel_Container_i::Kill_impl()
{
MESSAGE("Engines_Parallel_Container_i::Kill() my pid is "<< _pid
- << " my containerName is " << _containerName.c_str()
- << " my machineName is " << _hostname.c_str());
+ << " my containerName is " << _containerName.c_str()
+ << " my machineName is " << _hostname.c_str());
INFOS("===============================================================");
INFOS("= REMOVE calls to Kill_impl in C++ container =");
INFOS("===============================================================");
if (CORBA::is_nil( obj ))
{
iobject = create_component_instance(genericRegisterName.c_str(),
- 0); // force multiStudy instance here !
+ 0); // force multiStudy instance here !
}
else
{
ASSERT (studyId >= 0);
if (studyId != 0) // monoStudy instance: NOK
{
- iobject = Engines::Component::_nil();
- INFOS("load_impl & find_component_instance methods "
- << "NOT SUITABLE for mono study components");
+ iobject = Engines::Component::_nil();
+ INFOS("load_impl & find_component_instance methods "
+ << "NOT SUITABLE for mono study components");
}
}
}
PyObject *globals = PyModule_GetDict(mainmod);
PyObject *pyCont = PyDict_GetItemString(globals, "pyCont");
PyObject *result = PyObject_CallMethod(pyCont,
- (char*)"create_component_instance",
- (char*)"ssl",
- genericRegisterName.c_str(),
- instanceName.c_str(),
- studyId);
+ (char*)"create_component_instance",
+ (char*)"ssl",
+ genericRegisterName.c_str(),
+ instanceName.c_str(),
+ studyId);
std::string iors = PyString_AsString(result);
Py_DECREF(result);
Py_RELEASE_NEW_THREAD;
//=============================================================================
Engines::Component_ptr
Engines_Parallel_Container_i::createCPPInstance(string genericRegisterName,
- void *handle,
- int studyId)
+ void *handle,
+ int studyId)
{
MESSAGE("Entering Engines_Parallel_Container_i::createCPPInstance");
PortableServer::ObjectId *id; //not owner, do not delete (nore use var)
id = (Component_factory) ( _orb, _poa, _id, instanceName.c_str(),
- aGenRegisterName.c_str() );
+ aGenRegisterName.c_str() );
if (id == NULL)
{
INFOS("Factory function returns NULL !");
void
Engines_Parallel_Container_i::create_paco_component_node_instance(const char* componentName,
- const char* proxy_containerName,
- CORBA::Long studyId)
+ const char* proxy_containerName,
+ CORBA::Long studyId)
{
// Init de la méthode
char * proxy_ior;
if (_cntInstances_map[aGenRegisterName] == 0)
{
string impl_name =
- Engines_Component_i::GetDynLibraryName(aGenRegisterName.c_str());
+ Engines_Component_i::GetDynLibraryName(aGenRegisterName.c_str());
SCRUTE(impl_name);
void* handle = _library_map[impl_name];
ASSERT(handle);
#ifndef WIN32
void SigIntHandler(int what , siginfo_t * siginfo ,
- void * toto ) {
+ void * toto ) {
//PAL9042 JR : during the execution of a Signal Handler (and of methods called through Signal Handlers)
// use of streams (and so on) should never be used because :
// streams of C++ are naturally thread-safe and use pthread_mutex_lock ===>
// MESSAGE("SigIntHandler BEGIN sleeping.") ;
int count = 0 ;
while( _Sleeping ) {
- sleep( 1 ) ;
- count += 1 ;
+ sleep( 1 ) ;
+ count += 1 ;
}
// MESSAGE("SigIntHandler LEAVE sleeping after " << count << " s.") ;
}
MESSAGE("SigIntHandler BEGIN sleeping.") ;
int count = 0 ;
while( _Sleeping ) {
- Sleep( 1000 ) ;
- count += 1 ;
+ Sleep( 1000 ) ;
+ count += 1 ;
}
MESSAGE("SigIntHandler LEAVE sleeping after " << count << " s.") ;
}
{
public:
Engines_Parallel_Container_i(CORBA::ORB_ptr orb,
- char * ior,
- int rank,
- PortableServer::POA_ptr poa,
- std::string containerName ,
- bool isServantAloneInProcess = true);
+ char * ior,
+ int rank,
+ PortableServer::POA_ptr poa,
+ std::string containerName ,
+ bool isServantAloneInProcess = true);
virtual ~Engines_Parallel_Container_i();
virtual Engines::Component_ptr
create_component_instance( const char* componentName,
- CORBA::Long studyId); // 0 for multiStudy
+ CORBA::Long studyId); // 0 for multiStudy
Engines::Component_ptr
find_component_instance( const char* registeredName,
- CORBA::Long studyId); // 0 for multiStudy
+ CORBA::Long studyId); // 0 for multiStudy
Engines::Component_ptr
load_impl(const char* nameToRegister,
- const char* componentName);
+ const char* componentName);
void
create_paco_component_node_instance(const char* componentName,
- const char* proxy_containerName,
- CORBA::Long studyId); // 0 for multiStudy
+ const char* proxy_containerName,
+ CORBA::Long studyId); // 0 for multiStudy
void updateInstanceNumber();
Engines::Component_ptr
createCPPInstance(std::string genericRegisterName,
- void *handle,
- int studyId);
+ void *handle,
+ int studyId);
Engines::Component_ptr
createPythonInstance(std::string genericRegisterName,
- int studyId);
+ int studyId);
static bool isPythonContainer(const char* ContainerName);
static void decInstanceCnt(std::string genericRegisterName);
std::map<std::string, PortableServer::ObjectId *> _par_obj_inst_map;
typedef PortableServer::ObjectId * (*FACTORY_FUNCTION) (CORBA::ORB_ptr, char *, int,
- PortableServer::POA_ptr,
- PortableServer::ObjectId *,
- const char *,
- const char *);
+ PortableServer::POA_ptr,
+ PortableServer::ObjectId *,
+ const char *,
+ const char *);
};
#endif
// $Header$
//
/*
- RegistryConnexion should be used by an engine to add or to remove a component.
+ RegistryConnexion should be used by an engine to add or to remove a component.
*/
# if !defined( __RegistryConnexion_HXX__ )
class REGISTRY_EXPORT RegistryConnexion
{
protected :
- const char* _Ior ; // engine ior
- Registry::Components_var _VarComponents ; // RegistryService reference
- std::string _SessionName ;
- std::string _Name ; // code name
- int _Id ; // code identity returned by RegistryService
- void add( const char *aName );
- void remove( void );
- RegistryConnexion( void );
+ const char* _Ior ; // engine ior
+ Registry::Components_var _VarComponents ; // RegistryService reference
+ std::string _SessionName ;
+ std::string _Name ; // code name
+ int _Id ; // code identity returned by RegistryService
+ void add( const char *aName );
+ void remove( void );
+ RegistryConnexion( void );
public :
- RegistryConnexion( int argc , char **argv , const char *ior , const char *ptrSessionName, const char *componentName );
- ~RegistryConnexion();
+ RegistryConnexion( int argc , char **argv , const char *ior , const char *ptrSessionName, const char *componentName );
+ ~RegistryConnexion();
} ;
-# endif /* # if !defined( __RegistryConnexion_H__ ) */
+# endif /* # if !defined( __RegistryConnexion_H__ ) */
{
public :
- enum Status { UNDEF=-1 , TERMINATED=0 , RUNNING=1 } ;
-
- class client_infos
- {
- protected :
- const char* const _ior;
- const char* const _name;
- const long _pid ;
- const char* const _machine;
- const char* const _adip;
- const long _uid;
- const char* const _pwname;
- const long _ts_start ;
- const long _difftime;
- const char* const _cdir ;
- long _ts_hello ;
- long _ts_end ;
- Status _status;
- public :
- friend class RegistryService ;
-
- client_infos( const Registry::Infos &infos );
- ~client_infos();
- };
+ enum Status { UNDEF=-1 , TERMINATED=0 , RUNNING=1 } ;
+
+ class client_infos
+ {
+ protected :
+ const char* const _ior;
+ const char* const _name;
+ const long _pid ;
+ const char* const _machine;
+ const char* const _adip;
+ const long _uid;
+ const char* const _pwname;
+ const long _ts_start ;
+ const long _difftime;
+ const char* const _cdir ;
+ long _ts_hello ;
+ long _ts_end ;
+ Status _status;
+ public :
+ friend class RegistryService ;
+
+ client_infos( const Registry::Infos &infos );
+ ~client_infos();
+ };
public :
- RegistryService(void);
- virtual ~RegistryService(void);
+ RegistryService(void);
+ virtual ~RegistryService(void);
void ping();
CORBA::Long getPID();
- virtual CORBA::ULong add (const Registry::Infos & infos);
- virtual CORBA::ULong size ( void );
+ virtual CORBA::ULong add (const Registry::Infos & infos);
+ virtual CORBA::ULong size ( void );
#ifndef WIN32
- virtual void remove( const CORBA::ULong id );
- virtual void hello( const CORBA::ULong id );
+ virtual void remove( const CORBA::ULong id );
+ virtual void hello( const CORBA::ULong id );
#else
- virtual void remove( CORBA::ULong id );
- virtual void hello( CORBA::ULong id );
+ virtual void remove( CORBA::ULong id );
+ virtual void hello( CORBA::ULong id );
#endif
- virtual void end(void);
+ virtual void end(void);
- virtual Registry::AllInfos *getall(void);
- virtual Registry::AllInfos *history(void);
+ virtual Registry::AllInfos *getall(void);
+ virtual Registry::AllInfos *history(void);
- void SessionName( const char *sessionName ) ;
+ void SessionName( const char *sessionName ) ;
void SetOrb( CORBA::ORB_ptr orb ) { _orb = CORBA::ORB::_duplicate(orb); return; }
protected :
CORBA::ORB_var _orb;
- const char *_SessionName ;
- int _Compteur ;
- std::map<int,client_infos *> _reg ;
- std::map<int,client_infos *> _fin ;
+ const char *_SessionName ;
+ int _Compteur ;
+ std::map<int,client_infos *> _reg ;
+ std::map<int,client_infos *> _fin ;
- Registry::AllInfos* makeseq(std::map<int,client_infos *> &mymap );
+ Registry::AllInfos* makeseq(std::map<int,client_infos *> &mymap );
} ;
SCRUTE(argc)
if( argc<3 )
{
- MESSAGE("you must provide the Salome session name when you call SALOME_Registry_Server") ;
- throw CommException("you must provide the Salome session name when you call SALOME_Registry_Server") ;
+ MESSAGE("you must provide the Salome session name when you call SALOME_Registry_Server") ;
+ throw CommException("you must provide the Salome session name when you call SALOME_Registry_Server") ;
}
const char *ptrSessionName=0 ;
for ( k=1 ; k<argc ; k++ )
{
if( strcmp(argv[k],"--salome_session")==0 )
- {
- ptrSessionName=argv[k+1] ;
- break ;
- }
+ {
+ ptrSessionName=argv[k+1] ;
+ break ;
+ }
}
ASSERT(ptrSessionName) ;
ASSERT(strlen( ptrSessionName )>0) ;
{
if (i!=1)
#ifndef WIN32
- a=nanosleep(&ts_req,&ts_rem);
+ a=nanosleep(&ts_req,&ts_rem);
#else
Sleep(TIMESleep/1000000);
#endif
try
- {
- obj = orb->resolve_initial_references("RootPOA");
- if(!CORBA::is_nil(obj))
- poa = PortableServer::POA::_narrow(obj);
- if(!CORBA::is_nil(poa))
- manager = poa->the_POAManager();
- if(!CORBA::is_nil(orb))
- theObj = orb->resolve_initial_references("NameService");
- if (!CORBA::is_nil(theObj))
- inc = CosNaming::NamingContext::_narrow(theObj);
- }
+ {
+ obj = orb->resolve_initial_references("RootPOA");
+ if(!CORBA::is_nil(obj))
+ poa = PortableServer::POA::_narrow(obj);
+ if(!CORBA::is_nil(poa))
+ manager = poa->the_POAManager();
+ if(!CORBA::is_nil(orb))
+ theObj = orb->resolve_initial_references("NameService");
+ if (!CORBA::is_nil(theObj))
+ inc = CosNaming::NamingContext::_narrow(theObj);
+ }
catch( CORBA::SystemException& )
- {
- MESSAGE( "Registry Server: CORBA::SystemException: Unable to contact the Naming Service" );
- }
+ {
+ MESSAGE( "Registry Server: CORBA::SystemException: Unable to contact the Naming Service" );
+ }
if(!CORBA::is_nil(inc))
- {
- MESSAGE( "Registry Server: Naming Service was found" );
- if(EnvL==1)
- {
- for(int j=1; j<=NumberOfTries; j++)
- {
- if (j!=1)
+ {
+ MESSAGE( "Registry Server: Naming Service was found" );
+ if(EnvL==1)
+ {
+ for(int j=1; j<=NumberOfTries; j++)
+ {
+ if (j!=1)
#ifndef WIN32
- a=nanosleep(&ts_req, &ts_rem);
+ a=nanosleep(&ts_req, &ts_rem);
#else
- Sleep(TIMESleep/1000000);
+ Sleep(TIMESleep/1000000);
#endif
- try
- {
- object = inc->resolve(name);
- }
- catch(CosNaming::NamingContext::NotFound)
- {
- MESSAGE( "Registry Server: Logger Server wasn't found" );
- }
- catch(...)
- {
- MESSAGE( "Registry Server: Unknown exception" );
- }
- if (!CORBA::is_nil(object))
- {
- MESSAGE( "Module Catalog Server: Logger Server was found" );
- REGISTRY=1;
- break;
- }
- }
- }
- }
+ try
+ {
+ object = inc->resolve(name);
+ }
+ catch(CosNaming::NamingContext::NotFound)
+ {
+ MESSAGE( "Registry Server: Logger Server wasn't found" );
+ }
+ catch(...)
+ {
+ MESSAGE( "Registry Server: Unknown exception" );
+ }
+ if (!CORBA::is_nil(object))
+ {
+ MESSAGE( "Module Catalog Server: Logger Server was found" );
+ REGISTRY=1;
+ break;
+ }
+ }
+ }
+ }
if ((REGISTRY==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
- break;
+ break;
}
try
varComponents = ptrRegistry->_this() ;
ptrRegistry->_remove_ref(); //let poa manage registryservice deletion
// The RegistryService must not already exist.
-
+
try
- {
- CORBA::Object_var pipo = naming.Resolve( registryName ) ;
- if (CORBA::is_nil(pipo) ) throw ServiceUnreachable() ;
- MESSAGE("RegistryService servant already existing" ) ;
- exit( EXIT_FAILURE ) ;
- }
+ {
+ CORBA::Object_var pipo = naming.Resolve( registryName ) ;
+ if (CORBA::is_nil(pipo) ) throw ServiceUnreachable() ;
+ MESSAGE("RegistryService servant already existing" ) ;
+ exit( EXIT_FAILURE ) ;
+ }
catch( const ServiceUnreachable &ex )
- {
- }
+ {
+ }
catch( const CORBA::Exception &exx )
- {
- }
+ {
+ }
string absoluteName = string("/") + registryName;
naming.Register( varComponents , absoluteName.c_str() ) ;
MESSAGE("Wait client requests") ;
try
- {
- // Activation du POA
- MESSAGE("POA activation") ;
- manager->activate() ;
-
- // Lancement de l'ORB
- MESSAGE("ORB launching") ;
+ {
+ // Activation du POA
+ MESSAGE("POA activation") ;
+ manager->activate() ;
+
+ // Lancement de l'ORB
+ MESSAGE("ORB launching") ;
#ifdef CHECKTIME
- Utils_Timer timer;
- timer.Start();
- timer.Stop();
- MESSAGE("SALOME_Registry_Server.cxx - orb->run()");
- timer.ShowAbsolute();
+ Utils_Timer timer;
+ timer.Start();
+ timer.Stop();
+ MESSAGE("SALOME_Registry_Server.cxx - orb->run()");
+ timer.ShowAbsolute();
#endif
- orb->run() ;
- }
+ orb->run() ;
+ }
catch( const CORBA::Exception &ex )
- {
- MESSAGE("System error") ;
- return EXIT_FAILURE ;
- }
-
+ {
+ MESSAGE("System error") ;
+ return EXIT_FAILURE ;
+ }
+
}
catch( const SALOME_Exception &ex )
{
MESSAGE( "Communication Error : " << ex.what() )
- return EXIT_FAILURE ;
+ return EXIT_FAILURE ;
}
-
+
END_OF( argv[0] ) ;
// delete myThreadTrace;
return 0 ;
else
{
if(!getenv("KERNEL_ROOT_DIR"))
- throw ResourcesException("you must define KERNEL_ROOT_DIR environment variable!! -> cannot load a CatalogResources.xml");
+ throw ResourcesException("you must define KERNEL_ROOT_DIR environment variable!! -> cannot load a CatalogResources.xml");
default_file = getenv("KERNEL_ROOT_DIR");
default_file += "/share/salome/resources/kernel/CatalogResources.xml";
_path_resources.push_back(default_file);
for (unsigned int i=0; i < sz; i++)
{
if (_resourcesList.find(params.resourceList[i]) != _resourcesList.end())
- local_resourcesList[params.resourceList[i]] = _resourcesList[params.resourceList[i]];
+ local_resourcesList[params.resourceList[i]] = _resourcesList[params.resourceList[i]];
}
}
for (; iter != _resourcesList.end(); iter++)
{
if ((*iter).second.HostName == hostname)
- vec.push_back((*iter).first);
+ vec.push_back((*iter).first);
}
}
ResourceDataToSort::_CPUFreqMHzWanted = params.cpu_clock;
ResourceDataToSort::_memInMBWanted = params.mem_mb;
// --- end of set
-
+
// Sort
std::list<ResourceDataToSort> li;
std::vector<std::string>::iterator iter = vec.begin();
int
ResourcesManager_cpp::AddResourceInCatalog(const resourceParams& paramsOfNewResources,
- const vector<string>& componentsOnNewResources,
- const char *userName,
- AccessModeType mode,
- AccessProtocolType prot,
- AccessProtocolType iprot) throw(ResourcesException)
+ const vector<string>& componentsOnNewResources,
+ const char *userName,
+ AccessModeType mode,
+ AccessProtocolType prot,
+ AccessProtocolType iprot) throw(ResourcesException)
{
vector<string>::const_iterator iter = find(componentsOnNewResources.begin(),
- componentsOnNewResources.end(),
- "KERNEL");
+ componentsOnNewResources.end(),
+ "KERNEL");
if (iter != componentsOnNewResources.end())
{
MapOfParserResourcesType _resourcesList_tmp;
MapOfParserResourcesType _resourcesBatchList_tmp;
SALOME_ResourcesCatalog_Handler* handler =
- new SALOME_ResourcesCatalog_Handler(_resourcesList_tmp);
+ new SALOME_ResourcesCatalog_Handler(_resourcesList_tmp);
const char* aFilePath = (*_path_resources_it).c_str();
FILE* aFile = fopen(aFilePath, "r");
if (aFile != NULL)
{
- xmlDocPtr aDoc = xmlReadFile(aFilePath, NULL, 0);
- if (aDoc != NULL)
- {
- handler->ProcessXmlDocument(aDoc);
-
- // adding new resources to the file
- for (MapOfParserResourcesType_it i = _resourcesList_tmp.begin(); i != _resourcesList_tmp.end(); ++i)
- {
- MapOfParserResourcesType_it j = _resourcesList.find(i->first);
- if (j == _resourcesList.end())
- {
- _resourcesList[i->first] = i->second;
- }
- else
- {
- std::cerr << "ParseXmlFiles Warning, to resource with the same name was found, taking the first declaration : " << i->first << std::endl;
- }
- }
- }
- else
- std::cerr << "ResourcesManager_cpp: could not parse file " << aFilePath << std::endl;
- // Free the document
- xmlFreeDoc(aDoc);
- fclose(aFile);
+ xmlDocPtr aDoc = xmlReadFile(aFilePath, NULL, 0);
+ if (aDoc != NULL)
+ {
+ handler->ProcessXmlDocument(aDoc);
+
+ // adding new resources to the file
+ for (MapOfParserResourcesType_it i = _resourcesList_tmp.begin(); i != _resourcesList_tmp.end(); ++i)
+ {
+ MapOfParserResourcesType_it j = _resourcesList.find(i->first);
+ if (j == _resourcesList.end())
+ {
+ _resourcesList[i->first] = i->second;
+ }
+ else
+ {
+ std::cerr << "ParseXmlFiles Warning, to resource with the same name was found, taking the first declaration : " << i->first << std::endl;
+ }
+ }
+ }
+ else
+ std::cerr << "ResourcesManager_cpp: could not parse file " << aFilePath << std::endl;
+ // Free the document
+ xmlFreeDoc(aDoc);
+ fclose(aFile);
}
else
- std::cerr << "ResourcesManager_cpp: file " << aFilePath << " is not readable." << std::endl;
+ std::cerr << "ResourcesManager_cpp: file " << aFilePath << " is not readable." << std::endl;
delete handler;
}
{
MapOfParserResourcesType::const_iterator it = _resourcesList.find(*iter);
if(it != _resourcesList.end())
- if ( (*it).second.OS == OS)
- resources.push_back(*iter);
+ if ( (*it).second.OS == OS)
+ resources.push_back(*iter);
}
}
}
//=============================================================================
void
ResourcesManager_cpp::KeepOnlyResourcesWithComponent(std::vector<std::string>& resources,
- const vector<string>& componentList)
+ const vector<string>& componentList)
{
std::vector<std::string>::iterator iter = resources.begin();
for (; iter != resources.end(); iter++)
{
for(unsigned int i=0; i<componentList.size(); i++)
{
- const char* compoi = componentList[i].c_str();
- vector<string>::const_iterator itt = find(mapOfComponentsOfCurrentHost.begin(),
- mapOfComponentsOfCurrentHost.end(),
- compoi);
- if (itt == mapOfComponentsOfCurrentHost.end())
- {
- erasedHost = true;
- break;
- }
+ const char* compoi = componentList[i].c_str();
+ vector<string>::const_iterator itt = find(mapOfComponentsOfCurrentHost.begin(),
+ mapOfComponentsOfCurrentHost.end(),
+ compoi);
+ if (itt == mapOfComponentsOfCurrentHost.end())
+ {
+ erasedHost = true;
+ break;
+ }
}
}
if(erasedHost)
GetFittingResources(const resourceParams& params) throw(ResourcesException);
std::string Find(const std::string& policy,
- const std::vector<std::string>& listOfResources);
+ const std::vector<std::string>& listOfResources);
int AddResourceInCatalog (const resourceParams& paramsOfNewResources,
- const std::vector<std::string>& componentsOnNewResources,
- const char *userName,
- AccessModeType mode,
- AccessProtocolType prot,
- AccessProtocolType iprot) throw(ResourcesException);
+ const std::vector<std::string>& componentsOnNewResources,
+ const char *userName,
+ AccessModeType mode,
+ AccessProtocolType prot,
+ AccessProtocolType iprot) throw(ResourcesException);
void DeleteResourceInCatalog(const char * name);
void SelectOnlyResourcesWithOS(std::vector<std::string>& resources, std::string OS);
void KeepOnlyResourcesWithComponent(std::vector<std::string>& resources,
- const std::vector<std::string>& componentList);
+ const std::vector<std::string>& componentList);
//! will contain the path to the ressources catalog
std::list<std::string> _path_resources;
xmlNodePtr members = aCurSubNode->xmlChildrenNode;
while (members != NULL)
{
- // Process members
- if (!xmlStrcmp(members->name, (const xmlChar*)test_machine))
- {
- ParserResourcesClusterMembersType new_member;
- if (ProcessMember(members, new_member))
- resource.ClusterMembersList.push_back(new_member);
- }
- members = members->next;
+ // Process members
+ if (!xmlStrcmp(members->name, (const xmlChar*)test_machine))
+ {
+ ParserResourcesClusterMembersType new_member;
+ if (ProcessMember(members, new_member))
+ resource.ClusterMembersList.push_back(new_member);
+ }
+ members = members->next;
}
}
aCurSubNode = aCurSubNode->next;
switch (protocol[0])
{
case 'r':
- resource.Protocol = rsh;
- break;
+ resource.Protocol = rsh;
+ break;
case 's':
- resource.Protocol = ssh;
- break;
+ resource.Protocol = ssh;
+ break;
default:
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine with a bad protocol" << std::endl;
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" << std::endl;
- return false;
+ std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine with a bad protocol" << std::endl;
+ std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" << std::endl;
+ return false;
}
xmlFree(protocol);
}
switch (iprotocol[0])
{
case 'r':
- resource.ClusterInternalProtocol = rsh;
- break;
+ resource.ClusterInternalProtocol = rsh;
+ break;
case 's':
- resource.ClusterInternalProtocol = ssh;
- break;
+ resource.ClusterInternalProtocol = ssh;
+ break;
default:
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine with a bad protocol" << std::endl;
- std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" << std::endl;
- return false;
+ std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine with a bad protocol" << std::endl;
+ std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" << std::endl;
+ return false;
}
xmlFree(iprotocol);
}
switch ( protocol[0])
{
case 'r':
- resource.Protocol = rsh;
- break;
+ resource.Protocol = rsh;
+ break;
case 's':
- resource.Protocol = ssh;
- break;
+ resource.Protocol = ssh;
+ break;
default:
- // If it'not in all theses cases, the protocol is affected to rsh
- resource.Protocol = rsh;
- break;
+ // If it'not in all theses cases, the protocol is affected to rsh
+ resource.Protocol = rsh;
+ break;
}
xmlFree(protocol);
}
switch ( iprotocol[0])
{
case 'r':
- resource.ClusterInternalProtocol = rsh;
- break;
+ resource.ClusterInternalProtocol = rsh;
+ break;
case 's':
- resource.ClusterInternalProtocol = ssh;
- break;
+ resource.ClusterInternalProtocol = ssh;
+ break;
default:
- // If it'not in all theses cases, the protocol is affected to rsh
- resource.ClusterInternalProtocol = rsh;
- break;
+ // If it'not in all theses cases, the protocol is affected to rsh
+ resource.ClusterInternalProtocol = rsh;
+ break;
}
xmlFree(iprotocol);
}
switch ( mode[0] )
{
case 'i':
- resource.Mode = interactive;
- break;
+ resource.Mode = interactive;
+ break;
case 'b':
- resource.Mode = batch;
- break;
+ resource.Mode = batch;
+ break;
default:
- // If it'not in all theses cases, the mode is affected to interactive
- resource.Mode = interactive;
- break;
+ // If it'not in all theses cases, the mode is affected to interactive
+ resource.Mode = interactive;
+ break;
}
xmlFree(mode);
}
//except if the module name is given
if (xmlHasProp(aCurSubNode, (const xmlChar*)test_component_name))
{
- xmlChar* component_name = xmlGetProp(aCurSubNode, (const xmlChar*)test_component_name);
- std::string aComponentName = (const char*)component_name;
- _resource.ComponentsList.push_back(aComponentName);
- if (xmlHasProp(aCurSubNode, (const xmlChar*)test_module_name))
- {
- xmlChar* module_name = xmlGetProp(aCurSubNode, (const xmlChar*)test_module_name);
- std::string aModuleName = (const char*)module_name;
- _resource.ModulesList.push_back(aModuleName);
- xmlFree(module_name);
- }
- else
- _resource.ModulesList.push_back(aComponentName);
- xmlFree(component_name);
+ xmlChar* component_name = xmlGetProp(aCurSubNode, (const xmlChar*)test_component_name);
+ std::string aComponentName = (const char*)component_name;
+ _resource.ComponentsList.push_back(aComponentName);
+ if (xmlHasProp(aCurSubNode, (const xmlChar*)test_module_name))
+ {
+ xmlChar* module_name = xmlGetProp(aCurSubNode, (const xmlChar*)test_module_name);
+ std::string aModuleName = (const char*)module_name;
+ _resource.ModulesList.push_back(aModuleName);
+ xmlFree(module_name);
+ }
+ else
+ _resource.ModulesList.push_back(aComponentName);
+ xmlFree(component_name);
}
}
// Process modules
switch ((*iter).second.Protocol)
{
case rsh:
- xmlNewProp(node, BAD_CAST test_protocol, BAD_CAST "rsh");
- break;
+ xmlNewProp(node, BAD_CAST test_protocol, BAD_CAST "rsh");
+ break;
case ssh:
- xmlNewProp(node, BAD_CAST test_protocol, BAD_CAST "ssh");
- break;
+ xmlNewProp(node, BAD_CAST test_protocol, BAD_CAST "ssh");
+ break;
default:
- xmlNewProp(node, BAD_CAST test_protocol, BAD_CAST "rsh");
+ xmlNewProp(node, BAD_CAST test_protocol, BAD_CAST "rsh");
}
switch ((*iter).second.ClusterInternalProtocol)
{
case rsh:
- xmlNewProp(node, BAD_CAST test_cluster_internal_protocol, BAD_CAST "rsh");
- break;
+ xmlNewProp(node, BAD_CAST test_cluster_internal_protocol, BAD_CAST "rsh");
+ break;
case ssh:
- xmlNewProp(node, BAD_CAST test_cluster_internal_protocol, BAD_CAST "ssh");
- break;
+ xmlNewProp(node, BAD_CAST test_cluster_internal_protocol, BAD_CAST "ssh");
+ break;
default:
- xmlNewProp(node, BAD_CAST test_cluster_internal_protocol, BAD_CAST "rsh");
+ xmlNewProp(node, BAD_CAST test_cluster_internal_protocol, BAD_CAST "rsh");
}
switch ((*iter).second.Mode)
{
case interactive:
- xmlNewProp(node, BAD_CAST test_mode, BAD_CAST "interactive");
- break;
+ xmlNewProp(node, BAD_CAST test_mode, BAD_CAST "interactive");
+ break;
case batch:
- xmlNewProp(node, BAD_CAST test_mode, BAD_CAST "batch");
- break;
+ xmlNewProp(node, BAD_CAST test_mode, BAD_CAST "batch");
+ break;
default:
- xmlNewProp(node, BAD_CAST test_mode, BAD_CAST "interactive");
+ xmlNewProp(node, BAD_CAST test_mode, BAD_CAST "interactive");
}
switch ((*iter).second.Batch)
{
case pbs:
- xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "pbs");
- break;
+ xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "pbs");
+ break;
case lsf:
- xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "lsf");
- break;
+ xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "lsf");
+ break;
case sge:
- xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "sge");
- break;
+ xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "sge");
+ break;
case ssh_batch:
- xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "ssh_batch");
- break;
+ xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "ssh_batch");
+ break;
default:
- xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "");
+ xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "");
}
switch ((*iter).second.mpi)
{
case lam:
- xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "lam");
- break;
+ xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "lam");
+ break;
case mpich1:
- xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "mpich1");
- break;
+ xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "mpich1");
+ break;
case mpich2:
- xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "mpich2");
- break;
+ xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "mpich2");
+ break;
case openmpi:
- xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "openmpi");
- break;
+ xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "openmpi");
+ break;
case slurm:
- xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "slurm");
- break;
+ xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "slurm");
+ break;
case prun:
- xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "prun");
- break;
+ xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "prun");
+ break;
default:
- xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "");
+ xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "");
}
xmlNewProp(node, BAD_CAST test_user_name, BAD_CAST (*iter).second.UserName.c_str());
if (_nbOfProcWanted != NULL_VALUE)
{
- unsigned int nb_proc = _nbOfNodes * _nbOfProcPerNode;
+ unsigned int nb_proc = _nbOfNodes * _nbOfProcPerNode;
if (nb_proc == _nbOfProcWanted)
ret += 30000;
else if (nb_proc > _nbOfProcWanted)
SALOME_ResourcesManager::
SALOME_ResourcesManager(CORBA::ORB_ptr orb,
- PortableServer::POA_var poa,
- SALOME_NamingService *ns,
+ PortableServer::POA_var poa,
+ SALOME_NamingService *ns,
const char *xmlFilePath) : _rm(xmlFilePath)
{
MESSAGE("SALOME_ResourcesManager constructor");
//=============================================================================
SALOME_ResourcesManager::SALOME_ResourcesManager(CORBA::ORB_ptr orb,
- PortableServer::POA_var poa,
- SALOME_NamingService *ns) : _rm()
+ PortableServer::POA_var poa,
+ SALOME_NamingService *ns) : _rm()
{
MESSAGE("SALOME_ResourcesManager constructor");
_NS = ns;
std::string
SALOME_ResourcesManager::getMachineFile(std::string hostname,
- CORBA::Long nb_procs,
- std::string parallelLib)
+ CORBA::Long nb_procs,
+ std::string parallelLib)
{
std::string machine_file_name("");
// Check if resource is cluster or not
if (resource.ClusterMembersList.empty())
{
- //It is not a cluster so we create a cluster with one machine
- ParserResourcesClusterMembersType fake_node;
- fake_node.HostName = resource.HostName;
- fake_node.Protocol = resource.Protocol;
- fake_node.ClusterInternalProtocol = resource.ClusterInternalProtocol;
- fake_node.UserName = resource.UserName;
- fake_node.AppliPath = resource.AppliPath;
- fake_node.DataForSort = resource.DataForSort;
-
- resource.ClusterMembersList.push_front(fake_node);
+ //It is not a cluster so we create a cluster with one machine
+ ParserResourcesClusterMembersType fake_node;
+ fake_node.HostName = resource.HostName;
+ fake_node.Protocol = resource.Protocol;
+ fake_node.ClusterInternalProtocol = resource.ClusterInternalProtocol;
+ fake_node.UserName = resource.UserName;
+ fake_node.AppliPath = resource.AppliPath;
+ fake_node.DataForSort = resource.DataForSort;
+
+ resource.ClusterMembersList.push_front(fake_node);
}
// Creating list of machines for creating the machine file
std::list<std::string> list_of_machines;
std::list<ParserResourcesClusterMembersType>::iterator cluster_it =
- resource.ClusterMembersList.begin();
+ resource.ClusterMembersList.begin();
while (cluster_it != resource.ClusterMembersList.end())
{
- // For each member of the cluster we add a nbOfNodes * nbOfProcPerNode in the list
- unsigned int number_of_proc = (*cluster_it).DataForSort._nbOfNodes *
- (*cluster_it).DataForSort._nbOfProcPerNode;
- for (unsigned int i = 0; i < number_of_proc; i++)
- list_of_machines.push_back((*cluster_it).HostName);
- cluster_it++;
+ // For each member of the cluster we add a nbOfNodes * nbOfProcPerNode in the list
+ unsigned int number_of_proc = (*cluster_it).DataForSort._nbOfNodes *
+ (*cluster_it).DataForSort._nbOfProcPerNode;
+ for (unsigned int i = 0; i < number_of_proc; i++)
+ list_of_machines.push_back((*cluster_it).HostName);
+ cluster_it++;
}
// Creating machine file
std::list<std::string>::iterator it = list_of_machines.begin();
while (machine_number != nb_procs)
{
- // Adding a new node to the machine file
- machine_file << *it << endl;
-
- // counting...
- it++;
- if (it == list_of_machines.end())
- it = list_of_machines.begin();
- machine_number++;
+ // Adding a new node to the machine file
+ machine_file << *it << endl;
+
+ // counting...
+ it++;
+ if (it == list_of_machines.end())
+ it = list_of_machines.begin();
+ machine_number++;
}
}
else
// Check if resource is cluster or not
if (resource.ClusterMembersList.empty())
{
- //It is not a cluster so we create a cluster with one machine
- ParserResourcesClusterMembersType fake_node;
- fake_node.HostName = resource.HostName;
- fake_node.Protocol = resource.Protocol;
- fake_node.ClusterInternalProtocol = resource.ClusterInternalProtocol;
- fake_node.UserName = resource.UserName;
- fake_node.AppliPath = resource.AppliPath;
- fake_node.DataForSort = resource.DataForSort;
-
- resource.ClusterMembersList.push_front(fake_node);
+ //It is not a cluster so we create a cluster with one machine
+ ParserResourcesClusterMembersType fake_node;
+ fake_node.HostName = resource.HostName;
+ fake_node.Protocol = resource.Protocol;
+ fake_node.ClusterInternalProtocol = resource.ClusterInternalProtocol;
+ fake_node.UserName = resource.UserName;
+ fake_node.AppliPath = resource.AppliPath;
+ fake_node.DataForSort = resource.DataForSort;
+
+ resource.ClusterMembersList.push_front(fake_node);
}
// Choose mpi implementation -> each MPI implementation has is own machinefile...
if (resource.mpi == lam)
{
- // Creating machine file
- machine_file_name = tmpnam(NULL);
- std::ofstream machine_file(machine_file_name.c_str(), ios_base::out);
-
- // We add all cluster machines to the file
- std::list<ParserResourcesClusterMembersType>::iterator cluster_it =
- resource.ClusterMembersList.begin();
- while (cluster_it != resource.ClusterMembersList.end())
- {
- unsigned int number_of_proc = (*cluster_it).DataForSort._nbOfNodes *
- (*cluster_it).DataForSort._nbOfProcPerNode;
- machine_file << (*cluster_it).HostName << " cpu=" << number_of_proc << endl;
- cluster_it++;
- }
+ // Creating machine file
+ machine_file_name = tmpnam(NULL);
+ std::ofstream machine_file(machine_file_name.c_str(), ios_base::out);
+
+ // We add all cluster machines to the file
+ std::list<ParserResourcesClusterMembersType>::iterator cluster_it =
+ resource.ClusterMembersList.begin();
+ while (cluster_it != resource.ClusterMembersList.end())
+ {
+ unsigned int number_of_proc = (*cluster_it).DataForSort._nbOfNodes *
+ (*cluster_it).DataForSort._nbOfProcPerNode;
+ machine_file << (*cluster_it).HostName << " cpu=" << number_of_proc << endl;
+ cluster_it++;
+ }
}
else if (resource.mpi == nompi)
{
- INFOS("[getMachineFile] Error hostname MPI implementation was defined for " << hostname);
+ INFOS("[getMachineFile] Error hostname MPI implementation was defined for " << hostname);
}
else
- INFOS("[getMachineFile] Error hostname MPI implementation not currenly handled for " << hostname);
+ INFOS("[getMachineFile] Error hostname MPI implementation not currenly handled for " << hostname);
}
else
INFOS("[getMachineFile] Error hostname not found in resourcesList -> " << hostname);
void Shutdown();
ResourcesManager_cpp *GetImpl() { return &_rm; }
std::string getMachineFile(std::string hostname,
- CORBA::Long nb_procs,
- std::string parallelLib);
+ CORBA::Long nb_procs,
+ std::string parallelLib);
static const char *_ResourcesManagerNameInNS;
#include "SALOMEDS_BasicAttribute_i.hxx"
class SALOMEDS_AttLong_i: public POA_SALOMEDS::AttLong,
- public SALOMEDS_BasicAttribute_i {
+ public SALOMEDS_BasicAttribute_i {
protected:
char * _type;
#include "SALOMEDS_BasicAttribute_i.hxx"
class SALOMEDS_AttReal_i: public POA_SALOMEDS::AttReal,
- public SALOMEDS_BasicAttribute_i {
+ public SALOMEDS_BasicAttribute_i {
protected:
char * _type;
#include "SALOMEDSImpl_AttributeComment.hxx"
class SALOMEDS_AttributeComment_i: public virtual POA_SALOMEDS::AttributeComment,
- public virtual SALOMEDS_GenericAttribute_i
+ public virtual SALOMEDS_GenericAttribute_i
{
public:
SALOMEDS_AttributeComment_i(SALOMEDSImpl_AttributeComment* theAttr, CORBA::ORB_ptr orb)
#include "SALOMEDSImpl_AttributeExternalFileDef.hxx"
class SALOMEDS_AttributeExternalFileDef_i: public virtual POA_SALOMEDS::AttributeExternalFileDef,
- public virtual SALOMEDS_GenericAttribute_i
+ public virtual SALOMEDS_GenericAttribute_i
{
public:
#include "SALOMEDSImpl_AttributeFileType.hxx"
class SALOMEDS_AttributeFileType_i: public virtual POA_SALOMEDS::AttributeFileType,
- public virtual SALOMEDS_GenericAttribute_i {
+ public virtual SALOMEDS_GenericAttribute_i {
public:
SALOMEDS_AttributeFileType_i(SALOMEDSImpl_AttributeFileType* theAttr, CORBA::ORB_ptr orb)
public:
SALOMEDS_AttributeFlags_i( SALOMEDSImpl_AttributeFlags* theAttr, CORBA::ORB_ptr orb )
- :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
+ :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
virtual ~SALOMEDS_AttributeFlags_i() {};
#include "SALOMEDSImpl_AttributeIOR.hxx"
class SALOMEDS_AttributeIOR_i: public virtual POA_SALOMEDS::AttributeIOR,
- public virtual SALOMEDS_GenericAttribute_i {
+ public virtual SALOMEDS_GenericAttribute_i {
public:
SALOMEDS_AttributeIOR_i(SALOMEDSImpl_AttributeIOR* theAttr, CORBA::ORB_ptr orb)
#include "SALOMEDSImpl_AttributeInteger.hxx"
class SALOMEDS_AttributeInteger_i: public virtual POA_SALOMEDS::AttributeInteger,
- public virtual SALOMEDS_GenericAttribute_i {
+ public virtual SALOMEDS_GenericAttribute_i {
public:
SALOMEDS_AttributeInteger_i(SALOMEDSImpl_AttributeInteger* theAttr, CORBA::ORB_ptr orb)
#include "SALOMEDSImpl_AttributeName.hxx"
class SALOMEDS_AttributeName_i: public virtual POA_SALOMEDS::AttributeName,
- public virtual SALOMEDS_GenericAttribute_i
+ public virtual SALOMEDS_GenericAttribute_i
{
public:
*/
class SALOMEDS_AttributeParameter_i: public virtual POA_SALOMEDS::AttributeParameter,
- public virtual SALOMEDS_GenericAttribute_i
+ public virtual SALOMEDS_GenericAttribute_i
{
public:
#include "SALOMEDSImpl_AttributePersistentRef.hxx"
class SALOMEDS_AttributePersistentRef_i: public virtual POA_SALOMEDS::AttributePersistentRef,
- public virtual SALOMEDS_GenericAttribute_i {
+ public virtual SALOMEDS_GenericAttribute_i {
public:
SALOMEDS_AttributePersistentRef_i(SALOMEDSImpl_AttributePersistentRef* theAttr, CORBA::ORB_ptr orb)
#include "SALOMEDSImpl_AttributePixMap.hxx"
class SALOMEDS_AttributePixMap_i: public virtual POA_SALOMEDS::AttributePixMap,
- public virtual SALOMEDS_GenericAttribute_i
+ public virtual SALOMEDS_GenericAttribute_i
{
public:
#include "SALOMEDSImpl_AttributeReal.hxx"
class SALOMEDS_AttributeReal_i: public virtual POA_SALOMEDS::AttributeReal,
- public virtual SALOMEDS_GenericAttribute_i {
+ public virtual SALOMEDS_GenericAttribute_i {
public:
SALOMEDS_AttributeReal_i(SALOMEDSImpl_AttributeReal* theAttr, CORBA::ORB_ptr orb)
#include "SALOMEDSImpl_AttributeSequenceOfReal.hxx"
class SALOMEDS_AttributeSequenceOfReal_i: public virtual POA_SALOMEDS::AttributeSequenceOfReal,
- public virtual SALOMEDS_GenericAttribute_i {
+ public virtual SALOMEDS_GenericAttribute_i {
public:
SALOMEDS_AttributeSequenceOfReal_i(SALOMEDSImpl_AttributeSequenceOfReal* theAttr, CORBA::ORB_ptr orb)
#include "SALOMEDSImpl_AttributeString.hxx"
class SALOMEDS_AttributeString_i: public virtual POA_SALOMEDS::AttributeString,
- public virtual SALOMEDS_GenericAttribute_i
+ public virtual SALOMEDS_GenericAttribute_i
{
public:
SALOMEDS_AttributeString_i(SALOMEDSImpl_AttributeString* theAttr, CORBA::ORB_ptr orb)
anImpl->SetModification(S, theMinute, theHour, theDay, theMonth, theYear);
} else {
((SALOMEDS::AttributeStudyProperties_var)SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl))->SetCreationDate(theMinute,
- theHour,
- theDay,
- theMonth,
- theYear);
+ theHour,
+ theDay,
+ theMonth,
+ theYear);
}
}
bool SALOMEDS_AttributeStudyProperties::GetCreationDate(int& theMinute,
- int& theHour,
- int& theDay,
- int& theMonth,
- int& theYear)
+ int& theHour,
+ int& theDay,
+ int& theMonth,
+ int& theYear)
{
bool ret;
if (_isLocal) {
} else {
CORBA::Long aMinute, anHour, aDay, aMonth, anYear;
ret = ((SALOMEDS::AttributeStudyProperties_var)SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl))->GetCreationDate(aMinute,
- anHour,
- aDay,
- aMonth,
- anYear);
+ anHour,
+ aDay,
+ aMonth,
+ anYear);
theMinute = (int)aMinute;
theHour = (int)anHour;
theDay = (int)aDay;
}
void SALOMEDS_AttributeStudyProperties::SetModification(const std::string& theName,
- int theMinute,
- int theHour,
- int theDay,
- int theMonth,
- int theYear)
+ int theMinute,
+ int theHour,
+ int theDay,
+ int theMonth,
+ int theYear)
{
if (_isLocal) {
CheckLocked();
}
void SALOMEDS_AttributeStudyProperties::GetModificationsList(std::vector<std::string>& theNames,
- std::vector<int>& theMinutes,
- std::vector<int>& theHours,
- std::vector<int>& theDays,
- std::vector<int>& theMonths,
- std::vector<int>& theYears,
- bool theWithCreator)
+ std::vector<int>& theMinutes,
+ std::vector<int>& theHours,
+ std::vector<int>& theDays,
+ std::vector<int>& theMonths,
+ std::vector<int>& theYears,
+ bool theWithCreator)
{
int i, aLength;
SALOMEDS::StringSeq_var aNames;
SALOMEDS::LongSeq_var aMinutes, aHours, aDays, aMonths, aYears;
((SALOMEDS::AttributeStudyProperties_var)SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl))->GetModificationsList(aNames.out(),
- aMinutes.out(),
- aHours.out(),
- aDays.out(),
- aMonths.out(),
- aYears.out(),
- theWithCreator);
+ aMinutes.out(),
+ aHours.out(),
+ aDays.out(),
+ aMonths.out(),
+ aYears.out(),
+ theWithCreator);
aLength = aNames->length();
for (i = 0; i<aLength; i++) {
theNames.push_back(aNames[i].in());
virtual void SetLocked(bool theLocked);
virtual bool IsLocked();
virtual void SetModification(const std::string& theName,
- int theMinute,
- int theHour,
- int theDay,
- int theMonth,
- int theYear);
+ int theMinute,
+ int theHour,
+ int theDay,
+ int theMonth,
+ int theYear);
virtual void GetModificationsList(std::vector<std::string>& theNames,
- std::vector<int>& theMinutes,
- std::vector<int>& theHours,
- std::vector<int>& theDays,
- std::vector<int>& theMonths,
- std::vector<int>& theYears,
- bool theWithCreator);
+ std::vector<int>& theMinutes,
+ std::vector<int>& theHours,
+ std::vector<int>& theDays,
+ std::vector<int>& theMonths,
+ std::vector<int>& theYears,
+ bool theWithCreator);
};
}
void SALOMEDS_AttributeStudyProperties_i::SetCreationDate(CORBA::Long theMinute,
- CORBA::Long theHour,
- CORBA::Long theDay,
- CORBA::Long theMonth,
- CORBA::Long theYear)
+ CORBA::Long theHour,
+ CORBA::Long theDay,
+ CORBA::Long theMonth,
+ CORBA::Long theYear)
{
SALOMEDS::Locker lock;
CheckLocked();
}
CORBA::Boolean SALOMEDS_AttributeStudyProperties_i::GetCreationDate(CORBA::Long& theMinute,
- CORBA::Long& theHour,
- CORBA::Long& theDay,
- CORBA::Long& theMonth,
- CORBA::Long& theYear)
+ CORBA::Long& theHour,
+ CORBA::Long& theDay,
+ CORBA::Long& theMonth,
+ CORBA::Long& theYear)
{
SALOMEDS::Locker lock;
int aMinute;
}
void SALOMEDS_AttributeStudyProperties_i::SetModification(const char* theName,
- CORBA::Long theMinute,
- CORBA::Long theHour,
- CORBA::Long theDay,
- CORBA::Long theMonth,
- CORBA::Long theYear)
+ CORBA::Long theMinute,
+ CORBA::Long theHour,
+ CORBA::Long theDay,
+ CORBA::Long theMonth,
+ CORBA::Long theYear)
{
SALOMEDS::Locker lock;
CheckLocked();
}
void SALOMEDS_AttributeStudyProperties_i::GetModificationsList(SALOMEDS::StringSeq_out theNames,
- SALOMEDS::LongSeq_out theMinutes,
- SALOMEDS::LongSeq_out theHours,
- SALOMEDS::LongSeq_out theDays,
- SALOMEDS::LongSeq_out theMonths,
- SALOMEDS::LongSeq_out theYears,
- CORBA::Boolean theWithCreator)
+ SALOMEDS::LongSeq_out theMinutes,
+ SALOMEDS::LongSeq_out theHours,
+ SALOMEDS::LongSeq_out theDays,
+ SALOMEDS::LongSeq_out theMonths,
+ SALOMEDS::LongSeq_out theYears,
+ CORBA::Boolean theWithCreator)
{
SALOMEDS::Locker lock;
vector<string> aNames;
virtual void SetLocked(CORBA::Boolean theLocked);
virtual CORBA::Boolean IsLocked();
virtual void SetModification(const char* theName,
- CORBA::Long theMinute,
- CORBA::Long theHour,
- CORBA::Long theDay,
- CORBA::Long theMonth,
- CORBA::Long theYear);
+ CORBA::Long theMinute,
+ CORBA::Long theHour,
+ CORBA::Long theDay,
+ CORBA::Long theMonth,
+ CORBA::Long theYear);
virtual void GetModificationsList(SALOMEDS::StringSeq_out theNames,
- SALOMEDS::LongSeq_out theMinutes,
- SALOMEDS::LongSeq_out theHours,
- SALOMEDS::LongSeq_out theDays,
- SALOMEDS::LongSeq_out theMonths,
- SALOMEDS::LongSeq_out theYears,
- CORBA::Boolean theWithCreator);
+ SALOMEDS::LongSeq_out theMinutes,
+ SALOMEDS::LongSeq_out theHours,
+ SALOMEDS::LongSeq_out theDays,
+ SALOMEDS::LongSeq_out theMonths,
+ SALOMEDS::LongSeq_out theYears,
+ CORBA::Boolean theWithCreator);
};
vector<double> aSeq = dynamic_cast<SALOMEDSImpl_AttributeTextColor*>(_local_impl)->TextColor();
aColor.R = aSeq[0];
aColor.G = aSeq[1];
- aColor.B = aSeq[2];
+ aColor.B = aSeq[2];
}
else {
SALOMEDS::Color anImplColor = SALOMEDS::AttributeTextColor::_narrow(_corba_impl)->TextColor();
#include "SALOMEDSImpl_AttributeTextColor.hxx"
class SALOMEDS_AttributeTextColor_i: public virtual POA_SALOMEDS::AttributeTextColor,
- public virtual SALOMEDS_GenericAttribute_i
+ public virtual SALOMEDS_GenericAttribute_i
{
public:
vector<double> aSeq = dynamic_cast<SALOMEDSImpl_AttributeTextHighlightColor*>(_local_impl)->TextHighlightColor();
aColor.R = aSeq[0];
aColor.G = aSeq[1];
- aColor.B = aSeq[2];
+ aColor.B = aSeq[2];
}
else {
SALOMEDS::Color anImplColor =
#include "SALOMEDSImpl_AttributeTextHighlightColor.hxx"
class SALOMEDS_AttributeTextHighlightColor_i: public virtual POA_SALOMEDS::AttributeTextHighlightColor,
- public virtual SALOMEDS_GenericAttribute_i
+ public virtual SALOMEDS_GenericAttribute_i
{
public:
using namespace std;
static SALOMEDSImpl_AttributeTreeNode* GetNode(SALOMEDS::AttributeTreeNode_ptr value,
- SALOMEDSImpl_AttributeTreeNode* aNode)
+ SALOMEDSImpl_AttributeTreeNode* aNode)
{
SALOMEDSImpl_AttributeTreeNode* aResult = NULL;
DF_Label aLabel = DF_Label::Label(aNode->Label(), value->Label());
try {
if (!strcmp(type,"AttReal"))
{
- SALOMEDS_AttReal_i *A = new SALOMEDS_AttReal_i();
- return A;
+ SALOMEDS_AttReal_i *A = new SALOMEDS_AttReal_i();
+ return A;
}
else if(!strcmp(type,"AttLong"))
{
- SALOMEDS_AttLong_i *A = new SALOMEDS_AttLong_i();
- return A;
+ SALOMEDS_AttLong_i *A = new SALOMEDS_AttLong_i();
+ return A;
}
else throw(SALOME_Exception(LOCALIZED("bad attribute type name")));
} catch (...) {throw(SALOME_Exception(LOCALIZED("Unexpected exception was caught")));}
#include <DF_Label.hxx>
class SALOMEDS_BasicAttribute_i: public POA_SALOMEDS::BasicAttribute,
- public PortableServer::ServantBase {
+ public PortableServer::ServantBase {
protected:
DF_Label _Lab;
#include CORBA_SERVER_HEADER(SALOMEDS)
class SALOMEDS_Callback_i: public virtual POA_SALOMEDS::Callback,
- public virtual PortableServer::ServantBase
+ public virtual PortableServer::ServantBase
{
private:
SALOMEDS::UseCaseBuilder_var _builder;
*/
//============================================================================
SALOMEDS_ChildIterator_i::SALOMEDS_ChildIterator_i(const SALOMEDSImpl_ChildIterator& theImpl,
- CORBA::ORB_ptr orb)
+ CORBA::ORB_ptr orb)
: _it(theImpl.GetPersistentCopy())
{
SALOMEDS::Locker lock;
#include <stdio.h>
class SALOMEDS_ChildIterator_i: public virtual POA_SALOMEDS::ChildIterator,
- public virtual PortableServer::ServantBase,
- public virtual SALOME::GenericObj_i
+ public virtual PortableServer::ServantBase,
+ public virtual SALOME::GenericObj_i
{
private:
CORBA::ORB_var _orb;
SALOMEDS::AttributeName_var Name = SALOMEDS::AttributeName::_narrow(anAttr);
CORBA::String_var Val = Name->Value();
for (int i = 1; i <= offset ; i++)
- MESSAGE("--");
+ MESSAGE("--");
MESSAGE(">"<<CSO->GetID()<<Val);
}
if (CSO->ReferencedObject(RefSO)) {
for (int i = 1; i <= offset ; i++)
- MESSAGE(" ");
+ MESSAGE(" ");
MESSAGE("*Reference"<<RefSO->GetID());
}
DumpComponent(Study,CSO,offset+2);
}
SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::Save(const SALOMEDSImpl_SComponent& theComponent,
- const string& theURL,
- long& theStreamLength,
- bool isMultiFile)
+ const string& theURL,
+ long& theStreamLength,
+ bool isMultiFile)
{
SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (theComponent, _orb);
CORBA::String_var url = CORBA::string_dup(theURL.c_str());
}
SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::SaveASCII(const SALOMEDSImpl_SComponent& theComponent,
- const string& theURL,
- long& theStreamLength,
- bool isMultiFile)
+ const string& theURL,
+ long& theStreamLength,
+ bool isMultiFile)
{
SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (theComponent, _orb);
CORBA::String_var url = CORBA::string_dup(theURL.c_str());
}
bool SALOMEDS_Driver_i::Load(const SALOMEDSImpl_SComponent& theComponent,
- const unsigned char* theStream,
- const long theStreamLength,
- const string& theURL,
- bool isMultiFile)
+ const unsigned char* theStream,
+ const long theStreamLength,
+ const string& theURL,
+ bool isMultiFile)
{
SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (theComponent, _orb);
CORBA::String_var url = CORBA::string_dup(theURL.c_str());
}
bool SALOMEDS_Driver_i::LoadASCII(const SALOMEDSImpl_SComponent& theComponent,
- const unsigned char* theStream,
- const long theStreamLength,
- const string& theURL,
- bool isMultiFile)
+ const unsigned char* theStream,
+ const long theStreamLength,
+ const string& theURL,
+ bool isMultiFile)
{
SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (theComponent, _orb);
CORBA::String_var url = CORBA::string_dup(theURL.c_str());
string SALOMEDS_Driver_i::IORToLocalPersistentID(const SALOMEDSImpl_SObject& theSObject,
- const string& IORString,
- bool isMultiFile,
- bool isASCII)
+ const string& IORString,
+ bool isMultiFile,
+ bool isASCII)
{
SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (theSObject, _orb);
CORBA::String_var ior = CORBA::string_dup(IORString.c_str());
string SALOMEDS_Driver_i::LocalPersistentIDToIOR(const SALOMEDSImpl_SObject& theObject,
- const string& aLocalPersistentID,
- bool isMultiFile,
- bool isASCII)
+ const string& aLocalPersistentID,
+ bool isMultiFile,
+ bool isASCII)
{
SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (theObject, _orb);
CORBA::String_var pers_string = CORBA::string_dup(aLocalPersistentID.c_str());
SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::CopyFrom(const SALOMEDSImpl_SObject& theObject,
- int& theObjectID,
- long& theStreamLength)
+ int& theObjectID,
+ long& theStreamLength)
{
SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (theObject, _orb);
}
string SALOMEDS_Driver_i::PasteInto(const unsigned char* theStream,
- const long theStreamLength,
- int theObjectID,
- const SALOMEDSImpl_SObject& theObject)
+ const long theStreamLength,
+ int theObjectID,
+ const SALOMEDSImpl_SObject& theObject)
{
SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (theObject, _orb);
CORBA::Octet* anOctetBuf = (CORBA::Octet*)theStream;
}
SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::DumpPython(SALOMEDSImpl_Study* theStudy,
- bool isPublished,
- bool& isValidScript,
- long& theStreamLength)
+ bool isPublished,
+ bool& isValidScript,
+ long& theStreamLength)
{
SALOMEDS_Study_i * st_servant = new SALOMEDS_Study_i (theStudy, _orb);
SALOMEDS::Study_var st = SALOMEDS::Study::_narrow(st_servant->_this());
}
virtual SALOMEDSImpl_TMPFile* Save(const SALOMEDSImpl_SComponent& theComponent,
- const std::string& theURL,
- long& theStreamLength,
- bool isMultiFile);
+ const std::string& theURL,
+ long& theStreamLength,
+ bool isMultiFile);
virtual SALOMEDSImpl_TMPFile* SaveASCII(const SALOMEDSImpl_SComponent& theComponent,
- const std::string& theURL,
- long& theStreamLength,
- bool isMultiFile);
+ const std::string& theURL,
+ long& theStreamLength,
+ bool isMultiFile);
virtual bool Load(const SALOMEDSImpl_SComponent& theComponent,
- const unsigned char* theStream,
- const long theStreamLength,
- const std::string& theURL,
- bool isMultiFile);
+ const unsigned char* theStream,
+ const long theStreamLength,
+ const std::string& theURL,
+ bool isMultiFile);
virtual bool LoadASCII(const SALOMEDSImpl_SComponent& theComponent,
- const unsigned char* theStream,
- const long theStreamLength,
- const std::string& theURL,
- bool isMultiFile);
+ const unsigned char* theStream,
+ const long theStreamLength,
+ const std::string& theURL,
+ bool isMultiFile);
virtual void Close(const SALOMEDSImpl_SComponent& theComponent);
virtual std::string IORToLocalPersistentID(const SALOMEDSImpl_SObject& theSObject,
- const std::string& IORString,
- bool isMultiFile,
- bool isASCII);
+ const std::string& IORString,
+ bool isMultiFile,
+ bool isASCII);
virtual std::string LocalPersistentIDToIOR(const SALOMEDSImpl_SObject& theSObject,
- const std::string& aLocalPersistentID,
- bool isMultiFile,
- bool isASCII);
+ const std::string& aLocalPersistentID,
+ bool isMultiFile,
+ bool isASCII);
virtual bool CanCopy(const SALOMEDSImpl_SObject& theObject);
virtual SALOMEDSImpl_TMPFile* CopyFrom(const SALOMEDSImpl_SObject& theObject,
- int& theObjectID,
- long& theStreamLength);
+ int& theObjectID,
+ long& theStreamLength);
virtual bool CanPaste(const std::string& theComponentName, int theObjectID);
virtual std::string PasteInto(const unsigned char* theStream,
- const long theStreamLength,
- int theObjectID,
- const SALOMEDSImpl_SObject& theObject);
+ const long theStreamLength,
+ int theObjectID,
+ const SALOMEDSImpl_SObject& theObject);
virtual SALOMEDSImpl_TMPFile* DumpPython(SALOMEDSImpl_Study* theStudy,
- bool isPublished,
- bool& isValidScript,
- long& theStreamLength);
+ bool isPublished,
+ bool& isValidScript,
+ long& theStreamLength);
};
#include "SALOME_NamingService.hxx"
#include "SALOMEDSImpl_GenericAttribute.hxx"
class Standard_EXPORT SALOMEDS_GenericAttribute_i: public virtual POA_SALOMEDS::GenericAttribute,
- public virtual PortableServer::ServantBase,
- public virtual SALOME::GenericObj_i
+ public virtual PortableServer::ServantBase,
+ public virtual SALOME::GenericObj_i
{
protected:
else {
CORBA::String_var anIOR;
ret = (SALOMEDS::SComponent::_narrow(GetCORBAImpl()))->ComponentIOR(anIOR.out());
- theID = std::string(anIOR.in());
+ theID = std::string(anIOR.in());
}
return ret;
//============================================================================
SALOMEDS_SComponentIterator_i::SALOMEDS_SComponentIterator_i(const SALOMEDSImpl_SComponentIterator& theImpl,
- CORBA::ORB_ptr orb)
+ CORBA::ORB_ptr orb)
{
_orb = CORBA::ORB::_duplicate(orb);
_impl = theImpl.GetPersistentCopy();
#include "SALOMEDSImpl_SComponentIterator.hxx"
class SALOMEDS_SComponentIterator_i:public virtual POA_SALOMEDS::SComponentIterator,
- public virtual PortableServer::ServantBase,
- public virtual SALOME::GenericObj_i
+ public virtual PortableServer::ServantBase,
+ public virtual SALOME::GenericObj_i
{
private:
#include "SALOMEDSImpl_SComponent.hxx"
class Standard_EXPORT SALOMEDS_SComponent_i: public POA_SALOMEDS::SComponent,
- public SALOMEDS_SObject_i
+ public SALOMEDS_SObject_i
{
public:
if(!impl.IsNull()) {
if(impl.IsComponent()) {
SALOMEDSImpl_SComponent sco = impl;
- _impl = sco.GetPersistentCopy();
+ _impl = sco.GetPersistentCopy();
}
else {
_impl = impl.GetPersistentCopy();
*/
//============================================================================
CORBA::Boolean SALOMEDS_SObject_i::FindAttribute (SALOMEDS::GenericAttribute_out anAttribute,
- const char* aTypeOfAttribute)
+ const char* aTypeOfAttribute)
{
SALOMEDS::Locker lock;
DF_Attribute* anAttr = NULL;
SALOMEDS::GenericAttribute_var anAttribute;
anAttribute = SALOMEDS_GenericAttribute_i::CreateAttribute(anAttr, _orb);
if (!CORBA::is_nil(anAttribute)) {
- SeqOfAttr[i] = anAttribute;
+ SeqOfAttr[i] = anAttribute;
}
}
}
#include "SALOMEDSImpl_SObject.hxx"
class Standard_EXPORT SALOMEDS_SObject_i: public virtual POA_SALOMEDS::SObject,
- public virtual PortableServer::ServantBase,
- public virtual SALOME::GenericObj_i
+ public virtual PortableServer::ServantBase,
+ public virtual SALOME::GenericObj_i
{
protected:
CORBA::ORB_var _orb;
const char * Env = getenv("USE_LOGGER");
int EnvL =0;
if ((Env!=NULL) && (strlen(Env)))
- EnvL=1;
+ EnvL=1;
CosNaming::Name name;
name.length(1);
name[0].id=CORBA::string_dup("Logger");
PortableServer::POAManager_var pman;
for (int i = 1; i<=NumberOfTries; i++)
- {
- if (i!=1)
+ {
+ if (i!=1)
#ifndef WIN32
- a=nanosleep(&ts_req,&ts_rem);
+ a=nanosleep(&ts_req,&ts_rem);
#else
- Sleep(TIMESleep/1000000);
+ Sleep(TIMESleep/1000000);
#endif
- try
- {
- obj = orb->resolve_initial_references("RootPOA");
- if(!CORBA::is_nil(obj))
- poa = PortableServer::POA::_narrow(obj);
- if(!CORBA::is_nil(poa))
- pman = poa->the_POAManager();
- if(!CORBA::is_nil(orb))
- theObj = orb->resolve_initial_references("NameService");
- if (!CORBA::is_nil(theObj)){
- inc = CosNaming::NamingContext::_narrow(theObj);
- if(!CORBA::is_nil(inc))
- {
- MESSAGE( "SalomeDS Server: Naming Service was found" );
- if(EnvL==1)
- {
- CORBA::ORB_var orb1 = CORBA::ORB_init(argc,argv) ;
- SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance() ;
- NS.init_orb( orb1 ) ;
- for(int j=1; j<=NumberOfTries; j++)
- {
- if (j!=1)
+ try
+ {
+ obj = orb->resolve_initial_references("RootPOA");
+ if(!CORBA::is_nil(obj))
+ poa = PortableServer::POA::_narrow(obj);
+ if(!CORBA::is_nil(poa))
+ pman = poa->the_POAManager();
+ if(!CORBA::is_nil(orb))
+ theObj = orb->resolve_initial_references("NameService");
+ if (!CORBA::is_nil(theObj)){
+ inc = CosNaming::NamingContext::_narrow(theObj);
+ if(!CORBA::is_nil(inc))
+ {
+ MESSAGE( "SalomeDS Server: Naming Service was found" );
+ if(EnvL==1)
+ {
+ CORBA::ORB_var orb1 = CORBA::ORB_init(argc,argv) ;
+ SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance() ;
+ NS.init_orb( orb1 ) ;
+ for(int j=1; j<=NumberOfTries; j++)
+ {
+ if (j!=1)
#ifndef WIN32
- a=nanosleep(&ts_req, &ts_rem);
+ a=nanosleep(&ts_req, &ts_rem);
#else
- Sleep(TIMESleep/1000000);
+ Sleep(TIMESleep/1000000);
#endif
- try
- {
- object = inc->resolve(name);
- }
- catch(CosNaming::NamingContext::NotFound)
- {
- MESSAGE( "SalomeDS Server: Logger Server wasn't found" ); }
+ try
+ {
+ object = inc->resolve(name);
+ }
+ catch(CosNaming::NamingContext::NotFound)
+ {
+ MESSAGE( "SalomeDS Server: Logger Server wasn't found" ); }
- catch(...)
- {
- MESSAGE( "SalomeDS Server: Unknown exception" );
- }
- if (!CORBA::is_nil(object))
- {
- MESSAGE( "SalomeDS Server: Logger Server was found" );
- SALOMEDS=1;
- break;
- }
- }
- }
- }
- }
-
- }
- catch( const SALOME_Exception &ex )
- {
- MESSAGE( "Communication Error : " << ex.what() );
- return EXIT_FAILURE ;
- }
- if ((SALOMEDS==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
- break;
- }
+ catch(...)
+ {
+ MESSAGE( "SalomeDS Server: Unknown exception" );
+ }
+ if (!CORBA::is_nil(object))
+ {
+ MESSAGE( "SalomeDS Server: Logger Server was found" );
+ SALOMEDS=1;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ }
+ catch( const SALOME_Exception &ex )
+ {
+ MESSAGE( "Communication Error : " << ex.what() );
+ return EXIT_FAILURE ;
+ }
+ if ((SALOMEDS==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
+ break;
+ }
// We allocate the objects on the heap. Since these are reference
// counted objects, they will be deleted by the POA when they are no
SALOMEDSImpl_SObject aSO_impl = _local_impl->FindObject(anObjectName);
if (!aSO_impl) return _PTR(SObject)(aSO);
if(aSO_impl.IsComponent()) {
- SALOMEDSImpl_SComponent aSCO_impl = aSO_impl;
+ SALOMEDSImpl_SComponent aSCO_impl = aSO_impl;
return _PTR(SObject)(new SALOMEDS_SComponent(aSCO_impl));
- }
+ }
aSO = new SALOMEDS_SObject(aSO_impl);
}
else {
}
else {
SALOMEDS::Study::ListOfSObject_var aSeq = _corba_impl->FindObjectByName((char*)anObjectName.c_str(),
- (char*)aComponentName.c_str());
+ (char*)aComponentName.c_str());
aLength = aSeq->length();
for (i = 0; i< aLength; i++) aVector.push_back(_PTR(SObject)(new SALOMEDS_SObject(aSeq[i])));
}
if (_isLocal) {
SALOMEDS::Locker lock;
_local_impl->SetStringVariable(theVarName,
- theValue,
- SALOMEDSImpl_GenericVariable::STRING_VAR);
+ theValue,
+ SALOMEDSImpl_GenericVariable::STRING_VAR);
}
else
_corba_impl->SetString((char*)theVarName.c_str(),(char*)theValue.c_str());
if (_isLocal) {
SALOMEDS::Locker lock;
_local_impl->SetStringVariableAsDouble(theVarName,
- theValue,
- SALOMEDSImpl_GenericVariable::STRING_VAR);
+ theValue,
+ SALOMEDSImpl_GenericVariable::STRING_VAR);
}
else
_corba_impl->SetStringAsDouble((char*)theVarName.c_str(),theValue);
if (_isLocal) {
SALOMEDS::Locker lock;
aResult = _local_impl->IsTypeOf(theVarName,
- SALOMEDSImpl_GenericVariable::STRING_VAR);
+ SALOMEDSImpl_GenericVariable::STRING_VAR);
}
else
aResult = _corba_impl->IsString((char*)theVarName.c_str());
vector<string> aVector;
SALOMEDS::ListOfStrings aSection = aSeq[i];
for (int j = 0, m = aSection.length(); j < m; j++) {
- aVector.push_back( string(aSection[j].in()) );
+ aVector.push_back( string(aSection[j].in()) );
}
aResult.push_back( aVector );
}
}
_PTR(AttributeParameter) SALOMEDS_Study::GetModuleParameters(const string& theID,
- const string& theModuleName, int theSavePoint)
+ const string& theModuleName, int theSavePoint)
{
SALOMEDSClient_AttributeParameter* AP = NULL;
if(theSavePoint > 0) {
virtual bool DumpStudy(const std::string& thePath,const std::string& theBaseName,bool isPublished);
virtual _PTR(AttributeParameter) GetCommonParameters(const std::string& theID, int theSavePoint);
virtual _PTR(AttributeParameter) GetModuleParameters(const std::string& theID,
- const std::string& theModuleName, int theSavePoint);
+ const std::string& theModuleName, int theSavePoint);
virtual void SetStudyLock(const std::string& theLockerID);
virtual bool IsStudyLocked();
virtual void UnLockStudy(const std::string& theLockerID);
}
void SALOMEDS_StudyBuilder::DefineComponentInstance (const _PTR(SComponent)& theSCO,
- const std::string& ComponentIOR)
+ const std::string& ComponentIOR)
{
if(!theSCO) return;
}
_PTR(GenericAttribute) SALOMEDS_StudyBuilder::FindOrCreateAttribute(const _PTR(SObject)& theSO,
- const std::string& aTypeOfAttribute)
+ const std::string& aTypeOfAttribute)
{
SALOMEDSClient_GenericAttribute* anAttr = NULL;
if(!theSO) return _PTR(GenericAttribute)(anAttr);
}
bool SALOMEDS_StudyBuilder::FindAttribute(const _PTR(SObject)& theSO,
- _PTR(GenericAttribute)& anAttribute,
- const std::string& aTypeOfAttribute)
+ _PTR(GenericAttribute)& anAttribute,
+ const std::string& aTypeOfAttribute)
{
bool ret;
virtual void RemoveObject(const _PTR(SObject)& theSO);
virtual void RemoveObjectWithChildren(const _PTR(SObject)& theSO);
virtual _PTR(GenericAttribute) FindOrCreateAttribute(const _PTR(SObject)& theSO,
- const std::string& aTypeOfAttribute);
+ const std::string& aTypeOfAttribute);
virtual bool FindAttribute(const _PTR(SObject)& theSO,
_PTR(GenericAttribute)& theAttribute,
- const std::string& aTypeOfAttribute);
+ const std::string& aTypeOfAttribute);
virtual void RemoveAttribute(const _PTR(SObject)& theSO, const std::string& aTypeOfAttribute);
virtual void Addreference(const _PTR(SObject)& me, const _PTR(SObject)& thereferencedObject);
virtual void RemoveReference(const _PTR(SObject)& me);
*/
//============================================================================
SALOMEDS_StudyBuilder_i::SALOMEDS_StudyBuilder_i(SALOMEDSImpl_StudyBuilder* theImpl,
- CORBA::ORB_ptr orb)
+ CORBA::ORB_ptr orb)
{
_orb = CORBA::ORB::_duplicate(orb);
_impl = theImpl;
*/
//============================================================================
void SALOMEDS_StudyBuilder_i::DefineComponentInstance(SALOMEDS::SComponent_ptr aComponent,
- CORBA::Object_ptr IOR)
+ CORBA::Object_ptr IOR)
{
SALOMEDS::Locker lock;
CheckLocked();
*/
//============================================================================
SALOMEDS::SObject_ptr SALOMEDS_StudyBuilder_i::NewObjectToTag(SALOMEDS::SObject_ptr theFatherObject,
- CORBA::Long atag)
+ CORBA::Long atag)
{
SALOMEDS::Locker lock;
CheckLocked();
*/
//============================================================================
void SALOMEDS_StudyBuilder_i::LoadWith(SALOMEDS::SComponent_ptr anSCO,
- SALOMEDS::Driver_ptr aDriver) throw(SALOME::SALOME_Exception)
+ SALOMEDS::Driver_ptr aDriver) throw(SALOME::SALOME_Exception)
{
SALOMEDS::Locker lock;
Unexpect aCatch(SBSalomeException);
*/
//============================================================================
SALOMEDS::GenericAttribute_ptr SALOMEDS_StudyBuilder_i::FindOrCreateAttribute(SALOMEDS::SObject_ptr anObject,
- const char* aTypeOfAttribute)
+ const char* aTypeOfAttribute)
{
SALOMEDS::Locker lock;
CORBA::String_var anID = anObject->GetID();
//============================================================================
CORBA::Boolean SALOMEDS_StudyBuilder_i::FindAttribute(SALOMEDS::SObject_ptr anObject,
- SALOMEDS::GenericAttribute_out anAttribute,
- const char* aTypeOfAttribute)
+ SALOMEDS::GenericAttribute_out anAttribute,
+ const char* aTypeOfAttribute)
{
SALOMEDS::Locker lock;
ASSERT(!CORBA::is_nil(anObject));
//============================================================================
void SALOMEDS_StudyBuilder_i::RemoveAttribute(SALOMEDS::SObject_ptr anObject,
- const char* aTypeOfAttribute)
+ const char* aTypeOfAttribute)
{
SALOMEDS::Locker lock;
CheckLocked();
*/
//============================================================================
void SALOMEDS_StudyBuilder_i::Addreference(SALOMEDS::SObject_ptr me,
- SALOMEDS::SObject_ptr theReferencedObject)
+ SALOMEDS::SObject_ptr theReferencedObject)
{
SALOMEDS::Locker lock;
CheckLocked();
//! DefineComponentInstance
/*!
\param SComponent_ptr
- \param ComponentIOR
+ \param ComponentIOR
*/
virtual void DefineComponentInstance (SALOMEDS::SComponent_ptr, CORBA::Object_ptr ComponentIOR);
/*!
<long-description>
- \param aComponent
+ \param aComponent
*/
virtual void RemoveComponent(SALOMEDS::SComponent_ptr aComponent);
else
{
for (unsigned int ind=0; ind < aLength; ind++)
- {
- _list_open_studies[ind] = CORBA::string_dup(anOpened[ind]->Name().c_str());
- SCRUTE(_list_open_studies[ind]) ;
- }
+ {
+ _list_open_studies[ind] = CORBA::string_dup(anOpened[ind]->Name().c_str());
+ SCRUTE(_list_open_studies[ind]) ;
+ }
}
return _list_open_studies._retn();
}
*/
//============================================================================
SALOMEDS_Study_i::SALOMEDS_Study_i(SALOMEDSImpl_Study* theImpl,
- CORBA::ORB_ptr orb)
+ CORBA::ORB_ptr orb)
{
_orb = CORBA::ORB::_duplicate(orb);
_impl = theImpl;
*/
//============================================================================
SALOMEDS::Study::ListOfSObject* SALOMEDS_Study_i::FindObjectByName( const char* anObjectName,
- const char* aComponentName )
+ const char* aComponentName )
{
SALOMEDS::Locker lock;
vector<SALOMEDSImpl_SObject> aSeq = _impl->FindObjectByName(string((char*)anObjectName),
- string((char*)aComponentName));
+ string((char*)aComponentName));
int aLength = aSeq.size();
SALOMEDS::Study::ListOfSObject_var listSO = new SALOMEDS::Study::ListOfSObject ;
listSO->length(aLength);
*/
//============================================================================
CORBA::Boolean SALOMEDS_Study_i::DumpStudy(const char* thePath,
- const char* theBaseName,
- CORBA::Boolean isPublished)
+ const char* theBaseName,
+ CORBA::Boolean isPublished)
{
SALOMEDS::Locker lock;
*/
//============================================================================
SALOMEDS::AttributeParameter_ptr SALOMEDS_Study_i::GetModuleParameters(const char* theID,
- const char* theModuleName,
- CORBA::Long theSavePoint)
+ const char* theModuleName,
+ CORBA::Long theSavePoint)
{
SALOMEDS::Locker lock;
void SALOMEDS_Study_i::SetString(const char* theVarName, const char* theValue)
{
_impl->SetStringVariable(string(theVarName),
- theValue,
- SALOMEDSImpl_GenericVariable::STRING_VAR);
+ theValue,
+ SALOMEDSImpl_GenericVariable::STRING_VAR);
}
//============================================================================
void SALOMEDS_Study_i::SetStringAsDouble(const char* theVarName, CORBA::Double theValue)
{
_impl->SetStringVariableAsDouble(string(theVarName),
- theValue,
- SALOMEDSImpl_GenericVariable::STRING_VAR);
+ theValue,
+ SALOMEDSImpl_GenericVariable::STRING_VAR);
}
//============================================================================
virtual SALOMEDS::AttributeParameter_ptr GetCommonParameters(const char* theID, CORBA::Long theSavePoint);
virtual SALOMEDS::AttributeParameter_ptr GetModuleParameters(const char* theID,
- const char* theModuleName,
- CORBA::Long theSavePoint);
+ const char* theModuleName,
+ CORBA::Long theSavePoint);
virtual void SetStudyLock(const char* theLockerID);
*/
//============================================================================
SALOMEDS_UseCaseBuilder_i::SALOMEDS_UseCaseBuilder_i(SALOMEDSImpl_UseCaseBuilder* theImpl,
- CORBA::ORB_ptr orb)
+ CORBA::ORB_ptr orb)
{
_orb = CORBA::ORB::_duplicate(orb);
_impl = theImpl;
*/
//============================================================================
CORBA::Boolean SALOMEDS_UseCaseBuilder_i::AppendTo(SALOMEDS::SObject_ptr theFather,
- SALOMEDS::SObject_ptr theObject)
+ SALOMEDS::SObject_ptr theObject)
{
SALOMEDS::Locker lock;
if(!_impl || theFather->_is_nil() || theObject->_is_nil()) return 0;
*/
//============================================================================
CORBA::Boolean SALOMEDS_UseCaseBuilder_i::InsertBefore(SALOMEDS::SObject_ptr theFirst,
- SALOMEDS::SObject_ptr theNext)
+ SALOMEDS::SObject_ptr theNext)
{
SALOMEDS::Locker lock;
if(!_impl || theFirst->_is_nil() || theNext->_is_nil()) return 0;
#include "SALOMEDSImpl_UseCaseBuilder.hxx"
class SALOMEDS_UseCaseBuilder_i: public virtual POA_SALOMEDS::UseCaseBuilder,
- public virtual PortableServer::ServantBase,
- public virtual SALOME::GenericObj_i
+ public virtual PortableServer::ServantBase,
+ public virtual SALOME::GenericObj_i
{
private:
//! standard constructor
SALOMEDS_UseCaseBuilder_i(SALOMEDSImpl_UseCaseBuilder* theDocument,
- CORBA::ORB_ptr);
+ CORBA::ORB_ptr);
//! standard destructor
~SALOMEDS_UseCaseBuilder_i();
*/
//============================================================================
SALOMEDS_UseCaseIterator_i::SALOMEDS_UseCaseIterator_i(const SALOMEDSImpl_UseCaseIterator& theImpl,
- CORBA::ORB_ptr orb)
+ CORBA::ORB_ptr orb)
{
_orb = CORBA::ORB::_duplicate(orb);
_impl = theImpl.GetPersistentCopy();
#include "SALOMEDSImpl_UseCaseIterator.hxx"
class SALOMEDS_UseCaseIterator_i: public virtual POA_SALOMEDS::UseCaseIterator,
- public virtual PortableServer::ServantBase,
- public virtual SALOME::GenericObj_i
+ public virtual PortableServer::ServantBase,
+ public virtual SALOME::GenericObj_i
{
private:
CORBA::ORB_var _orb;
//! standard constructor
SALOMEDS_UseCaseIterator_i(const SALOMEDSImpl_UseCaseIterator& theImpl,
- CORBA::ORB_ptr);
+ CORBA::ORB_ptr);
//! standard destructor
~SALOMEDS_UseCaseIterator_i();
CORBA::Object_var poaObj = orb->resolve_initial_references("RootPOA");
if(!CORBA::is_nil(poaObj)) {
- PortableServer::POA_var poa = PortableServer::POA::_narrow(poaObj);
+ PortableServer::POA_var poa = PortableServer::POA::_narrow(poaObj);
SALOMEDS_StudyManager_i * aStudyManager_i = new SALOMEDS_StudyManager_i(orb, poa);
// Activate the objects. This tells the POA that the objects are ready to accept requests.
virtual void SetLocked(bool theLocked) = 0;
virtual bool IsLocked() = 0;
virtual void SetModification(const std::string& theName,
- int theMinute,
- int theHour,
- int theDay,
- int theMonth,
- int theYear) = 0;
+ int theMinute,
+ int theHour,
+ int theDay,
+ int theMonth,
+ int theYear) = 0;
virtual void GetModificationsList(std::vector<std::string>& theNames,
- std::vector<int>& theMinutes,
- std::vector<int>& theHours,
- std::vector<int>& theDays,
- std::vector<int>& theMonths,
- std::vector<int>& theYears,
- bool theWithCreator) = 0;
+ std::vector<int>& theMinutes,
+ std::vector<int>& theHours,
+ std::vector<int>& theDays,
+ std::vector<int>& theMonths,
+ std::vector<int>& theYears,
+ bool theWithCreator) = 0;
};
virtual void Close() = 0;
virtual void EnableUseCaseAutoFilling(bool isEnabled) = 0;
virtual bool DumpStudy(const std::string& thePath,
- const std::string& theBaseName,
- bool isPublished) = 0;
+ const std::string& theBaseName,
+ bool isPublished) = 0;
virtual _PTR(AttributeParameter) GetCommonParameters(const std::string& theID, int theSavePoint) = 0;
virtual _PTR(AttributeParameter) GetModuleParameters(const std::string& theID,
- const std::string& theModuleName, int theSavePoint) = 0;
+ const std::string& theModuleName, int theSavePoint) = 0;
virtual void SetStudyLock(const std::string& theLockerID) = 0;
virtual bool IsStudyLocked() = 0;
virtual void UnLockStudy(const std::string& theLockerID) = 0;
virtual bool RemoveVariable(const std::string& theVarName) = 0;
virtual bool RenameVariable(const std::string& theVarName,
- const std::string& theNewVarName) = 0;
+ const std::string& theNewVarName) = 0;
virtual bool IsVariableUsed(const std::string& theVarName) = 0;
virtual std::vector< std::vector<std::string> > ParseVariables(const std::string& theVars) = 0;
virtual _PTR(GenericAttribute) FindOrCreateAttribute(const _PTR(SObject)& theSO, const std::string& aTypeOfAttribute) = 0;
virtual bool FindAttribute(const _PTR(SObject)& theSO,
_PTR(GenericAttribute)& theAttribute,
- const std::string& aTypeOfAttribute) = 0;
+ const std::string& aTypeOfAttribute) = 0;
virtual void RemoveAttribute(const _PTR(SObject)& theSO, const std::string& aTypeOfAttribute) = 0;
virtual void Addreference(const _PTR(SObject)& me, const _PTR(SObject)& thereferencedObject) = 0;
virtual void RemoveReference(const _PTR(SObject)& me) = 0;
template<class Y>
explicit clt_shared_ptr(Y * p)
{
- boost::shared_ptr<T>::reset(p);
+ boost::shared_ptr<T>::reset(p);
}
template<class Y>
clt_shared_ptr(clt_shared_ptr<Y> const & r):
boost::shared_ptr<T>(r,boost::detail::dynamic_cast_tag())
- {}
+ {}
template<class Y>
clt_shared_ptr & operator=(clt_shared_ptr<Y> const & r)
{
- clt_shared_ptr<T>(r).swap(*this);
- return *this;
+ clt_shared_ptr<T>(r).swap(*this);
+ return *this;
}
template<class Y> clt_shared_ptr& operator()(Y * p) // Y must be complete
{
if(T* pt = dynamic_cast<T*>(p))
- boost::shared_ptr<T>::reset(pt);
+ boost::shared_ptr<T>::reset(pt);
else
- boost::throw_exception(std::bad_cast());
+ boost::throw_exception(std::bad_cast());
return *this;
}
}
SALOMEDSImpl_AttributeComment* SALOMEDSImpl_AttributeComment::Set (const DF_Label& L,
- const string& Val)
+ const string& Val)
{
SALOMEDSImpl_AttributeComment* A = NULL;
if (!(A=(SALOMEDSImpl_AttributeComment*)L.FindAttribute(SALOMEDSImpl_AttributeComment::GetID()))) {
//=======================================================================
SALOMEDSImpl_AttributeDrawable* SALOMEDSImpl_AttributeDrawable::Set (const DF_Label& L,
- const int value)
+ const int value)
{
SALOMEDSImpl_AttributeDrawable* A = NULL;
if (!(A=(SALOMEDSImpl_AttributeDrawable*)L.FindAttribute(SALOMEDSImpl_AttributeDrawable::GetID()))) {
//purpose :
//=======================================================================
SALOMEDSImpl_AttributeExpandable* SALOMEDSImpl_AttributeExpandable::Set (const DF_Label& L,
- const int value)
+ const int value)
{
SALOMEDSImpl_AttributeExpandable* A = NULL;
if (!(A=(SALOMEDSImpl_AttributeExpandable*)L.FindAttribute(SALOMEDSImpl_AttributeExpandable::GetID()))) {
//=======================================================================
SALOMEDSImpl_AttributeFileType* SALOMEDSImpl_AttributeFileType::Set (const DF_Label& L,
- const std::string& S)
+ const std::string& S)
{
SALOMEDSImpl_AttributeFileType* A = NULL;
//purpose : Set value of the attribute
//=======================================================================
SALOMEDSImpl_AttributeFlags* SALOMEDSImpl_AttributeFlags::Set(const DF_Label& L,
- const int value )
+ const int value )
{
SALOMEDSImpl_AttributeFlags* A = NULL;
if ( !(A=(SALOMEDSImpl_AttributeFlags*)L.FindAttribute(SALOMEDSImpl_AttributeFlags::GetID())) )
//purpose : Set visibility of object in given view
//=======================================================================
void SALOMEDSImpl_AttributeGraphic::SetVisibility(const int theViewId,
- const bool theValue )
+ const bool theValue )
{
if ( myVisibility.find( theViewId ) != myVisibility.end() && myVisibility[theViewId] == theValue )
return;
//=======================================================================
SALOMEDSImpl_AttributeLocalID* SALOMEDSImpl_AttributeLocalID::Set (const DF_Label& L,
- const int value)
+ const int value)
{
SALOMEDSImpl_AttributeLocalID* A = NULL;
if (!(A=(SALOMEDSImpl_AttributeLocalID*)L.FindAttribute(SALOMEDSImpl_AttributeLocalID::GetID()))) {
}
SALOMEDSImpl_AttributeName* SALOMEDSImpl_AttributeName::Set (const DF_Label& L,
- const std::string& Val)
+ const std::string& Val)
{
SALOMEDSImpl_AttributeName* A = NULL;
if (!(A=(SALOMEDSImpl_AttributeName*)L.FindAttribute(SALOMEDSImpl_AttributeName::GetID()))) {
//=======================================================================
SALOMEDSImpl_AttributeOpened* SALOMEDSImpl_AttributeOpened::Set (const DF_Label& L,
- const int value)
+ const int value)
{
SALOMEDSImpl_AttributeOpened* A = NULL;
if (!(A=(SALOMEDSImpl_AttributeOpened*)L.FindAttribute(SALOMEDSImpl_AttributeOpened::GetID()))) {
if(_ints.size()) {
anArray.resize(_ints.size());
for(map<string,int>::const_iterator p = _ints.begin(); p != _ints.end(); p++, i++)
- anArray[i] = p->first;
+ anArray[i] = p->first;
}
break;
}
if(_reals.size()) {
anArray.resize(_reals.size());
for(map<string,double>::const_iterator p = _reals.begin(); p != _reals.end(); p++, i++)
- anArray[i] = p->first;
+ anArray[i] = p->first;
}
break;
}
if(_bools.size()) {
anArray.resize(_bools.size());
for(map<string,bool>::const_iterator p = _bools.begin(); p != _bools.end(); p++, i++)
- anArray[i] = p->first;
+ anArray[i] = p->first;
}
break;
}
if(_strings.size()) {
anArray.resize(_strings.size());
for(map<string,string>::const_iterator p = _strings.begin(); p!= _strings.end(); p++)
- anArray[i] = p->first;
+ anArray[i] = p->first;
}
break;
}
if(_realarrays.size()) {
anArray.resize(_realarrays.size());
for(map< string, vector<double> >::const_iterator p = _realarrays.begin(); p!= _realarrays.end(); p++)
- anArray[i] = p->first;
+ anArray[i] = p->first;
}
break;
}
if(_intarrays.size()) {
anArray.resize(_intarrays.size());
for(map< string, vector<int> >::const_iterator p = _intarrays.begin(); p!= _intarrays.end(); p++)
- anArray[i] = p->first;
+ anArray[i] = p->first;
}
break;
}
if(_strarrays.size()) {
anArray.resize(_strarrays.size());
for(map< string, vector<string> >::const_iterator p = _strarrays.begin(); p!= _strarrays.end(); p++)
- anArray[i] = p->first;
+ anArray[i] = p->first;
}
break;
}
void SetInt(const std::string& theID, const int& theValue);
int GetInt(const std::string& theID);
-
+
void SetReal(const std::string& theID, const double& theValue);
double GetReal(const std::string& theID);
-
+
void SetString(const std::string& theID, const std::string& theValue);
std::string GetString(const std::string& theID);
-
+
void SetBool(const std::string& theID, const bool& theValue);
bool GetBool(const std::string& theID);
-
+
void SetRealArray(const std::string& theID, const std::vector<double>& theArray);
std::vector<double> GetRealArray(const std::string& theID);
-
+
void SetIntArray(const std::string& theID, const std::vector<int>& theArray);
std::vector<int> GetIntArray(const std::string& theID);
-
+
void SetStrArray(const std::string& theID, const std::vector<std::string>& theArray);
std::vector<std::string> GetStrArray(const std::string& theID);
-
+
bool IsSet(const std::string& theID, const Parameter_Types theType);
bool RemoveID(const std::string& theID, const Parameter_Types theType);
-
+
SALOMEDSImpl_AttributeParameter* GetFather();
bool HasFather();
bool IsRoot();
-
+
std::vector<std::string> GetIDs(const Parameter_Types theType);
-
+
void Clear();
-
+
virtual std::string Save();
virtual void Load(const std::string& theValue);
-
+
const std::string& ID() const;
void Restore(DF_Attribute* with) ;
DF_Attribute* NewEmpty() const;
void Paste(DF_Attribute* into);
-
+
~SALOMEDSImpl_AttributeParameter() {}
};
//=======================================================================
SALOMEDSImpl_AttributePersistentRef* SALOMEDSImpl_AttributePersistentRef::Set (const DF_Label& L,
- const std::string& S)
+ const std::string& S)
{
SALOMEDSImpl_AttributePersistentRef* A = NULL;
if (!(A=(SALOMEDSImpl_AttributePersistentRef*)L.FindAttribute(SALOMEDSImpl_AttributePersistentRef::GetID()))) {
//=======================================================================
SALOMEDSImpl_AttributePixMap* SALOMEDSImpl_AttributePixMap::Set (const DF_Label& L,
- const std::string& S)
+ const std::string& S)
{
SALOMEDSImpl_AttributePixMap* A = NULL;
if (!(A=(SALOMEDSImpl_AttributePixMap*)L.FindAttribute(SALOMEDSImpl_AttributePixMap::GetID()))) {
}
void SALOMEDSImpl_AttributePythonObject::SetObject(const string& theSequence,
- const bool theScript)
+ const bool theScript)
{
CheckLocked();
Backup();
return aResult;
}
-
+
void SALOMEDSImpl_AttributePythonObject::Load(const string& value)
{
char* aString = (char*)value.c_str();
}
SALOMEDSImpl_AttributeReference* SALOMEDSImpl_AttributeReference::Set(const DF_Label& theLabel,
- const DF_Label& theRefLabel)
+ const DF_Label& theRefLabel)
{
SALOMEDSImpl_AttributeReference* A = NULL;
if (!(A=(SALOMEDSImpl_AttributeReference*)theLabel.FindAttribute(SALOMEDSImpl_AttributeReference::GetID()))) {
//=======================================================================
SALOMEDSImpl_AttributeSelectable* SALOMEDSImpl_AttributeSelectable::Set (const DF_Label& L,
- const int value)
+ const int value)
{
SALOMEDSImpl_AttributeSelectable* A = NULL;
if (!(A=(SALOMEDSImpl_AttributeSelectable*)L.FindAttribute(SALOMEDSImpl_AttributeSelectable::GetID()))) {
return ret;
}
-
+
void SALOMEDSImpl_AttributeSequenceOfInteger::Load(const string& value)
{
char* aCopy = (char*)value.c_str();
}
string ret(aResult);
delete aResult;
-
+
return ret;
}
-
+
void SALOMEDSImpl_AttributeSequenceOfReal::Load(const string& value)
{
-
+
char* aCopy = (char*)value.c_str();
char* adr = strtok(aCopy, " ");
char *err = NULL;
}
SALOMEDSImpl_AttributeString* SALOMEDSImpl_AttributeString::Set (const DF_Label& L,
- const std::string& Val)
+ const std::string& Val)
{
SALOMEDSImpl_AttributeString* A = NULL;
if (!(A=(SALOMEDSImpl_AttributeString*)L.FindAttribute(SALOMEDSImpl_AttributeString::GetID()))) {
int a = 2;
for (anIndex = 0; anIndex < aLength; anIndex++) {
sprintf(&(aProperty[a]),"%2d%2d%2d%2d%4d%s",
- (int)(aMinutes[anIndex]),
- (int)(aHours[anIndex]),
- (int)(aDays[anIndex]),
- (int)(aMonths[anIndex]),
- (int)(aYears[anIndex]),
- (char*)(aNames[anIndex].c_str()));
+ (int)(aMinutes[anIndex]),
+ (int)(aHours[anIndex]),
+ (int)(aDays[anIndex]),
+ (int)(aMonths[anIndex]),
+ (int)(aYears[anIndex]),
+ (char*)(aNames[anIndex].c_str()));
a = strlen(aProperty);
aProperty[a++] = 1;
}
}
void SALOMEDSImpl_AttributeTableOfInteger::SetRowData(const int theRow,
- const vector<int>& theData)
+ const vector<int>& theData)
{
CheckLocked();
if(theData.size() > myNbColumns) SetNbColumns(theData.size());
}
void SALOMEDSImpl_AttributeTableOfInteger::SetRowTitle(const int theRow,
- const std::string& theTitle)
+ const std::string& theTitle)
{
CheckLocked();
Backup();
}
void SALOMEDSImpl_AttributeTableOfInteger::SetRowUnit(const int theRow,
- const std::string& theUnit)
+ const std::string& theUnit)
{
CheckLocked();
Backup();
void SALOMEDSImpl_AttributeTableOfInteger::SetColumnData(const int theColumn,
- const vector<int>& theData)
+ const vector<int>& theData)
{
CheckLocked();
if(theColumn > myNbColumns) SetNbColumns(theColumn);
}
void SALOMEDSImpl_AttributeTableOfInteger::SetColumnTitle(const int theColumn,
- const std::string& theTitle)
+ const std::string& theTitle)
{
- CheckLocked();
+ CheckLocked();
Backup();
while(myCols.size() < theColumn) myCols.push_back(std::string(""));
myCols[theColumn-1] = theTitle;
}
void SALOMEDSImpl_AttributeTableOfInteger::PutValue(const int theValue,
- const int theRow,
- const int theColumn)
+ const int theRow,
+ const int theColumn)
{
CheckLocked();
if(theColumn > myNbColumns) SetNbColumns(theColumn);
}
bool SALOMEDSImpl_AttributeTableOfInteger::HasValue(const int theRow,
- const int theColumn)
+ const int theColumn)
{
if(theRow > myNbRows || theRow < 1) return false;
if(theColumn > myNbColumns || theColumn < 1) return false;
}
int SALOMEDSImpl_AttributeTableOfInteger::GetValue(const int theRow,
- const int theColumn)
+ const int theColumn)
{
if(theRow > myNbRows || theRow < 1) throw DFexception("Invalid cell index");
if(theColumn > myNbColumns || theColumn < 1) DFexception("Invalid cell index");
}
void SALOMEDSImpl_AttributeTableOfReal::SetRowData(const int theRow,
- const vector<double>& theData)
+ const vector<double>& theData)
{
CheckLocked();
if(theData.size() > myNbColumns) SetNbColumns(theData.size());
void SALOMEDSImpl_AttributeTableOfReal::SetRowTitle(const int theRow,
- const std::string& theTitle)
+ const std::string& theTitle)
{
CheckLocked();
Backup();
}
void SALOMEDSImpl_AttributeTableOfReal::SetRowUnit(const int theRow,
- const std::string& theUnit)
+ const std::string& theUnit)
{
CheckLocked();
Backup();
}
void SALOMEDSImpl_AttributeTableOfReal::SetColumnData(const int theColumn,
- const vector<double>& theData)
+ const vector<double>& theData)
{
CheckLocked();
if(theColumn > myNbColumns) SetNbColumns(theColumn);
}
void SALOMEDSImpl_AttributeTableOfReal::SetColumnTitle(const int theColumn,
- const std::string& theTitle)
+ const std::string& theTitle)
{
CheckLocked();
Backup();
}
void SALOMEDSImpl_AttributeTableOfReal::PutValue(const double& theValue,
- const int theRow,
- const int theColumn)
+ const int theRow,
+ const int theColumn)
{
CheckLocked();
if(theColumn > myNbColumns) SetNbColumns(theColumn);
}
bool SALOMEDSImpl_AttributeTableOfReal::HasValue(const int theRow,
- const int theColumn)
+ const int theColumn)
{
if(theRow > myNbRows || theRow < 1) return false;
if(theColumn > myNbColumns || theColumn < 1) return false;
}
double SALOMEDSImpl_AttributeTableOfReal::GetValue(const int theRow,
- const int theColumn)
+ const int theColumn)
{
if(theRow > myNbRows || theRow < 1) throw DFexception("Invalid cell index");
if(theColumn > myNbColumns || theColumn < 1) throw DFexception("Invalid cell index");
}
void SALOMEDSImpl_AttributeTableOfString::SetRowTitle(const int theRow,
- const std::string& theTitle)
+ const std::string& theTitle)
{
CheckLocked();
Backup();
}
void SALOMEDSImpl_AttributeTableOfString::SetRowUnit(const int theRow,
- const std::string& theUnit)
+ const std::string& theUnit)
{
CheckLocked();
Backup();
}
void SALOMEDSImpl_AttributeTableOfString::SetRowData(const int theRow,
- const vector<string>& theData)
+ const vector<string>& theData)
{
CheckLocked();
if(theData.size() > myNbColumns) SetNbColumns(theData.size());
}
void SALOMEDSImpl_AttributeTableOfString::SetColumnData(const int theColumn,
- const vector<string>& theData)
+ const vector<string>& theData)
{
CheckLocked();
if(theColumn > myNbColumns) SetNbColumns(theColumn);
}
void SALOMEDSImpl_AttributeTableOfString::SetColumnTitle(const int theColumn,
- const std::string& theTitle)
+ const std::string& theTitle)
{
CheckLocked();
Backup();
}
void SALOMEDSImpl_AttributeTableOfString::PutValue(const std::string& theValue,
- const int theRow,
- const int theColumn)
+ const int theRow,
+ const int theColumn)
{
CheckLocked();
if(theColumn > myNbColumns) SetNbColumns(theColumn);
}
bool SALOMEDSImpl_AttributeTableOfString::HasValue(const int theRow,
- const int theColumn)
+ const int theColumn)
{
if(theRow > myNbRows || theRow < 1) return false;
if(theColumn > myNbColumns || theColumn < 1) return false;
}
std::string SALOMEDSImpl_AttributeTableOfString::GetValue(const int theRow,
- const int theColumn)
+ const int theColumn)
{
if(theRow > myNbRows || theRow < 1) throw DFexception("Invalid cell index");
if(theColumn > myNbColumns || theColumn < 1) throw DFexception("Invalid cell index");
for(int i = 0, len = myVariables.size(); i<len; i++) {
DF_Label L = myVariables[i]->Label();
if(myVariables[i]->Label() == aRefLabel) continue;
- va.push_back(myVariables[i]);
+ va.push_back(myVariables[i]);
}
myVariables.clear();
char *Val = new char[75];
sprintf(Val, "%f %f %f", (float)myValue[0],
(float)myValue[1],
- (float)myValue[2]);
+ (float)myValue[2]);
string ret(Val);
delete Val;
return ret;
//purpose :
//=======================================================================
void SALOMEDSImpl_AttributeTextHighlightColor::SetTextHighlightColor(const double& R,
- const double& G,
- const double& B)
+ const double& G,
+ const double& B)
{
CheckLocked();
Backup();
SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
}
-
+
//=======================================================================
//function : TextHighlightColor
//purpose :
char *Val = new char[75];
sprintf(Val, "%f %f %f", (float)myValue[0],
(float)myValue[1],
- (float)myValue[2]);
+ (float)myValue[2]);
string ret(Val);
delete Val;
return ret;
#define __AttributeTypeToGUIDForSObject \
- if(theType == "AttributeReal") return SALOMEDSImpl_AttributeReal::GetID(); \
- if(theType == "AttributeInteger") return SALOMEDSImpl_AttributeInteger::GetID(); \
- if(theType == "AttributeSequenceOfReal") return SALOMEDSImpl_AttributeSequenceOfReal::GetID(); \
- if(theType == "AttributeSequenceOfInteger") return SALOMEDSImpl_AttributeSequenceOfInteger::GetID(); \
- if(theType == "AttributeName") return SALOMEDSImpl_AttributeName::GetID(); \
+ if(theType == "AttributeReal") return SALOMEDSImpl_AttributeReal::GetID(); \
+ if(theType == "AttributeInteger") return SALOMEDSImpl_AttributeInteger::GetID(); \
+ if(theType == "AttributeSequenceOfReal") return SALOMEDSImpl_AttributeSequenceOfReal::GetID(); \
+ if(theType == "AttributeSequenceOfInteger") return SALOMEDSImpl_AttributeSequenceOfInteger::GetID(); \
+ if(theType == "AttributeName") return SALOMEDSImpl_AttributeName::GetID(); \
if(theType == "AttributeComment") return SALOMEDSImpl_AttributeComment::GetID(); \
if(theType == "AttributeIOR") return SALOMEDSImpl_AttributeIOR::GetID(); \
if(theType == "AttributePersistentRef") return SALOMEDSImpl_AttributePersistentRef::GetID(); \
if(theType == "AttributeDrawable") return SALOMEDSImpl_AttributeDrawable::GetID(); \
if(theType == "AttributeSelectable") return SALOMEDSImpl_AttributeSelectable::GetID(); \
- if(theType == "AttributeExpandable") return SALOMEDSImpl_AttributeExpandable::GetID(); \
- if(theType == "AttributeOpened") return SALOMEDSImpl_AttributeOpened::GetID(); \
- if(theType == "AttributeTextColor") return SALOMEDSImpl_AttributeTextColor::GetID(); \
- if(theType == "AttributeTextHighlightColor") return SALOMEDSImpl_AttributeTextHighlightColor::GetID(); \
- if(theType == "AttributePixMap") return SALOMEDSImpl_AttributePixMap::GetID(); \
- if(theType == "AttributeLocalID") return SALOMEDSImpl_AttributeLocalID::GetID(); \
- if(theType == "AttributeTarget") return SALOMEDSImpl_AttributeTarget::GetID(); \
- if(theType == "AttributeTableOfInteger") return SALOMEDSImpl_AttributeTableOfInteger::GetID(); \
- if(theType == "AttributeTableOfReal") return SALOMEDSImpl_AttributeTableOfReal::GetID(); \
+ if(theType == "AttributeExpandable") return SALOMEDSImpl_AttributeExpandable::GetID(); \
+ if(theType == "AttributeOpened") return SALOMEDSImpl_AttributeOpened::GetID(); \
+ if(theType == "AttributeTextColor") return SALOMEDSImpl_AttributeTextColor::GetID(); \
+ if(theType == "AttributeTextHighlightColor") return SALOMEDSImpl_AttributeTextHighlightColor::GetID(); \
+ if(theType == "AttributePixMap") return SALOMEDSImpl_AttributePixMap::GetID(); \
+ if(theType == "AttributeLocalID") return SALOMEDSImpl_AttributeLocalID::GetID(); \
+ if(theType == "AttributeTarget") return SALOMEDSImpl_AttributeTarget::GetID(); \
+ if(theType == "AttributeTableOfInteger") return SALOMEDSImpl_AttributeTableOfInteger::GetID(); \
+ if(theType == "AttributeTableOfReal") return SALOMEDSImpl_AttributeTableOfReal::GetID(); \
if(theType == "AttributeTableOfString") return SALOMEDSImpl_AttributeTableOfString::GetID(); \
- if(theType == "AttributeStudyProperties") return SALOMEDSImpl_AttributeStudyProperties::GetID(); \
- if(theType == "AttributePythonObject") return SALOMEDSImpl_AttributePythonObject::GetID(); \
- if(theType == "AttributeUserID") return std::string("FFFFFFFF-D9CD-11d6-945D-1050DA506788"); \
- if(theType == "AttributeExternalFileDef") return SALOMEDSImpl_AttributeExternalFileDef::GetID(); \
- if(theType == "AttributeFileType") return SALOMEDSImpl_AttributeFileType::GetID(); \
- if(theType == "AttributeFlags") return SALOMEDSImpl_AttributeFlags::GetID(); \
+ if(theType == "AttributeStudyProperties") return SALOMEDSImpl_AttributeStudyProperties::GetID(); \
+ if(theType == "AttributePythonObject") return SALOMEDSImpl_AttributePythonObject::GetID(); \
+ if(theType == "AttributeUserID") return std::string("FFFFFFFF-D9CD-11d6-945D-1050DA506788"); \
+ if(theType == "AttributeExternalFileDef") return SALOMEDSImpl_AttributeExternalFileDef::GetID(); \
+ if(theType == "AttributeFileType") return SALOMEDSImpl_AttributeFileType::GetID(); \
+ if(theType == "AttributeFlags") return SALOMEDSImpl_AttributeFlags::GetID(); \
if(theType == "AttributeGraphic") return SALOMEDSImpl_AttributeGraphic::GetID(); \
- if(theType == "AttributeReference") return SALOMEDSImpl_AttributeReference::GetID(); \
- if(theType == "AttributeParameter") return SALOMEDSImpl_AttributeParameter::GetID(); \
+ if(theType == "AttributeReference") return SALOMEDSImpl_AttributeReference::GetID(); \
+ if(theType == "AttributeParameter") return SALOMEDSImpl_AttributeParameter::GetID(); \
if(theType == "AttributeString") return SALOMEDSImpl_AttributeString::GetID();
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: SALOMEDSImpl_ChildNodeIterator.cxx
-// Created: Wed Jan 26 16:43:08 2000
-// Author: Denis PASCAL
-// <dp@dingox.paris1.matra-dtv.fr>
+// File: SALOMEDSImpl_ChildNodeIterator.cxx
+// Created: Wed Jan 26 16:43:08 2000
+// Author: Denis PASCAL
+// <dp@dingox.paris1.matra-dtv.fr>
//
#include "SALOMEDSImpl_ChildNodeIterator.hxx"
{ \
while (myNode && (myNode->Depth() > myFirstLevel) && myNode->myNext == NULL) \
myNode = myNode->myFather; \
- if (myNode && (myNode->Depth() > myFirstLevel) && myNode->myFather != NULL) \
- myNode = myNode->myNext; \
- else \
- myNode = NULL; \
+ if (myNode && (myNode->Depth() > myFirstLevel) && myNode->myFather != NULL) \
+ myNode = myNode->myNext; \
+ else \
+ myNode = NULL; \
}
//=======================================================================
//=======================================================================
SALOMEDSImpl_ChildNodeIterator::SALOMEDSImpl_ChildNodeIterator (const SALOMEDSImpl_AttributeTreeNode* aNode,
- const bool allLevels)
+ const bool allLevels)
: myNode(aNode->myFirst),
myFirstLevel(allLevels ? aNode->Depth() : -1)
{}
//=======================================================================
void SALOMEDSImpl_ChildNodeIterator::Initialize(const SALOMEDSImpl_AttributeTreeNode* aNode,
- const bool allLevels)
+ const bool allLevels)
{
myNode = aNode->myFirst;
myFirstLevel = allLevels ? aNode->Depth() : -1;
vector<string> lst = ip.getValues(v[i]);
dump += "# fill list "+v[i]+"\n";
for(int j = 0; j < lst.size(); j++) {
- if (lst[j].find('\"') == -1)
- dump += "ipar.append(\""+v[i]+"\", \""+lst[j]+"\")\n";
- else
- dump += "ipar.append(\""+v[i]+"\", \"\"\""+lst[j]+"\"\"\")\n";
+ if (lst[j].find('\"') == -1)
+ dump += "ipar.append(\""+v[i]+"\", \""+lst[j]+"\")\n";
+ else
+ dump += "ipar.append(\""+v[i]+"\", \"\"\""+lst[j]+"\"\"\")\n";
}
}
}
}
string SALOMEDSImpl_IParameters::getDefaultScript(SALOMEDSImpl_Study* study,
- const string& moduleName,
- const string& shift,
- const string& theID)
+ const string& moduleName,
+ const string& shift,
+ const string& theID)
{
string anID;
if(theID == "") anID = getDefaultVisualComponent();
vector<string> lst = ip.getValues(v[i]);
dump += shift +"# fill list "+v[i]+"\n";
for(int j = 0; j < lst.size(); j++)
- dump += shift +"ipar.append(\""+v[i]+"\", \""+lst[j]+"\")\n";
+ dump += shift +"ipar.append(\""+v[i]+"\", \""+lst[j]+"\")\n";
}
}
if(so) so_name = so.GetName();
dump += shift + "# set up entry " + v[i] +" ("+so_name+")" + " parameters" + "\n";
for(int j = 0; j < names.size() && j < values.size(); j++)
- dump += shift + "ipar.setParameter(\"" + v[i] + "\", \"" + names[j] + "\", \"" + values[j] + "\")\n";
+ dump += shift + "ipar.setParameter(\"" + v[i] + "\", \"" + names[j] + "\", \"" + values[j] + "\")\n";
}
}
*/
//============================================================================
bool SALOMEDSImpl_SObject::FindAttribute(DF_Attribute*& theAttribute,
- const string& theTypeOfAttribute) const
+ const string& theTypeOfAttribute) const
{
if(_lab.IsNull()) return false;
std::string aGUID = GetGUID(theTypeOfAttribute);
for(int i = 0, len = va.size(); i<len; i++) {
SALOMEDSImpl_GenericAttribute* ga = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(va[i]);
if(ga && ga->Type() != string("AttributeReference"))
- va1.push_back(va[i]);
+ va1.push_back(va[i]);
}
return va1;
*/
//============================================================================
void SALOMEDSImpl_Study::SetStringVariable(const string& theVarName,
- const string& theValue,
- const SALOMEDSImpl_GenericVariable::VariableTypes theType)
+ const string& theValue,
+ const SALOMEDSImpl_GenericVariable::VariableTypes theType)
{
bool modified = false;
SALOMEDSImpl_GenericVariable* aGVar = GetVariable(theVarName);
*/
//============================================================================
void SALOMEDSImpl_Study::SetStringVariableAsDouble(const string& theVarName,
- const double theValue,
- const SALOMEDSImpl_GenericVariable::VariableTypes theType)
+ const double theValue,
+ const SALOMEDSImpl_GenericVariable::VariableTypes theType)
{
SALOMEDSImpl_GenericVariable* aGVar = GetVariable(theVarName);
if(SALOMEDSImpl_ScalarVariable* aSVar = dynamic_cast<SALOMEDSImpl_ScalarVariable*>(aGVar))
virtual SALOMEDSImpl_SObject GetSObject(const std::string& theEntry);
virtual SALOMEDSImpl_SObject GetSObject(const DF_Label& theEntryLabel);
virtual DF_Attribute* GetAttribute(const std::string& theEntry,
- const std::string& theType);
+ const std::string& theType);
virtual bool HasCurrentContext() { return !_current.IsNull(); }
virtual bool DumpStudy(const std::string& thePath,
- const std::string& theBaseName,
- bool isPublished,
- SALOMEDSImpl_DriverFactory* theFactory);
+ const std::string& theBaseName,
+ bool isPublished,
+ SALOMEDSImpl_DriverFactory* theFactory);
static std::string GetDumpStudyComment(const char* theComponentName = 0);
SALOMEDSImpl_AttributeParameter* GetCommonParameters(const char* theID, int theSavePoint);
SALOMEDSImpl_AttributeParameter* GetModuleParameters(const char* theID,
- const char* theModuleName,
- int theSavePoint);
+ const char* theModuleName,
+ int theSavePoint);
//Locks the study, theLockerID is identificator of the of the one who locked the study for ex. IOR
void SetStudyLock(const char* theLockerID);
const SALOMEDSImpl_GenericVariable::VariableTypes);
void SetStringVariable(const std::string& theVarName,
- const std::string& theValue,
- const SALOMEDSImpl_GenericVariable::VariableTypes);
+ const std::string& theValue,
+ const SALOMEDSImpl_GenericVariable::VariableTypes);
void SetStringVariableAsDouble(const std::string& theVarName,
- const double theValue,
- const SALOMEDSImpl_GenericVariable::VariableTypes);
+ const double theValue,
+ const SALOMEDSImpl_GenericVariable::VariableTypes);
double GetVariableValue(const std::string& theVarName);
bool IsVariableUsed(const std::string& theVarName);
bool FindVariableAttribute(SALOMEDSImpl_StudyBuilder* theStudyBuilder,
- SALOMEDSImpl_SObject theSObject,
- const std::string& theName);
+ SALOMEDSImpl_SObject theSObject,
+ const std::string& theName);
bool FindVariableAttribute(const std::string& theName);
void ReplaceVariableAttribute(SALOMEDSImpl_StudyBuilder* theStudyBuilder,
- SALOMEDSImpl_SObject theSObject,
- const std::string& theSource,
- const std::string& theDest);
+ SALOMEDSImpl_SObject theSObject,
+ const std::string& theSource,
+ const std::string& theDest);
void ReplaceVariableAttribute(const std::string& theSource, const std::string& theDest);
std::vector< std::vector<std::string> > ParseVariables(const std::string& theVariables) const;
*/
//============================================================================
bool SALOMEDSImpl_StudyBuilder::DefineComponentInstance(const SALOMEDSImpl_SComponent& aComponent,
- const string& IOR)
+ const string& IOR)
{
_errorCode = "";
*/
//============================================================================
SALOMEDSImpl_SObject SALOMEDSImpl_StudyBuilder::NewObjectToTag(const SALOMEDSImpl_SObject& theFatherObject,
- const int theTag)
+ const int theTag)
{
_errorCode = "";
CheckLocked();
if ((aReference=(SALOMEDSImpl_AttributeReference*)aLabel.FindAttribute(SALOMEDSImpl_AttributeReference::GetID()))) {
SALOMEDSImpl_AttributeTarget* aTarget = NULL;
if ((aTarget=(SALOMEDSImpl_AttributeTarget*)aReference->Get().FindAttribute(SALOMEDSImpl_AttributeTarget::GetID())))
- aTarget->Remove(SALOMEDSImpl_Study::SObject(aLabel));
+ aTarget->Remove(SALOMEDSImpl_Study::SObject(aLabel));
}
SALOMEDSImpl_AttributeIOR* anAttr = NULL; //Remove from IORLabel map
if ((anAttr=(SALOMEDSImpl_AttributeIOR*)aLabel.FindAttribute(SALOMEDSImpl_AttributeIOR::GetID()))) {
int aStreamSize = 0;
if (hdf_sco_group->ExistInternalObject("FILE_STREAM")) {
- HDFdataset *hdf_dataset = new HDFdataset("FILE_STREAM", hdf_sco_group);
- hdf_dataset->OpenOnDisk();
- aStreamSize = hdf_dataset->GetSize();
- aStreamFile = new unsigned char[aStreamSize];
- if(aStreamFile == NULL) throw HDFexception("Unable to open dataset FILE_STREAM");
- hdf_dataset->ReadFromDisk(aStreamFile);
- hdf_dataset->CloseOnDisk();
- hdf_dataset = 0;
+ HDFdataset *hdf_dataset = new HDFdataset("FILE_STREAM", hdf_sco_group);
+ hdf_dataset->OpenOnDisk();
+ aStreamSize = hdf_dataset->GetSize();
+ aStreamFile = new unsigned char[aStreamSize];
+ if(aStreamFile == NULL) throw HDFexception("Unable to open dataset FILE_STREAM");
+ hdf_dataset->ReadFromDisk(aStreamFile);
+ hdf_dataset->CloseOnDisk();
+ hdf_dataset = 0;
} else
aStreamFile = NULL;
string aDir = SALOMEDSImpl_Tool::GetDirFromPath(Res);
bool aResult = (ASCIIfileState[0]=='A')?
- aDriver->LoadASCII(anSCO, aStreamFile, aStreamSize, aDir.c_str(), aMultifileState[0]=='M'):
- aDriver->Load(anSCO, aStreamFile, aStreamSize, aDir.c_str(), aMultifileState[0]=='M');
+ aDriver->LoadASCII(anSCO, aStreamFile, aStreamSize, aDir.c_str(), aMultifileState[0]=='M'):
+ aDriver->Load(anSCO, aStreamFile, aStreamSize, aDir.c_str(), aMultifileState[0]=='M');
if(aStreamFile != NULL) delete []aStreamFile;
if(!aResult) {
- RemoveAttribute( anSCO, "AttributeIOR" );
+ RemoveAttribute( anSCO, "AttributeIOR" );
- _errorCode = "Can't load component";
- throw HDFexception("Unable to load component");
+ _errorCode = "Can't load component";
+ throw HDFexception("Unable to load component");
}
//if(aDir != NULL) delete []aDir;
delete hdf_file;
if (isASCII) {
- vector<string> aFilesToRemove;
- aFilesToRemove.push_back("hdf_from_ascii.hdf");
- SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl),
+ vector<string> aFilesToRemove;
+ aFilesToRemove.push_back("hdf_from_ascii.hdf");
+ SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl),
aFilesToRemove, true);
}
}
delete hdf_file;
if (isASCII) {
- vector<string> aFilesToRemove;
- aFilesToRemove.push_back(aHDFUrl);
- SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl), aFilesToRemove, true);
+ vector<string> aFilesToRemove;
+ aFilesToRemove.push_back(aHDFUrl);
+ SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl), aFilesToRemove, true);
}
if (aLocked) _study->GetProperties()->SetLocked(true);
*/
//============================================================================
DF_Attribute* SALOMEDSImpl_StudyBuilder::FindOrCreateAttribute(const SALOMEDSImpl_SObject& anObject,
- const string& aTypeOfAttribute)
+ const string& aTypeOfAttribute)
{
_errorCode = "";
if(!anObject) {
//============================================================================
bool SALOMEDSImpl_StudyBuilder::FindAttribute(const SALOMEDSImpl_SObject& anObject,
- DF_Attribute*& anAttribute,
- const string& aTypeOfAttribute)
+ DF_Attribute*& anAttribute,
+ const string& aTypeOfAttribute)
{
_errorCode = "";
if(!anObject) {
//============================================================================
bool SALOMEDSImpl_StudyBuilder::RemoveAttribute(const SALOMEDSImpl_SObject& anObject,
- const string& aTypeOfAttribute)
+ const string& aTypeOfAttribute)
{
_errorCode = "";
CheckLocked();
*/
//============================================================================
bool SALOMEDSImpl_StudyBuilder::Addreference(const SALOMEDSImpl_SObject& me,
- const SALOMEDSImpl_SObject& theReferencedObject)
+ const SALOMEDSImpl_SObject& theReferencedObject)
{
_errorCode = "";
if(!me || !theReferencedObject) {
*/
//============================================================================
bool SALOMEDSImpl_StudyBuilder::SetGUID(const SALOMEDSImpl_SObject& anObject,
- const string& theGUID)
+ const string& theGUID)
{
_errorCode = "";
CheckLocked();
*/
//============================================================================
bool SALOMEDSImpl_StudyBuilder::IsGUID(const SALOMEDSImpl_SObject& anObject,
- const string& theGUID)
+ const string& theGUID)
{
_errorCode = "";
if(!anObject) {
*/
//============================================================================
bool SALOMEDSImpl_StudyBuilder::SetName(const SALOMEDSImpl_SObject& theSO,
- const string& theValue)
+ const string& theValue)
{
_errorCode = "";
CheckLocked();
*/
//============================================================================
bool SALOMEDSImpl_StudyBuilder::SetComment(const SALOMEDSImpl_SObject& theSO,
- const string& theValue)
+ const string& theValue)
{
_errorCode = "";
CheckLocked();
*/
//============================================================================
bool SALOMEDSImpl_StudyBuilder::SetIOR(const SALOMEDSImpl_SObject& theSO,
- const string& theValue)
+ const string& theValue)
{
_errorCode = "";
CheckLocked();
SALOMEDSImpl_AttributeLocalID* anID = NULL;
if ((anID=(SALOMEDSImpl_AttributeLocalID*)current.FindAttribute(SALOMEDSImpl_AttributeLocalID::GetID())))
- if (anID->Value() == FILELOCALID) continue; //SRN: This attribute store a file name, skip it
+ if (anID->Value() == FILELOCALID) continue; //SRN: This attribute store a file name, skip it
string persist_ref = Att->Value();
SALOMEDSImpl_SObject so = SALOMEDSImpl_Study::SObject(current);
string ior_string = driver->LocalPersistentIDToIOR(so,
- persist_ref,
- isMultiFile,
- isASCII);
+ persist_ref,
+ isMultiFile,
+ isASCII);
SALOMEDSImpl_AttributeIOR::Set (current, ior_string);
}
//purpose :
//=======================================================================
SALOMEDSImpl_StudyHandle* SALOMEDSImpl_StudyHandle::Set(const DF_Label& theLabel,
- SALOMEDSImpl_Study* theStudy)
+ SALOMEDSImpl_Study* theStudy)
{
SALOMEDSImpl_StudyHandle* A = NULL;
if (!(A=(SALOMEDSImpl_StudyHandle*)theLabel.FindAttribute(GetID()))) {
static void ReadAttributes(SALOMEDSImpl_Study*, const SALOMEDSImpl_SObject&, HDFdataset* );
static void BuildTree (SALOMEDSImpl_Study*, HDFgroup*);
static void Translate_IOR_to_persistentID (const SALOMEDSImpl_SObject&,
- SALOMEDSImpl_Driver*, bool isMultiFile, bool isASCII);
+ SALOMEDSImpl_Driver*, bool isMultiFile, bool isASCII);
static void ReadNoteBookVariables(SALOMEDSImpl_Study* theStudy, HDFgroup* theGroup);
//============================================================================
}
catch (HDFexception)
{
- char *eStr;
- eStr = new char[strlen(aUrl.c_str())+17];
+ char *eStr;
+ eStr = new char[strlen(aUrl.c_str())+17];
sprintf(eStr,"Can't open file %s",aUrl.c_str());
- delete [] eStr;
+ delete [] eStr;
_errorCode = string(eStr);
return NULL;
}
*/
//============================================================================
bool SALOMEDSImpl_StudyManager::Save(SALOMEDSImpl_Study* aStudy,
- SALOMEDSImpl_DriverFactory* aFactory,
- bool theMultiFile)
+ SALOMEDSImpl_DriverFactory* aFactory,
+ bool theMultiFile)
{
_errorCode = "";
}
bool SALOMEDSImpl_StudyManager::SaveASCII(SALOMEDSImpl_Study* aStudy,
- SALOMEDSImpl_DriverFactory* aFactory,
- bool theMultiFile)
+ SALOMEDSImpl_DriverFactory* aFactory,
+ bool theMultiFile)
{
_errorCode = "";
*/
//============================================================================
bool SALOMEDSImpl_StudyManager::SaveAs(const string& aUrl,
- SALOMEDSImpl_Study* aStudy,
- SALOMEDSImpl_DriverFactory* aFactory,
- bool theMultiFile)
+ SALOMEDSImpl_Study* aStudy,
+ SALOMEDSImpl_DriverFactory* aFactory,
+ bool theMultiFile)
{
_errorCode = "";
return Impl_SaveAs(aUrl,aStudy, aFactory, theMultiFile, false);
}
bool SALOMEDSImpl_StudyManager::SaveAsASCII(const string& aUrl,
- SALOMEDSImpl_Study* aStudy,
- SALOMEDSImpl_DriverFactory* aFactory,
- bool theMultiFile)
+ SALOMEDSImpl_Study* aStudy,
+ SALOMEDSImpl_DriverFactory* aFactory,
+ bool theMultiFile)
{
_errorCode = "";
return Impl_SaveAs(aUrl,aStudy, aFactory, theMultiFile, true);
int a = 2;
for(anIndex = 0; anIndex<aLength; anIndex++) {
sprintf(&(aProperty[a]),"%2d%2d%2d%2d%4d%s",
- (int)(aMinutes[anIndex]),
- (int)(aHours[anIndex]),
- (int)(aDays[anIndex]),
- (int)(aMonths[anIndex]),
- (int)(aYears[anIndex]),
- aNames[anIndex].c_str());
+ (int)(aMinutes[anIndex]),
+ (int)(aHours[anIndex]),
+ (int)(aDays[anIndex]),
+ (int)(aMonths[anIndex]),
+ (int)(aYears[anIndex]),
+ aNames[anIndex].c_str());
a = strlen(aProperty);
aProperty[a++] = 1;
}
*/
//============================================================================
bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const string& aStudyUrl,
- SALOMEDSImpl_Study* aStudy,
- SALOMEDSImpl_DriverFactory* aFactory,
- bool theMultiFile,
- bool theASCII)
+ SALOMEDSImpl_Study* aStudy,
+ SALOMEDSImpl_DriverFactory* aFactory,
+ bool theMultiFile,
+ bool theASCII)
{
// HDF File will be composed of differents part :
// * For each ComponentDataType, all data created by the component
// mpv 15.12.2003: for saving components we have to load all data from all modules
SALOMEDSImpl_SComponentIterator itcomponent1 = aStudy->NewComponentIterator();
for (; itcomponent1.More(); itcomponent1.Next())
- {
- SALOMEDSImpl_SComponent sco = itcomponent1.Value();
- // if there is an associated Engine call its method for saving
- string IOREngine;
- try {
- if (!sco.ComponentIOR(IOREngine)) {
- string aCompType = sco.GetComment();
- if (!aCompType.empty()) {
-
- SALOMEDSImpl_Driver* aDriver = aFactory->GetDriverByType(aCompType);
- aMapTypeDriver[aCompType] = aDriver;
-
- if (aDriver != NULL) {
- if(!SB->LoadWith(sco, aDriver)) {
- _errorCode = SB->GetErrorCode();
- return false;
- }
- }
- }
- }
- } catch(...) {
- _errorCode = "Can not restore information to resave it";
- return false;
- }
- }
+ {
+ SALOMEDSImpl_SComponent sco = itcomponent1.Value();
+ // if there is an associated Engine call its method for saving
+ string IOREngine;
+ try {
+ if (!sco.ComponentIOR(IOREngine)) {
+ string aCompType = sco.GetComment();
+ if (!aCompType.empty()) {
+
+ SALOMEDSImpl_Driver* aDriver = aFactory->GetDriverByType(aCompType);
+ aMapTypeDriver[aCompType] = aDriver;
+
+ if (aDriver != NULL) {
+ if(!SB->LoadWith(sco, aDriver)) {
+ _errorCode = SB->GetErrorCode();
+ return false;
+ }
+ }
+ }
+ }
+ } catch(...) {
+ _errorCode = "Can not restore information to resave it";
+ return false;
+ }
+ }
string anOldName = aStudy->Name();
aStudy->URL(aStudyUrl);
SALOMEDSImpl_SComponentIterator itcomponent = aStudy->NewComponentIterator();
for (; itcomponent.More(); itcomponent.Next())
- {
- SALOMEDSImpl_SComponent sco = itcomponent.Value();
-
- string scoid = sco.GetID();
- hdf_sco_group = new HDFgroup((char*)scoid.c_str(), hdf_group_datacomponent);
- hdf_sco_group->CreateOnDisk();
-
- string componentDataType = sco.ComponentDataType();
- string IOREngine;
- if (sco.ComponentIOR(IOREngine))
- {
- SALOMEDSImpl_Driver* Engine = NULL;
- if(aMapTypeDriver.find(componentDataType) != aMapTypeDriver.end()) {
- // we have found the associated engine to write the data
- Engine = aMapTypeDriver[componentDataType];
- }
- else {
- Engine = aFactory->GetDriverByIOR(IOREngine);
- }
-
- if (Engine != NULL)
- {
- SALOMEDSImpl_TMPFile* aStream = NULL;
- long length = 0;
+ {
+ SALOMEDSImpl_SComponent sco = itcomponent.Value();
+
+ string scoid = sco.GetID();
+ hdf_sco_group = new HDFgroup((char*)scoid.c_str(), hdf_group_datacomponent);
+ hdf_sco_group->CreateOnDisk();
+
+ string componentDataType = sco.ComponentDataType();
+ string IOREngine;
+ if (sco.ComponentIOR(IOREngine))
+ {
+ SALOMEDSImpl_Driver* Engine = NULL;
+ if(aMapTypeDriver.find(componentDataType) != aMapTypeDriver.end()) {
+ // we have found the associated engine to write the data
+ Engine = aMapTypeDriver[componentDataType];
+ }
+ else {
+ Engine = aFactory->GetDriverByIOR(IOREngine);
+ }
+
+ if (Engine != NULL)
+ {
+ SALOMEDSImpl_TMPFile* aStream = NULL;
+ long length = 0;
if (theASCII) aStream = Engine->SaveASCII(sco,
- SALOMEDSImpl_Tool::GetDirFromPath(aUrl),
- length,
- theMultiFile);
- else aStream = Engine->Save(sco,
- SALOMEDSImpl_Tool::GetDirFromPath(aUrl),
- length,
- theMultiFile);
- HDFdataset *hdf_dataset;
- hdf_size aHDFSize[1];
- if(length > 0) { //The component saved some auxiliary files, then put them into HDF file
-
- aHDFSize[0] = length;
-
- HDFdataset *hdf_dataset = new HDFdataset("FILE_STREAM", hdf_sco_group, HDF_STRING, aHDFSize, 1);
- hdf_dataset->CreateOnDisk();
- hdf_dataset->WriteOnDisk(aStream->Data()); //Save the stream in the HDF file
- hdf_dataset->CloseOnDisk();
- }
-
- if(aStream) delete aStream;
-
- // store multifile state
- aHDFSize[0] = 2;
- hdf_dataset = new HDFdataset("MULTIFILE_STATE", hdf_sco_group, HDF_STRING, aHDFSize, 1);
- hdf_dataset->CreateOnDisk();
- hdf_dataset->WriteOnDisk((void*)(theMultiFile?"M":"S")); // save: multi or single
- hdf_dataset->CloseOnDisk();
- hdf_dataset=0; //will be deleted by hdf_sco_AuxFiles destructor
- // store ASCII state
- aHDFSize[0] = 2;
- hdf_dataset = new HDFdataset("ASCII_STATE", hdf_sco_group, HDF_STRING, aHDFSize, 1);
- hdf_dataset->CreateOnDisk();
- hdf_dataset->WriteOnDisk((void*)(theASCII?"A":"B")); // save: ASCII or BINARY
- hdf_dataset->CloseOnDisk();
- hdf_dataset=0; //will be deleted by hdf_sco_AuxFiles destructor
- // Creation of the persistance reference attribute
- Translate_IOR_to_persistentID (sco, Engine, theMultiFile, theASCII);
- }
- }
- hdf_sco_group->CloseOnDisk();
- hdf_sco_group=0; // will be deleted by hdf_group_datacomponent destructor
- }
+ SALOMEDSImpl_Tool::GetDirFromPath(aUrl),
+ length,
+ theMultiFile);
+ else aStream = Engine->Save(sco,
+ SALOMEDSImpl_Tool::GetDirFromPath(aUrl),
+ length,
+ theMultiFile);
+ HDFdataset *hdf_dataset;
+ hdf_size aHDFSize[1];
+ if(length > 0) { //The component saved some auxiliary files, then put them into HDF file
+
+ aHDFSize[0] = length;
+
+ HDFdataset *hdf_dataset = new HDFdataset("FILE_STREAM", hdf_sco_group, HDF_STRING, aHDFSize, 1);
+ hdf_dataset->CreateOnDisk();
+ hdf_dataset->WriteOnDisk(aStream->Data()); //Save the stream in the HDF file
+ hdf_dataset->CloseOnDisk();
+ }
+
+ if(aStream) delete aStream;
+
+ // store multifile state
+ aHDFSize[0] = 2;
+ hdf_dataset = new HDFdataset("MULTIFILE_STATE", hdf_sco_group, HDF_STRING, aHDFSize, 1);
+ hdf_dataset->CreateOnDisk();
+ hdf_dataset->WriteOnDisk((void*)(theMultiFile?"M":"S")); // save: multi or single
+ hdf_dataset->CloseOnDisk();
+ hdf_dataset=0; //will be deleted by hdf_sco_AuxFiles destructor
+ // store ASCII state
+ aHDFSize[0] = 2;
+ hdf_dataset = new HDFdataset("ASCII_STATE", hdf_sco_group, HDF_STRING, aHDFSize, 1);
+ hdf_dataset->CreateOnDisk();
+ hdf_dataset->WriteOnDisk((void*)(theASCII?"A":"B")); // save: ASCII or BINARY
+ hdf_dataset->CloseOnDisk();
+ hdf_dataset=0; //will be deleted by hdf_sco_AuxFiles destructor
+ // Creation of the persistance reference attribute
+ Translate_IOR_to_persistentID (sco, Engine, theMultiFile, theASCII);
+ }
+ }
+ hdf_sco_group->CloseOnDisk();
+ hdf_sco_group=0; // will be deleted by hdf_group_datacomponent destructor
+ }
hdf_group_datacomponent->CloseOnDisk();
hdf_group_datacomponent =0; // will be deleted by hdf_file destructor
// save component attributes
SALOMEDSImpl_SComponentIterator itcomp = aStudy->NewComponentIterator();
for (; itcomp.More(); itcomp.Next())
- {
- SALOMEDSImpl_SComponent SC = itcomp.Value();
- string scid = SC.GetID();
- hdf_sco_group2 = new HDFgroup((char*)scid.c_str(), hdf_group_study_structure);
- hdf_sco_group2->CreateOnDisk();
+ {
+ SALOMEDSImpl_SComponent SC = itcomp.Value();
+ string scid = SC.GetID();
+ hdf_sco_group2 = new HDFgroup((char*)scid.c_str(), hdf_group_study_structure);
+ hdf_sco_group2->CreateOnDisk();
SaveAttributes(SC, hdf_sco_group2);
- // ComponentDataType treatment
- component_name = SC.ComponentDataType();
- name_len = (hdf_int32)component_name.length();
- size[0] = name_len +1 ;
- hdf_dataset = new HDFdataset("COMPONENTDATATYPE",hdf_sco_group2,HDF_STRING,size,1);
- hdf_dataset->CreateOnDisk();
- hdf_dataset->WriteOnDisk((char*)component_name.c_str());
- hdf_dataset->CloseOnDisk();
- hdf_dataset=0; //will be deleted by hdf_sco_group destructor
- Impl_SaveObject(SC, hdf_sco_group2);
- hdf_sco_group2->CloseOnDisk();
- hdf_sco_group2=0; // will be deleted by hdf_group_study_structure destructor
- }
+ // ComponentDataType treatment
+ component_name = SC.ComponentDataType();
+ name_len = (hdf_int32)component_name.length();
+ size[0] = name_len +1 ;
+ hdf_dataset = new HDFdataset("COMPONENTDATATYPE",hdf_sco_group2,HDF_STRING,size,1);
+ hdf_dataset->CreateOnDisk();
+ hdf_dataset->WriteOnDisk((char*)component_name.c_str());
+ hdf_dataset->CloseOnDisk();
+ hdf_dataset=0; //will be deleted by hdf_sco_group destructor
+ Impl_SaveObject(SC, hdf_sco_group2);
+ hdf_sco_group2->CloseOnDisk();
+ hdf_sco_group2=0; // will be deleted by hdf_group_study_structure destructor
+ }
//-----------------------------------------------------------------------
//4 - Write the Study UseCases Structure
//-----------------------------------------------------------------------
SALOMEDSImpl_SObject aSO = aStudy->FindObjectID(USE_CASE_LABEL_ID);
if (aSO) {
- HDFgroup *hdf_soo_group = new HDFgroup(USE_CASE_LABEL_ID,hdf_group_study_structure);
- hdf_soo_group->CreateOnDisk();
- SaveAttributes(aSO, hdf_soo_group);
- Impl_SaveObject(aSO, hdf_soo_group);
- hdf_soo_group->CloseOnDisk();
- hdf_soo_group=0; // will be deleted by hdf_group_study_structure destructor
+ HDFgroup *hdf_soo_group = new HDFgroup(USE_CASE_LABEL_ID,hdf_group_study_structure);
+ hdf_soo_group->CreateOnDisk();
+ SaveAttributes(aSO, hdf_soo_group);
+ Impl_SaveObject(aSO, hdf_soo_group);
+ hdf_soo_group->CloseOnDisk();
+ hdf_soo_group=0; // will be deleted by hdf_group_study_structure destructor
}
//-----------------------------------------------------------------------
//5 - Write the NoteBook Variables
*/
//============================================================================
bool SALOMEDSImpl_StudyManager::Impl_SaveObject(const SALOMEDSImpl_SObject& SC,
- HDFgroup *hdf_group_datatype)
+ HDFgroup *hdf_group_datatype)
{
_errorCode = "";
// mpv: don't save empty labels
vector<DF_Attribute*> attr = itchild.Value().GetAttributes();
if (attr.size() == 0) { //No attributes on the label
- DF_ChildIterator subchild(itchild.Value());
- if (!subchild.More()) {
- continue;
- }
- subchild.Init(itchild.Value(), true);
- bool anEmpty = true;
- for (; subchild.More() && anEmpty; subchild.Next()) {
- vector<DF_Attribute*> attr2 = subchild.Value().GetAttributes();
- if (attr2.size()) {
- anEmpty = false; //There are attributes on the child label
- break;
- }
- }
- if (anEmpty) continue;
+ DF_ChildIterator subchild(itchild.Value());
+ if (!subchild.More()) {
+ continue;
+ }
+ subchild.Init(itchild.Value(), true);
+ bool anEmpty = true;
+ for (; subchild.More() && anEmpty; subchild.Next()) {
+ vector<DF_Attribute*> attr2 = subchild.Value().GetAttributes();
+ if (attr2.size()) {
+ anEmpty = false; //There are attributes on the child label
+ break;
+ }
+ }
+ if (anEmpty) continue;
}
SALOMEDSImpl_SObject SO = SALOMEDSImpl_Study::SObject(itchild.Value());
*/
//============================================================================
bool SALOMEDSImpl_StudyManager::CanCopy(const SALOMEDSImpl_SObject& theObject,
- SALOMEDSImpl_Driver* theEngine)
+ SALOMEDSImpl_Driver* theEngine)
{
_errorCode = "";
SALOMEDSImpl_SComponent aComponent = theObject.GetFatherComponent();
*/
//============================================================================
bool SALOMEDSImpl_StudyManager::CopyLabel(SALOMEDSImpl_Study* theSourceStudy,
- SALOMEDSImpl_Driver* theEngine,
- const int theSourceStartDepth,
- const DF_Label& theSource,
- const DF_Label& theDestinationMain)
+ SALOMEDSImpl_Driver* theEngine,
+ const int theSourceStartDepth,
+ const DF_Label& theSource,
+ const DF_Label& theDestinationMain)
{
_errorCode = "";
// store the value of name attribute of referenced label
SALOMEDSImpl_AttributeName* aNameAttribute;
if ((aNameAttribute=(SALOMEDSImpl_AttributeName*)aReferenced.FindAttribute(SALOMEDSImpl_AttributeName::GetID()))) {
- anEntry += " ";
- anEntry += aNameAttribute->Value();
+ anEntry += " ";
+ anEntry += aNameAttribute->Value();
}
SALOMEDSImpl_AttributeComment::Set(aAuxTargetLabel, anEntry);
continue;
SALOMEDSImpl_TMPFile* aStream = theEngine->CopyFrom(aSO, anObjID, aLen);
string aResStr("");
for(a = 0; a < aLen; a++) {
- aResStr += (char)(aStream->Get(a));
+ aResStr += (char)(aStream->Get(a));
}
if(aStream) delete aStream;
*/
//============================================================================
bool SALOMEDSImpl_StudyManager::Copy(const SALOMEDSImpl_SObject& theObject,
- SALOMEDSImpl_Driver* theEngine)
+ SALOMEDSImpl_Driver* theEngine)
{
_errorCode = "";
// set component data type to the name attribute of root label
if (!aStructureOnly) {
SALOMEDSImpl_AttributeComment::Set(_clipboard->Main().Root(),
- theEngine->ComponentDataType());
+ theEngine->ComponentDataType());
}
// set to the Root label integer attribute: study id
SALOMEDSImpl_AttributeInteger::Set(_clipboard->Main().Root(), aStudy->StudyId());
*/
//============================================================================
bool SALOMEDSImpl_StudyManager::CanPaste(const SALOMEDSImpl_SObject& theObject,
- SALOMEDSImpl_Driver* theEngine)
+ SALOMEDSImpl_Driver* theEngine)
{
_errorCode = "";
*/
//============================================================================
DF_Label SALOMEDSImpl_StudyManager::PasteLabel(SALOMEDSImpl_Study* theDestinationStudy,
- SALOMEDSImpl_Driver* theEngine,
- const DF_Label& theSource,
- const DF_Label& theDestinationStart,
- const int theCopiedStudyID,
- const bool isFirstElement)
+ SALOMEDSImpl_Driver* theEngine,
+ const DF_Label& theSource,
+ const DF_Label& theDestinationStart,
+ const int theCopiedStudyID,
+ const bool isFirstElement)
{
_errorCode = "";
int aLen = aTMPStr.size();
unsigned char* aStream = NULL;
if(aLen > 0) {
- aStream = new unsigned char[aLen+10];
- for(a = 0; a < aLen; a++) {
- aStream[a] = aTMPStr[a];
- }
+ aStream = new unsigned char[aLen+10];
+ for(a = 0; a < aLen; a++) {
+ aStream[a] = aTMPStr[a];
+ }
}
string anEntry = aTargetLabel.Entry();
SALOMEDSImpl_SObject aPastedSO = theDestinationStudy->FindObjectID(anEntry);
if (isFirstElement) {
- string aDestEntry = theEngine->PasteInto(aStream,
- aLen,
- anObjID->Value(),
- aPastedSO.GetFatherComponent());
- aTargetLabel = DF_Label::Label(theDestinationStart, aDestEntry);
+ string aDestEntry = theEngine->PasteInto(aStream,
+ aLen,
+ anObjID->Value(),
+ aPastedSO.GetFatherComponent());
+ aTargetLabel = DF_Label::Label(theDestinationStart, aDestEntry);
} else
- theEngine->PasteInto(aStream, aLen, anObjID->Value(), aPastedSO);
+ theEngine->PasteInto(aStream, aLen, anObjID->Value(), aPastedSO);
if(aStream != NULL) delete []aStream;
}
*/
//============================================================================
SALOMEDSImpl_SObject SALOMEDSImpl_StudyManager::Paste(const SALOMEDSImpl_SObject& theObject,
- SALOMEDSImpl_Driver* theEngine)
+ SALOMEDSImpl_Driver* theEngine)
{
_errorCode = "";
//Function : ReadAttributes
//===========================================================================
static void ReadAttributes(SALOMEDSImpl_Study* theStudy,
- const SALOMEDSImpl_SObject& aSO,
- HDFdataset* hdf_dataset)
+ const SALOMEDSImpl_SObject& aSO,
+ HDFdataset* hdf_dataset)
{
hdf_dataset->OpenOnDisk();
//Function : Translate_IOR_to_persistentID
//============================================================================
static void Translate_IOR_to_persistentID (const SALOMEDSImpl_SObject& so,
- SALOMEDSImpl_Driver* engine,
- bool isMultiFile,
- bool isASCII)
+ SALOMEDSImpl_Driver* engine,
+ bool isMultiFile,
+ bool isASCII)
{
DF_ChildIterator itchild(so.GetLabel());
string ior_string, persistent_string, curid;
// purpose : Removes files listed in theFileList
//============================================================================
void SALOMEDSImpl_Tool::RemoveTemporaryFiles(const string& theDirectory,
- const vector<string>& theFiles,
- const bool IsDirDeleted)
+ const vector<string>& theFiles,
+ const bool IsDirDeleted)
{
string aDirName = theDirectory;
vs.push_back(s.substr(0, pos));
s = s.substr(pos+1, s.size());
}
-
+
if(!s.empty() && s[0] != separator) vs.push_back(s);
return vs;
}
// Removes files which are in <theDirectory>, the files for deletion are listed in <theFiles>
// if <IsDirDeleted> is true <theDirectory> is also deleted if it is empty
static void RemoveTemporaryFiles(const std::string& theDirectory,
- const std::vector<std::string>& theFiles,
- const bool IsDirDeleted);
+ const std::vector<std::string>& theFiles,
+ const bool IsDirDeleted);
// Returns the name by the path
// for an example: if thePath = "/tmp/aaa/doc1.hdf" the function returns "doc1"
//The functions returns a list of substring of initial string divided by given separator,
//include empty strings
static std::vector< std::vector<std::string> > splitStringWithEmpty(const std::string& theValue,
- char separator1,
- char separator2);
+ char separator1,
+ char separator2);
//Returns a system date
*/
//============================================================================
bool SALOMEDSImpl_UseCaseBuilder::AppendTo(const SALOMEDSImpl_SObject& theFather,
- const SALOMEDSImpl_SObject& theObject)
+ const SALOMEDSImpl_SObject& theObject)
{
if(!_root || !theFather || !theObject) return false;
*/
//============================================================================
bool SALOMEDSImpl_UseCaseBuilder::InsertBefore(const SALOMEDSImpl_SObject& theFirst,
- const SALOMEDSImpl_SObject& theNext)
+ const SALOMEDSImpl_SObject& theNext)
{
if(!_root || !theFirst || !theNext) return false;
*/
//============================================================================
SALOMEDSImpl_UseCaseIterator::SALOMEDSImpl_UseCaseIterator(const DF_Label& theLabel,
- const string& theGUID,
- const bool allLevels)
+ const string& theGUID,
+ const bool allLevels)
:_guid(theGUID), _levels(allLevels)
{
if((_node = (SALOMEDSImpl_AttributeTreeNode*)theLabel.FindAttribute(_guid))) {
int ret;
ret = pthread_mutex_lock(&_singletonMutex); // acquire lock to be alone
if (_singleton == 0) // another thread may have got
- { // the lock after the first test
- DEVTRACE("FileTraceCollector:: instance()");
- BaseTraceCollector* myInstance = new FileTraceCollector();
- _fileName = fileName;
- DEVTRACE(" _fileName: " << _fileName);
-
- sem_init(&_sem,0,0); // to wait until run thread is initialized
- pthread_t traceThread;
- int bid = 0;
- pthread_create(&traceThread, NULL,
- FileTraceCollector::run, (void *)bid);
- sem_wait(&_sem);
- _singleton = myInstance; // _singleton known only when init done
- DEVTRACE("FileTraceCollector:: instance()-end");
- }
+ { // the lock after the first test
+ DEVTRACE("FileTraceCollector:: instance()");
+ BaseTraceCollector* myInstance = new FileTraceCollector();
+ _fileName = fileName;
+ DEVTRACE(" _fileName: " << _fileName);
+
+ sem_init(&_sem,0,0); // to wait until run thread is initialized
+ pthread_t traceThread;
+ int bid = 0;
+ pthread_create(&traceThread, NULL,
+ FileTraceCollector::run, (void *)bid);
+ sem_wait(&_sem);
+ _singleton = myInstance; // _singleton known only when init done
+ DEVTRACE("FileTraceCollector:: instance()-end");
+ }
ret = pthread_mutex_unlock(&_singletonMutex); // release lock
}
return _singleton;
while ((!_threadToClose) || myTraceBuffer->toCollect() )
{
if (_threadToClose)
- {
- DEVTRACE("FileTraceCollector _threadToClose");
- //break;
- }
+ {
+ DEVTRACE("FileTraceCollector _threadToClose");
+ //break;
+ }
myTraceBuffer->retrieve(myTrace);
if (myTrace.traceType == ABORT_MESS)
- {
+ {
#ifndef WIN32
- traceFile << "INTERRUPTION from thread " << myTrace.threadId
- << " : " << myTrace.trace;
+ traceFile << "INTERRUPTION from thread " << myTrace.threadId
+ << " : " << myTrace.trace;
#else
- traceFile << "INTERRUPTION from thread "
- << (void*)(&myTrace.threadId)
- << " : " << myTrace.trace;
+ traceFile << "INTERRUPTION from thread "
+ << (void*)(&myTrace.threadId)
+ << " : " << myTrace.trace;
#endif
- traceFile.close();
- cout << flush ;
+ traceFile.close();
+ cout << flush ;
#ifndef WIN32
- cerr << "INTERRUPTION from thread " << myTrace.threadId
- << " : " << myTrace.trace;
+ cerr << "INTERRUPTION from thread " << myTrace.threadId
+ << " : " << myTrace.trace;
#else
- cerr << "INTERRUPTION from thread " << (void*)(&myTrace.threadId)
- << " : " << myTrace.trace;
+ cerr << "INTERRUPTION from thread " << (void*)(&myTrace.threadId)
+ << " : " << myTrace.trace;
#endif
- cerr << flush ;
- exit(1);
- }
+ cerr << flush ;
+ exit(1);
+ }
else
- {
+ {
#ifndef WIN32
- traceFile << "th. " << myTrace.threadId
- << " " << myTrace.trace;
+ traceFile << "th. " << myTrace.threadId
+ << " " << myTrace.trace;
#else
- traceFile << "th. " << (void*)(&myTrace.threadId)
- << " " << myTrace.trace;
+ traceFile << "th. " << (void*)(&myTrace.threadId)
+ << " " << myTrace.trace;
#endif
- }
+ }
}
DEVTRACE("traceFile.close()");
traceFile.close();
_threadToClose = 1;
myTraceBuffer->insert(NORMAL_MESS,"end of trace\n"); // to wake up thread
if (_threadId)
- {
- int ret = pthread_join(*_threadId, NULL);
- if (ret) cerr << "error close FileTraceCollector : "<< ret << endl;
- else DEVTRACE("FileTraceCollector destruction OK");
+ {
+ int ret = pthread_join(*_threadId, NULL);
+ if (ret) cerr << "error close FileTraceCollector : "<< ret << endl;
+ else DEVTRACE("FileTraceCollector destruction OK");
delete _threadId;
- _threadId = 0;
- _threadToClose = 0;
- }
+ _threadId = 0;
+ _threadToClose = 0;
+ }
_singleton = 0;
}
ret = pthread_mutex_unlock(&_singletonMutex); // release lock
int ret;
ret = pthread_mutex_lock(&_singletonMutex); // acquire lock to be alone
if (_singleton == 0) // another thread may have got
- { // the lock after the first test
- DEVTRACE("New buffer pool");
- LocalTraceBufferPool* myInstance = new LocalTraceBufferPool();
-
- new DESTRUCTOR_OF<LocalTraceBufferPool> (*myInstance);
- _singleton = myInstance;
-
- // --- start a trace Collector
-
- char* traceKind = getenv("SALOME_trace");
-
- if ( !traceKind || strcmp(traceKind,"local")==0 ) // mkr : 27.11.2006 : PAL13967 - Distributed supervision graphs - Problem with "SALOME_trace"
- {
- _myThreadTrace = LocalTraceCollector::instance();
- }
- else if (strncmp(traceKind,"file",strlen("file"))==0)
- {
- const char *fileName;
- if (strlen(traceKind) > strlen("file"))
- fileName = &traceKind[strlen("file")+1];
- else
- fileName = "/tmp/tracetest.log";
-
- _myThreadTrace = FileTraceCollector::instance(fileName);
- }
- else // --- try a dynamic library
- {
+ { // the lock after the first test
+ DEVTRACE("New buffer pool");
+ LocalTraceBufferPool* myInstance = new LocalTraceBufferPool();
+
+ new DESTRUCTOR_OF<LocalTraceBufferPool> (*myInstance);
+ _singleton = myInstance;
+
+ // --- start a trace Collector
+
+ char* traceKind = getenv("SALOME_trace");
+
+ if ( !traceKind || strcmp(traceKind,"local")==0 ) // mkr : 27.11.2006 : PAL13967 - Distributed supervision graphs - Problem with "SALOME_trace"
+ {
+ _myThreadTrace = LocalTraceCollector::instance();
+ }
+ else if (strncmp(traceKind,"file",strlen("file"))==0)
+ {
+ const char *fileName;
+ if (strlen(traceKind) > strlen("file"))
+ fileName = &traceKind[strlen("file")+1];
+ else
+ fileName = "/tmp/tracetest.log";
+
+ _myThreadTrace = FileTraceCollector::instance(fileName);
+ }
+ else // --- try a dynamic library
+ {
#ifndef WIN32
- void* handle;
- string impl_name = string ("lib") + traceKind
- + string("TraceCollector.so");
- handle = dlopen( impl_name.c_str() , RTLD_LAZY ) ;
+ void* handle;
+ string impl_name = string ("lib") + traceKind
+ + string("TraceCollector.so");
+ handle = dlopen( impl_name.c_str() , RTLD_LAZY ) ;
#else
- HINSTANCE handle;
- string impl_name = string ("lib") + traceKind + string(".dll");
- handle = LoadLibrary( impl_name.c_str() );
+ HINSTANCE handle;
+ string impl_name = string ("lib") + traceKind + string(".dll");
+ handle = LoadLibrary( impl_name.c_str() );
#endif
- if ( handle )
- {
- typedef BaseTraceCollector * (*FACTORY_FUNCTION) (void);
+ if ( handle )
+ {
+ typedef BaseTraceCollector * (*FACTORY_FUNCTION) (void);
#ifndef WIN32
- FACTORY_FUNCTION TraceCollectorFactory =
- (FACTORY_FUNCTION) dlsym(handle, "SingletonInstance");
+ FACTORY_FUNCTION TraceCollectorFactory =
+ (FACTORY_FUNCTION) dlsym(handle, "SingletonInstance");
#else
- FACTORY_FUNCTION TraceCollectorFactory =
- (FACTORY_FUNCTION)GetProcAddress(handle, "SingletonInstance");
+ FACTORY_FUNCTION TraceCollectorFactory =
+ (FACTORY_FUNCTION)GetProcAddress(handle, "SingletonInstance");
#endif
- if ( !TraceCollectorFactory )
- {
- cerr << "Can't resolve symbol: SingletonInstance" <<endl;
+ if ( !TraceCollectorFactory )
+ {
+ cerr << "Can't resolve symbol: SingletonInstance" <<endl;
#ifndef WIN32
- cerr << "dlerror: " << dlerror() << endl;
+ cerr << "dlerror: " << dlerror() << endl;
#endif
- exit( 1 );
- }
- _myThreadTrace = (TraceCollectorFactory) ();
- }
- else
- {
- cerr << "library: " << impl_name << " not found !" << endl;
- assert(handle); // to give file and line
- exit(1); // in case assert is deactivated
- }
- }
- DEVTRACE("New buffer pool: end");
- }
+ exit( 1 );
+ }
+ _myThreadTrace = (TraceCollectorFactory) ();
+ }
+ else
+ {
+ cerr << "library: " << impl_name << " not found !" << endl;
+ assert(handle); // to give file and line
+ exit(1); // in case assert is deactivated
+ }
+ }
+ DEVTRACE("New buffer pool: end");
+ }
ret = pthread_mutex_unlock(&_singletonMutex); // release lock
}
return _singleton;
// fill the buffer with message, thread id and type (normal or abort)
strncpy(_myBuffer[myInsertPos%TRACE_BUFFER_SIZE].trace,
- msg,
- MAXMESS_LENGTH); // last chars always "...\n\0" if msg too long
+ msg,
+ MAXMESS_LENGTH); // last chars always "...\n\0" if msg too long
_myBuffer[myInsertPos%TRACE_BUFFER_SIZE].threadId =pthread_self();//thread id
_myBuffer[myInsertPos%TRACE_BUFFER_SIZE].traceType = traceType;
_myBuffer[myInsertPos%TRACE_BUFFER_SIZE].position = myMessageNumber;
// copy the buffer from the pool to the provided buffer
memcpy((void*)&aTrace,
- (void*)&_myBuffer[myRetrievePos%TRACE_BUFFER_SIZE],
- sizeof(aTrace));
+ (void*)&_myBuffer[myRetrievePos%TRACE_BUFFER_SIZE],
+ sizeof(aTrace));
// increment the free buffer semaphore
// (if previously 0, awake one of the threads waiting to put a trace, if any)
int ret;
ret = pthread_mutex_lock(&_singletonMutex); // acquire lock to be alone
if (_singleton == 0) // another thread may have got
- { // the lock after the first test
- BaseTraceCollector* myInstance = new LocalTraceCollector();
-
- sem_init(&_sem,0,0); // to wait until run thread is initialized
- pthread_t traceThread;
- pthread_create(&traceThread, NULL,
- LocalTraceCollector::run, NULL);
- sem_wait(&_sem);
- _singleton = myInstance; // _singleton known only when init done
- }
+ { // the lock after the first test
+ BaseTraceCollector* myInstance = new LocalTraceCollector();
+
+ sem_init(&_sem,0,0); // to wait until run thread is initialized
+ pthread_t traceThread;
+ pthread_create(&traceThread, NULL,
+ LocalTraceCollector::run, NULL);
+ sem_wait(&_sem);
+ _singleton = myInstance; // _singleton known only when init done
+ }
ret = pthread_mutex_unlock(&_singletonMutex); // release lock
}
return _singleton;
while ((!_threadToClose) || myTraceBuffer->toCollect() )
{
if (_threadToClose)
- {
- DEVTRACE("FileTraceCollector _threadToClose");
- //break;
- }
+ {
+ DEVTRACE("FileTraceCollector _threadToClose");
+ //break;
+ }
myTraceBuffer->retrieve(myTrace);
if (myTrace.traceType == ABORT_MESS)
- {
- cout << flush ;
+ {
+ cout << flush ;
#ifndef WIN32
- cerr << "INTERRUPTION from thread " << myTrace.threadId
- << " : " << myTrace.trace;
+ cerr << "INTERRUPTION from thread " << myTrace.threadId
+ << " : " << myTrace.trace;
#else
- cerr << "INTERRUPTION from thread " << (void*)(&myTrace.threadId)
- << " : " << myTrace.trace;
+ cerr << "INTERRUPTION from thread " << (void*)(&myTrace.threadId)
+ << " : " << myTrace.trace;
#endif
- cerr << flush ;
- exit(1);
- }
+ cerr << flush ;
+ exit(1);
+ }
else
- {
- cout << flush ;
+ {
+ cout << flush ;
#ifndef WIN32
- cerr << "th. " << myTrace.threadId << " " << myTrace.trace;
+ cerr << "th. " << myTrace.threadId << " " << myTrace.trace;
#else
- cerr << "th. " << (void*)(&myTrace.threadId)
- << " " << myTrace.trace;
+ cerr << "th. " << (void*)(&myTrace.threadId)
+ << " " << myTrace.trace;
#endif
- cerr << flush ;
- }
+ cerr << flush ;
+ }
}
pthread_exit(NULL);
return NULL;
_threadToClose = 1;
myTraceBuffer->insert(NORMAL_MESS,"end of trace\n"); // to wake up thread
if (_threadId)
- {
- int ret = pthread_join(*_threadId, NULL);
- if (ret) cerr << "error close LocalTraceCollector : "<< ret << endl;
- else DEVTRACE("LocalTraceCollector destruction OK");
+ {
+ int ret = pthread_join(*_threadId, NULL);
+ if (ret) cerr << "error close LocalTraceCollector : "<< ret << endl;
+ else DEVTRACE("LocalTraceCollector destruction OK");
delete _threadId;
- _threadId = 0;
- _threadToClose = 0;
- }
+ _threadId = 0;
+ _threadToClose = 0;
+ }
_singleton = 0;
}
ret = pthread_mutex_unlock(&_singletonMutex); // release lock
/* --- To print date and time of compilation of current source --- */
#if defined ( __GNUC__ )
-#define COMPILER "g++"
+#define COMPILER "g++"
#elif defined ( __sun )
-#define COMPILER "CC"
+#define COMPILER "CC"
#elif defined ( __KCC )
-#define COMPILER "KCC"
+#define COMPILER "KCC"
#elif defined ( __PGI )
-#define COMPILER "pgCC"
+#define COMPILER "pgCC"
#elif defined ( __alpha )
-#define COMPILER "cxx"
+#define COMPILER "cxx"
#else
-#define COMPILER "undefined"
+#define COMPILER "undefined"
#endif
#ifdef INFOS_COMPILATION
// --- the following MACROS are useful at debug time
#define INFOS_COMPILATION { MESS_BEGIN("COMPILED with ") << COMPILER \
- << ", " << __DATE__ \
- << " at " << __TIME__ << MESS_END }
+ << ", " << __DATE__ \
+ << " at " << __TIME__ << MESS_END }
#define MESSAGE(msg) {MESS_BEGIN("- Trace ") << msg << MESS_END}
#define SCRUTE(var) {MESS_BEGIN("- Trace ") << #var << "=" << var <<MESS_END}
int ret;
ret = pthread_mutex_lock(&_singletonMutex); // acquire lock to be alone
if (_singleton == 0) // another thread may have got
- { // the lock after the first test
- BaseTraceCollector* myInstance = new SALOMETraceCollector();
- int argc=0;
- char *_argv=0;
- char ** argv = &_argv;
- _orb = CORBA::ORB_init (argc, argv);
-
- sem_init(&_sem,0,0); // to wait until run thread is initialized
- pthread_t traceThread;
- int bid = 0;
- pthread_create(&traceThread, NULL,
- SALOMETraceCollector::run, (void *)bid);
- sem_wait(&_sem);
- _singleton = myInstance; // _singleton known only when init done
- }
+ { // the lock after the first test
+ BaseTraceCollector* myInstance = new SALOMETraceCollector();
+ int argc=0;
+ char *_argv=0;
+ char ** argv = &_argv;
+ _orb = CORBA::ORB_init (argc, argv);
+
+ sem_init(&_sem,0,0); // to wait until run thread is initialized
+ pthread_t traceThread;
+ int bid = 0;
+ pthread_create(&traceThread, NULL,
+ SALOMETraceCollector::run, (void *)bid);
+ sem_wait(&_sem);
+ _singleton = myInstance; // _singleton known only when init done
+ }
ret = pthread_mutex_unlock(&_singletonMutex); // release lock
}
return _singleton;
else
{
CORBA::String_var LogMsg =
- CORBA::string_dup("\n---Init logger trace---\n");
+ CORBA::string_dup("\n---Init logger trace---\n");
m_pInterfaceLogger->putMessage(LogMsg);
DEVTRACE("Logger server found");
}
while ((!_threadToClose) || myTraceBuffer->toCollect() )
{
if (_threadToClose)
- {
- DEVTRACE("SALOMETraceCollector _threadToClose");
- //break;
- }
+ {
+ DEVTRACE("SALOMETraceCollector _threadToClose");
+ //break;
+ }
myTraceBuffer->retrieve(myTrace);
if (!CORBA::is_nil(_orb))
- {
- if (myTrace.traceType == ABORT_MESS)
- {
- stringstream abortMessage("");
+ {
+ if (myTrace.traceType == ABORT_MESS)
+ {
+ stringstream abortMessage("");
#ifndef WIN32
- abortMessage << "INTERRUPTION from thread "
- << myTrace.threadId << " : " << myTrace.trace;
+ abortMessage << "INTERRUPTION from thread "
+ << myTrace.threadId << " : " << myTrace.trace;
#else
- abortMessage << "INTERRUPTION from thread "
- << (void*)&myTrace.threadId
- << " : " << myTrace.trace;
+ abortMessage << "INTERRUPTION from thread "
+ << (void*)&myTrace.threadId
+ << " : " << myTrace.trace;
#endif
- CORBA::String_var LogMsg =
- CORBA::string_dup(abortMessage.str().c_str());
- m_pInterfaceLogger->putMessage(LogMsg);
- exit(1);
- }
- else
- {
- stringstream aMessage("");
+ CORBA::String_var LogMsg =
+ CORBA::string_dup(abortMessage.str().c_str());
+ m_pInterfaceLogger->putMessage(LogMsg);
+ exit(1);
+ }
+ else
+ {
+ stringstream aMessage("");
#ifndef WIN32
- aMessage << "th. " << myTrace.threadId
+ aMessage << "th. " << myTrace.threadId
#else
- aMessage << "th. " << (void*)&myTrace.threadId
+ aMessage << "th. " << (void*)&myTrace.threadId
#endif
- << " " << myTrace.trace;
- CORBA::String_var LogMsg =
- CORBA::string_dup(aMessage.str().c_str());
- m_pInterfaceLogger->putMessage(LogMsg);
- }
- }
+ << " " << myTrace.trace;
+ CORBA::String_var LogMsg =
+ CORBA::string_dup(aMessage.str().c_str());
+ m_pInterfaceLogger->putMessage(LogMsg);
+ }
+ }
}
pthread_exit(NULL);
return NULL;
_threadToClose = 1;
myTraceBuffer->insert(NORMAL_MESS,"end of trace\n"); // to wake up thread
if (_threadId)
- {
- int ret = pthread_join(*_threadId, NULL);
- if (ret) cerr << "error close SALOMETraceCollector : "<< ret << endl;
- else DEVTRACE("SALOMETraceCollector destruction OK");
+ {
+ int ret = pthread_join(*_threadId, NULL);
+ if (ret) cerr << "error close SALOMETraceCollector : "<< ret << endl;
+ else DEVTRACE("SALOMETraceCollector destruction OK");
delete _threadId;
- _threadId = 0;
- _threadToClose = 0;
- }
+ _threadId = 0;
+ _threadToClose = 0;
+ }
_singleton = 0;
}
ret = pthread_mutex_unlock(&_singletonMutex); // release lock
{
#if defined(_DEBUG_) || defined(_DEBUG)
long id_thread = (long)threadid;
- for (int i=0; i<NUM_MESSAGES;i++)
- MESSAGE("Hello World! This is a trace test : " << id_thread
- << " - iter " << i);
+ for (int i=0; i<NUM_MESSAGES;i++)
+ MESSAGE("Hello World! This is a trace test : " << id_thread
+ << " - iter " << i);
#endif
pthread_exit(NULL);
}
// ============================================================================
CORBA::Object_ptr TraceCollector_WaitForServerReadiness(CORBA::ORB_ptr orb,
- string serverName)
+ string serverName)
{
long TIMESleep = 500000000;
int NumberOfTries = 40;
CORBA::Object_var theObj=CORBA::Object::_nil();
for (int itry=0; itry < NumberOfTries; itry++)
- {
- try
- {
- if(!CORBA::is_nil(orb))
- theObj = orb->resolve_initial_references("NameService");
- if (!CORBA::is_nil(theObj))
- inc = CosNaming::NamingContext::_narrow(theObj);
- }
- catch( CORBA::SystemException& )
- {
- cout << "TraceCollector_WaitForServerReadiness: "
- << "CORBA::SystemException: "
- << "Unable to contact the Naming Service" << endl;
- }
+ {
+ try
+ {
+ if(!CORBA::is_nil(orb))
+ theObj = orb->resolve_initial_references("NameService");
+ if (!CORBA::is_nil(theObj))
+ inc = CosNaming::NamingContext::_narrow(theObj);
+ }
+ catch( CORBA::SystemException& )
+ {
+ cout << "TraceCollector_WaitForServerReadiness: "
+ << "CORBA::SystemException: "
+ << "Unable to contact the Naming Service" << endl;
+ }
catch(...)
- {
- cout << "TraceCollector_WaitForServerReadiness: "
- << "Unknown exception dealing with Naming Service" << endl;
- }
-
- obj=CORBA::Object::_nil();
- if(!CORBA::is_nil(inc))
- {
- try
- {
- obj = inc->resolve(name);
- if (!CORBA::is_nil(obj))
- {
- //cout << "TraceCollector_WaitForServerReadiness: "
- // << serverName << " found in CORBA Name Service" << endl;
- break;
- }
- }
- catch (const CosNaming::NamingContext::NotFound&)
- {
- cout << "Caught exception: Naming Service can't found Logger";
- }
- }
+ {
+ cout << "TraceCollector_WaitForServerReadiness: "
+ << "Unknown exception dealing with Naming Service" << endl;
+ }
+
+ obj=CORBA::Object::_nil();
+ if(!CORBA::is_nil(inc))
+ {
+ try
+ {
+ obj = inc->resolve(name);
+ if (!CORBA::is_nil(obj))
+ {
+ //cout << "TraceCollector_WaitForServerReadiness: "
+ // << serverName << " found in CORBA Name Service" << endl;
+ break;
+ }
+ }
+ catch (const CosNaming::NamingContext::NotFound&)
+ {
+ cout << "Caught exception: Naming Service can't found Logger";
+ }
+ }
#ifndef WIN32
- nanosleep(&ts_req,&ts_rem);
+ nanosleep(&ts_req,&ts_rem);
#else
- Sleep(TIMESleep / 1000000);
+ Sleep(TIMESleep / 1000000);
#endif
- cout << "TraceCollector_WaitForServerReadiness: retry look for"
- << serverName << endl;
- }
+ cout << "TraceCollector_WaitForServerReadiness: retry look for"
+ << serverName << endl;
+ }
}
catch (const CosNaming::NamingContext::NotFound&)
{
#include <string>
CORBA::Object_ptr TraceCollector_WaitForServerReadiness(CORBA::ORB_ptr theOrb,
- std::string serverName);
+ std::string serverName);
#endif
// purpose : Removes files listed in theFileList
//============================================================================
void SALOMEDS_Tool::RemoveTemporaryFiles(const std::string& theDirectory,
- const SALOMEDS::ListOfFileNames& theFiles,
- const bool IsDirDeleted)
+ const SALOMEDS::ListOfFileNames& theFiles,
+ const bool IsDirDeleted)
{
string aDirName = theDirectory;
{
SALOMEDS::TMPFile*
PutFilesToStream(const std::string& theFromDirectory,
- const SALOMEDS::ListOfFileNames& theFiles,
- const SALOMEDS::ListOfFileNames& theFileNames,
- const int theNamesOnly)
+ const SALOMEDS::ListOfFileNames& theFiles,
+ const SALOMEDS::ListOfFileNames& theFileNames,
+ const int theNamesOnly)
{
int i, aLength = theFiles.length();
if(aLength == 0)
//Check if the file exists
if (!theNamesOnly) { // mpv 15.01.2003: if only file names must be stroed, then size of files is zero
- string aFullPath = aTmpDir + const_cast<char*>(theFiles[i].in());
- if(!Exists(aFullPath)) continue;
+ string aFullPath = aTmpDir + const_cast<char*>(theFiles[i].in());
+ if(!Exists(aFullPath)) continue;
#ifdef WIN32
- ifstream aFile(aFullPath.c_str(), ios::binary);
+ ifstream aFile(aFullPath.c_str(), ios::binary);
#else
- ifstream aFile(aFullPath.c_str());
+ ifstream aFile(aFullPath.c_str());
#endif
- aFile.seekg(0, ios::end);
- aFileSize[i] = aFile.tellg();
- aBufferSize += aFileSize[i]; //Add a space to store the file
+ aFile.seekg(0, ios::end);
+ aFileSize[i] = aFile.tellg();
+ aBufferSize += aFileSize[i]; //Add a space to store the file
}
aFileNameSize[i] = strlen(theFileNames[i])+1;
aBufferSize += aFileNameSize[i]; //Add a space to store the file name
for(i=0; i<aLength; i++) {
ifstream *aFile;
if (!theNamesOnly) { // mpv 15.01.2003: we don't open any file if theNamesOnly = true
- string aFullPath = aTmpDir + const_cast<char*>(theFiles[i].in());
- if(!Exists(aFullPath)) continue;
+ string aFullPath = aTmpDir + const_cast<char*>(theFiles[i].in());
+ if(!Exists(aFullPath)) continue;
#ifdef WIN32
- aFile = new ifstream(aFullPath.c_str(), ios::binary);
+ aFile = new ifstream(aFullPath.c_str(), ios::binary);
#else
- aFile = new ifstream(aFullPath.c_str());
+ aFile = new ifstream(aFullPath.c_str());
#endif
}
//Initialize 4 bytes of the buffer by 0
aCurrentPos += aFileNameSize[i];
if (!theNamesOnly) { // mpv 15.01.2003: we don't copy file content to the buffer if !theNamesOnly
- //Initialize 8 bytes of the buffer by 0
- memset((aBuffer + aCurrentPos), 0, 8);
- //Copy the length of the file to the buffer
- memcpy((aBuffer + aCurrentPos), (aFileSize + i), ((sizeof(long) > 8) ? 8 : sizeof(long)));
- aCurrentPos += 8;
-
- aFile->seekg(0, ios::beg);
- aFile->read((char *)(aBuffer + aCurrentPos), aFileSize[i]);
- aFile->close();
- delete(aFile);
- aCurrentPos += aFileSize[i];
+ //Initialize 8 bytes of the buffer by 0
+ memset((aBuffer + aCurrentPos), 0, 8);
+ //Copy the length of the file to the buffer
+ memcpy((aBuffer + aCurrentPos), (aFileSize + i), ((sizeof(long) > 8) ? 8 : sizeof(long)));
+ aCurrentPos += 8;
+
+ aFile->seekg(0, ios::beg);
+ aFile->read((char *)(aBuffer + aCurrentPos), aFileSize[i]);
+ aFile->close();
+ delete(aFile);
+ aCurrentPos += aFileSize[i];
}
}
SALOMEDS::TMPFile*
SALOMEDS_Tool::PutFilesToStream(const std::string& theFromDirectory,
- const SALOMEDS::ListOfFileNames& theFiles,
- const int theNamesOnly)
+ const SALOMEDS::ListOfFileNames& theFiles,
+ const int theNamesOnly)
{
SALOMEDS::ListOfFileNames aFileNames(theFiles);
return ::PutFilesToStream(theFromDirectory,theFiles,aFileNames,theNamesOnly);
SALOMEDS::TMPFile*
SALOMEDS_Tool::PutFilesToStream(const SALOMEDS::ListOfFileNames& theFiles,
- const SALOMEDS::ListOfFileNames& theFileNames)
+ const SALOMEDS::ListOfFileNames& theFileNames)
{
return ::PutFilesToStream("",theFiles,theFileNames,0);
}
//============================================================================
SALOMEDS::ListOfFileNames_var
SALOMEDS_Tool::PutStreamToFiles(const SALOMEDS::TMPFile& theStream,
- const std::string& theToDirectory,
- const int theNamesOnly)
+ const std::string& theToDirectory,
+ const int theNamesOnly)
{
SALOMEDS::ListOfFileNames_var aFiles = new SALOMEDS::ListOfFileNames;
// Removes files which are in <theDirectory>, the files for deletion are listed in <theFiles>
// if <IsDirDeleted> is true <theDirectory> is also deleted if it is empty
static void RemoveTemporaryFiles(const std::string& theDirectory,
- const SALOMEDS::ListOfFileNames& theFiles,
- const bool IsDirDeleted);
+ const SALOMEDS::ListOfFileNames& theFiles,
+ const bool IsDirDeleted);
// Converts files listed in <theFiles> which are in <theFromDirectory> into a byte sequence TMPFile
static SALOMEDS::TMPFile* PutFilesToStream(const std::string& theFromDirectory,
- const SALOMEDS::ListOfFileNames& theFiles,
- const int theNamesOnly = 0);
+ const SALOMEDS::ListOfFileNames& theFiles,
+ const int theNamesOnly = 0);
// Converts files listed in <theFiles> which will be named as pointed in the <theFileNames> into a byte sequence TMPFile
static SALOMEDS::TMPFile* PutFilesToStream(const SALOMEDS::ListOfFileNames& theFiles,
- const SALOMEDS::ListOfFileNames& theFileNames);
+ const SALOMEDS::ListOfFileNames& theFileNames);
// Converts a byte sequence <theStream> to files and places them in <theToDirectory>
static SALOMEDS::ListOfFileNames_var PutStreamToFiles(const SALOMEDS::TMPFile& theStream,
- const std::string& theToDirectory,
- const int theNamesOnly = 0);
+ const std::string& theToDirectory,
+ const int theNamesOnly = 0);
// Returns the name by the path
// for an example: if thePath = "/tmp/aaa/doc1.hdf" the function returns "doc1"
using namespace std;
Engines_TestComponent_i::Engines_TestComponent_i(CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName) :
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId * contId,
+ const char *instanceName,
+ const char *interfaceName) :
Engines_Component_i(orb, poa, contId, instanceName, interfaceName)
{
MESSAGE("activate object");
{
std::string cle((*it).first);
if ((*it).second.type()->kind() == CORBA::tk_string)
- {
- const char* value;
- (*it).second >>= value;
- //CCRT porting : setenv not defined in stdlib.h
- std::string s(cle);
- s+='=';
- s+=value;
- //char* cast because 1st arg of linux putenv function is not a const char* !!!
- putenv((char *)s.c_str());
- //End of CCRT porting
- //int ret = setenv(cle.c_str(), value, overwrite);
- MESSAGE("--- setenv: "<<cle<<" = "<< value);
- }
+ {
+ const char* value;
+ (*it).second >>= value;
+ //CCRT porting : setenv not defined in stdlib.h
+ std::string s(cle);
+ s+='=';
+ s+=value;
+ //char* cast because 1st arg of linux putenv function is not a const char* !!!
+ putenv((char *)s.c_str());
+ //End of CCRT porting
+ //int ret = setenv(cle.c_str(), value, overwrite);
+ MESSAGE("--- setenv: "<<cle<<" = "<< value);
+ }
}
MESSAGE("read environment associated with keys in map _fieldsDict");
for (it = _fieldsDict.begin(); it != _fieldsDict.end(); it++)
std::string cle((*it).first);
char* valenv= getenv(cle.c_str());
if (valenv)
- MESSAGE("--- getenv: "<<cle<<" = "<< valenv);
+ MESSAGE("--- getenv: "<<cle<<" = "<< valenv);
}
}
extern "C"
{
PortableServer::ObjectId * SalomeTestComponentEngine_factory(
- CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName)
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId * contId,
+ const char *instanceName,
+ const char *interfaceName)
{
MESSAGE("PortableServer::ObjectId * TestComponent_factory()");
SCRUTE(interfaceName);
public:
Engines_TestComponent_i();
Engines_TestComponent_i(CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName);
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId * contId,
+ const char *instanceName,
+ const char *interfaceName);
virtual ~Engines_TestComponent_i();
}
Engines::TestComponent_ptr create_instance(Engines::Container_ptr iGenFact,
- std::string componenttName)
+ std::string componenttName)
{
#if defined(_DEBUG_) || defined(_DEBUG)
bool isLib =
CORBA::Object_var obj =
// iGenFact->create_component_instance("SalomeTestComponent",
iGenFact->create_component_instance(componenttName.c_str(),
- 0);
+ 0);
Engines::TestComponent_var anInstance = Engines::TestComponent::_narrow(obj);
MESSAGE("create anInstance");
SCRUTE(anInstance->instanceName());
MESSAGE("------------------------------- create instances ");
for (int iter = 0; iter < nbInstances ; iter++)
- {
- instances[iter] = create_instance(iGenFact,"SalomeTestComponent");
- }
+ {
+ instances[iter] = create_instance(iGenFact,"SalomeTestComponent");
+ }
MESSAGE("------------------------------ set env instances ");
for (int iter = 0; iter < nbInstances ; iter++)
- {
- Engines::TestComponent_var anInstance = instances[iter];
- SCRUTE(anInstance->instanceName());
- Engines::FieldsDict_var dico = new Engines::FieldsDict;
- dico->length(3);
- dico[0].key=CORBA::string_dup("key_0");
- dico[0].value <<="value_0";
- dico[1].key=CORBA::string_dup("key_1");
- dico[1].value <<=(CORBA::UShort)72;
- dico[2].key=CORBA::string_dup("key_2");
- dico[2].value <<=(CORBA::ULong)iter;
- anInstance->setProperties(dico);
- MESSAGE("Coucou " << anInstance->Coucou(iter));
- anInstance->Setenv();
- }
+ {
+ Engines::TestComponent_var anInstance = instances[iter];
+ SCRUTE(anInstance->instanceName());
+ Engines::FieldsDict_var dico = new Engines::FieldsDict;
+ dico->length(3);
+ dico[0].key=CORBA::string_dup("key_0");
+ dico[0].value <<="value_0";
+ dico[1].key=CORBA::string_dup("key_1");
+ dico[1].value <<=(CORBA::UShort)72;
+ dico[2].key=CORBA::string_dup("key_2");
+ dico[2].value <<=(CORBA::ULong)iter;
+ anInstance->setProperties(dico);
+ MESSAGE("Coucou " << anInstance->Coucou(iter));
+ anInstance->Setenv();
+ }
MESSAGE("---------------------------------- get instances ");
for (int iter = 0; iter < nbInstances ; iter++)
- {
- Engines::TestComponent_var anInstance = instances[iter];
- SCRUTE(anInstance->instanceName());
- Engines::FieldsDict_var dico2 = anInstance->getProperties();
- for (CORBA::ULong i=0; i<dico2->length(); i++)
- {
- MESSAGE("dico2["<<i<<"].key="<<dico2[i].key);
- MESSAGE("dico2["<<i<<"].value type ="<<dico2[i].value.type()->kind());
- if (dico2[i].value.type()->kind() == CORBA::tk_string)
- {
- const char* value;
- dico2[i].value >>= value;
- MESSAGE("dico2["<<i<<"].value="<<value);
- }
- }
- }
+ {
+ Engines::TestComponent_var anInstance = instances[iter];
+ SCRUTE(anInstance->instanceName());
+ Engines::FieldsDict_var dico2 = anInstance->getProperties();
+ for (CORBA::ULong i=0; i<dico2->length(); i++)
+ {
+ MESSAGE("dico2["<<i<<"].key="<<dico2[i].key);
+ MESSAGE("dico2["<<i<<"].value type ="<<dico2[i].value.type()->kind());
+ if (dico2[i].value.type()->kind() == CORBA::tk_string)
+ {
+ const char* value;
+ dico2[i].value >>= value;
+ MESSAGE("dico2["<<i<<"].value="<<value);
+ }
+ }
+ }
MESSAGE("------------------------------- remove instances ");
for (int iter = 0; iter < nbInstances ; iter++)
- {
- Engines::TestComponent_var anInstance = instances[iter];
- SCRUTE(anInstance->instanceName());
- iGenFact->remove_impl(anInstance) ;
- //iGenFact->finalize_removal() ; // unpredictable results ...
- }
+ {
+ Engines::TestComponent_var anInstance = instances[iter];
+ SCRUTE(anInstance->instanceName());
+ iGenFact->remove_impl(anInstance) ;
+ //iGenFact->finalize_removal() ; // unpredictable results ...
+ }
MESSAGE("------------------------------- PYTHON ");
{
-// bool isLib =
-// iGenFact->load_component_Library("SALOME_TestComponentPy");
-// ASSERT(isLib);
-// CORBA::Object_var obj =
-// iGenFact->create_component_instance("SALOME_TestComponentPy",
-// 0);
-// Engines::TestComponent_var anInstance =
-// Engines::TestComponent::_narrow(obj);
-// MESSAGE("create anInstance");
-// SCRUTE(anInstance->instanceName());
+// bool isLib =
+// iGenFact->load_component_Library("SALOME_TestComponentPy");
+// ASSERT(isLib);
+// CORBA::Object_var obj =
+// iGenFact->create_component_instance("SALOME_TestComponentPy",
+// 0);
+// Engines::TestComponent_var anInstance =
+// Engines::TestComponent::_narrow(obj);
+// MESSAGE("create anInstance");
+// SCRUTE(anInstance->instanceName());
MESSAGE("------------------------------- create instances ");
for (int iter = 0; iter < nbInstances ; iter++)
- {
- instances[iter] = create_instance(iGenFact,"SALOME_TestComponentPy");
- }
+ {
+ instances[iter] = create_instance(iGenFact,"SALOME_TestComponentPy");
+ }
MESSAGE("---------------------------------- get instances ");
for (int iter = 0; iter < nbInstances ; iter++)
- {
- Engines::TestComponent_var anInstance = instances[iter];
- SCRUTE(anInstance->instanceName());
- MESSAGE("Coucou " << anInstance->Coucou(iter));
- }
+ {
+ Engines::TestComponent_var anInstance = instances[iter];
+ SCRUTE(anInstance->instanceName());
+ MESSAGE("Coucou " << anInstance->Coucou(iter));
+ }
}
// Clean-up.
using namespace std;
TestMPIComponentEngine::TestMPIComponentEngine(int nbproc, int numproc,
- CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName,
- bool regist) :
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId * contId,
+ const char *instanceName,
+ const char *interfaceName,
+ bool regist) :
Engines_Component_i(orb, poa, contId, instanceName, interfaceName,true,regist), MPIObject_i(nbproc,numproc)
{
MESSAGE("activate object")
extern "C"
{
PortableServer::ObjectId * TestMPIComponentEngine_factory(
- int nbproc, int numproc,
- CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName)
+ int nbproc, int numproc,
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId * contId,
+ const char *instanceName,
+ const char *interfaceName)
{
bool regist;
TestMPIComponentEngine * myTestMPIComponent;
public:
TestMPIComponentEngine();
TestMPIComponentEngine(int nbproc, int numproc,
- CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName,
- bool regist);
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId * contId,
+ const char *instanceName,
+ const char *interfaceName,
+ bool regist);
virtual ~TestMPIComponentEngine();
MESSAGE(cmd);
status = system(cmd.c_str());
if (status == -1) {
- INFOS("TestMPIContainer launch MPI Container failed (system command status -1)") ;
+ INFOS("TestMPIContainer launch MPI Container failed (system command status -1)") ;
}
else if (status == 217) {
- INFOS("TestMPIContainer launch MPI Container failed (system command status 217)") ;
+ INFOS("TestMPIContainer launch MPI Container failed (system command status 217)") ;
}
// Try to resolve MPI Container
int it = 0;
do{
- sleep(1);
- obj = NS.Resolve(containerName.c_str()) ;
- iGenFact = Engines::MPIContainer::_narrow(obj);
- MESSAGE("Waiting for MPI Container " << containerName << " : it = " << it );
+ sleep(1);
+ obj = NS.Resolve(containerName.c_str()) ;
+ iGenFact = Engines::MPIContainer::_narrow(obj);
+ MESSAGE("Waiting for MPI Container " << containerName << " : it = " << it );
}while( CORBA::is_nil(iGenFact) && (it++<15) );
}
}
else{
m1->Coucou(1L);
-// // sleep(5);
+// // sleep(5);
INFOS("Unload MPI Component");
iGenFact->remove_impl(m1) ;
}
switch (r)
{
case 0:
- break;
+ break;
default:
#ifdef EINVAL
case EINVAL:
case ENAMETOOLONG:
#endif
delete [] s;
- continue;
+ continue;
}
}
class UTILS_EXPORT CommException : public SALOME_Exception
{
public :
- CommException( void );
- CommException( const char *texte );
- CommException( const CommException &ex );
- ~CommException() throw ();
+ CommException( void );
+ CommException( const char *texte );
+ CommException( const CommException &ex );
+ ~CommException() throw ();
} ;
-# endif /* # if ( !defined __Utils_CommException_H__ ) */
+# endif /* # if ( !defined __Utils_CommException_H__ ) */
class ATEXIT_
{
public :
- /*!
- * Allocation dynamique de Destructeurs, une liste chainee de DESTRUCTEUR_GENERIQUE_* et enregistrement
- * de la fonction Nettoyage() par atexit().
- *
- * La liste chainee Destructeurs est detruite dans la fonction Nettoyage.
- */
+ /*!
+ * Allocation dynamique de Destructeurs, une liste chainee de DESTRUCTEUR_GENERIQUE_* et enregistrement
+ * de la fonction Nettoyage() par atexit().
+ *
+ * La liste chainee Destructeurs est detruite dans la fonction Nettoyage.
+ */
//CCRT ATEXIT_( void )
ATEXIT_( bool Make_ATEXIT )
- {
- //CCRT
- if ( Make_ATEXIT && !ATEXIT_Done ) {
- //CCRT
- assert (DESTRUCTEUR_GENERIQUE_::Destructeurs==0);
- //cerr << "ATEXIT_::ATEXIT_ Construction ATEXIT" << endl;// message necessaire pour utiliser logger dans Nettoyage (cf.BUG KERNEL4561)
- DESTRUCTEUR_GENERIQUE_::Destructeurs =
+ {
+ //CCRT
+ if ( Make_ATEXIT && !ATEXIT_Done ) {
+ //CCRT
+ assert (DESTRUCTEUR_GENERIQUE_::Destructeurs==0);
+ //cerr << "ATEXIT_::ATEXIT_ Construction ATEXIT" << endl;// message necessaire pour utiliser logger dans Nettoyage (cf.BUG KERNEL4561)
+ DESTRUCTEUR_GENERIQUE_::Destructeurs =
new std::list<DESTRUCTEUR_GENERIQUE_*> ; // Destructeur alloue dynamiquement (cf. ci-dessous) ,
- // il est utilise puis detruit par la fonction Nettoyage
+ // il est utilise puis detruit par la fonction Nettoyage
//To be sure the trace singleton will be the last one to be destroyed initialize it here before calling atexit
LocalTraceBufferPool::instance();
- int cr = atexit( Nettoyage ); // execute Nettoyage lors de exit, aprs la destruction des donnees statiques !
- assert(cr==0) ;
- ATEXIT_Done = true ;
- }
- }
-
- ~ATEXIT_( )
- {
- //cerr << "ATEXIT_::~ATEXIT_ Destruction ATEXIT" << endl;
- }
+ int cr = atexit( Nettoyage ); // execute Nettoyage lors de exit, aprs la destruction des donnees statiques !
+ assert(cr==0) ;
+ ATEXIT_Done = true ;
+ }
+ }
+
+ ~ATEXIT_( )
+ {
+ //cerr << "ATEXIT_::~ATEXIT_ Destruction ATEXIT" << endl;
+ }
};
-static ATEXIT_ nettoyage = ATEXIT_( false ); /* singleton statique */
+static ATEXIT_ nettoyage = ATEXIT_( false ); /* singleton statique */
/*!
{
//cerr << "Nettoyage()" << endl;
//if(MYDEBUG) BEGIN_OF("Nettoyage( void )") ;
- assert(DESTRUCTEUR_GENERIQUE_::Destructeurs) ;
- //if(MYDEBUG) SCRUTE( DESTRUCTEUR_GENERIQUE_::Destructeurs->size() ) ;
- if( DESTRUCTEUR_GENERIQUE_::Destructeurs->size() )
- {
- std::list<DESTRUCTEUR_GENERIQUE_*>::iterator it = DESTRUCTEUR_GENERIQUE_::Destructeurs->end() ;
-
- do
- {
- //if(MYDEBUG) MESSAGE( "DESTRUCTION d'un SINGLETON");
- it-- ;
- DESTRUCTEUR_GENERIQUE_* ptr = *it ;
- //DESTRUCTEUR_GENERIQUE_::Destructeurs->remove( *it ) ;
- (*ptr)() ;
- delete ptr ;
- }while( it!= DESTRUCTEUR_GENERIQUE_::Destructeurs->begin() ) ;
-
- DESTRUCTEUR_GENERIQUE_::Destructeurs->clear() ;
- //if(MYDEBUG) SCRUTE( DESTRUCTEUR_GENERIQUE_::Destructeurs->size() ) ;
- assert( DESTRUCTEUR_GENERIQUE_::Destructeurs->size()==0 ) ;
- assert( DESTRUCTEUR_GENERIQUE_::Destructeurs->empty() ) ;
- }
-
- delete DESTRUCTEUR_GENERIQUE_::Destructeurs;
- DESTRUCTEUR_GENERIQUE_::Destructeurs=0;
- //if(MYDEBUG) END_OF("Nettoyage( void )") ;
- return ;
+ assert(DESTRUCTEUR_GENERIQUE_::Destructeurs) ;
+ //if(MYDEBUG) SCRUTE( DESTRUCTEUR_GENERIQUE_::Destructeurs->size() ) ;
+ if( DESTRUCTEUR_GENERIQUE_::Destructeurs->size() )
+ {
+ std::list<DESTRUCTEUR_GENERIQUE_*>::iterator it = DESTRUCTEUR_GENERIQUE_::Destructeurs->end() ;
+
+ do
+ {
+ //if(MYDEBUG) MESSAGE( "DESTRUCTION d'un SINGLETON");
+ it-- ;
+ DESTRUCTEUR_GENERIQUE_* ptr = *it ;
+ //DESTRUCTEUR_GENERIQUE_::Destructeurs->remove( *it ) ;
+ (*ptr)() ;
+ delete ptr ;
+ }while( it!= DESTRUCTEUR_GENERIQUE_::Destructeurs->begin() ) ;
+
+ DESTRUCTEUR_GENERIQUE_::Destructeurs->clear() ;
+ //if(MYDEBUG) SCRUTE( DESTRUCTEUR_GENERIQUE_::Destructeurs->size() ) ;
+ assert( DESTRUCTEUR_GENERIQUE_::Destructeurs->size()==0 ) ;
+ assert( DESTRUCTEUR_GENERIQUE_::Destructeurs->empty() ) ;
+ }
+
+ delete DESTRUCTEUR_GENERIQUE_::Destructeurs;
+ DESTRUCTEUR_GENERIQUE_::Destructeurs=0;
+ //if(MYDEBUG) END_OF("Nettoyage( void )") ;
+ return ;
}
*/
const int DESTRUCTEUR_GENERIQUE_::Ajout( DESTRUCTEUR_GENERIQUE_ &objet )
{
- // N.B. : l'ordre de creation des SINGLETON etant important
- // on n'utilise pas deux fois la meme position pour
- // les stocker dans la pile des objets.
+ // N.B. : l'ordre de creation des SINGLETON etant important
+ // on n'utilise pas deux fois la meme position pour
+ // les stocker dans la pile des objets.
//CCRT
if ( !ATEXIT_Done ) {
nettoyage = ATEXIT_( true ) ;
- }
- //CCRT
- assert(Destructeurs) ;
- Destructeurs->push_back( &objet ) ;
- return Destructeurs->size() ;
+ }
+ //CCRT
+ assert(Destructeurs) ;
+ Destructeurs->push_back( &objet ) ;
+ return Destructeurs->size() ;
}
* <B>Usage</B>
*
* The only way to use the DESTRUCTEUR_GENERIQUE_ class is inheritance :
- * class DESTRUCTEUR_SPECIFIQUE_ : public DESTRUCTEUR_GENERIQUE_
+ * class DESTRUCTEUR_SPECIFIQUE_ : public DESTRUCTEUR_GENERIQUE_
*
* <B>Design description</B>
*
- * A generic destructor supply two functionalities :
- * -# a static method to add a destruction (objetct) to be performed DESTRUCTEUR_GENERIQUE_::Ajout(
- * DESTRUCTEUR_GENERIQUE_ &objet) ;
- * The Destruction object is stored in a list of pointer to DESTRUCTEUR_GENERIQUE_ objects.
- * -# an object method to execute the destruction : operator()().
+ * A generic destructor supply two functionalities :
+ * -# a static method to add a destruction (objetct) to be performed DESTRUCTEUR_GENERIQUE_::Ajout(
+ * DESTRUCTEUR_GENERIQUE_ &objet) ;
+ * The Destruction object is stored in a list of pointer to DESTRUCTEUR_GENERIQUE_ objects.
+ * -# an object method to execute the destruction : operator()().
*/
class UTILS_EXPORT DESTRUCTEUR_GENERIQUE_
*
* <B>Usage</B>
*
- * In this example the POINT_ ptrPoint will be destroyed at the end of the process (atexit).
+ * In this example the POINT_ ptrPoint will be destroyed at the end of the process (atexit).
*
* POINT_ *ptrPoint = new POINT_ ;<BR>
- * DESTRUCTEUR_DE_<POINT_> *ptrDestruction = new DESTRUCTEUR_DE_<POINT_>( *ptrPoint ) ;
+ * DESTRUCTEUR_DE_<POINT_> *ptrDestruction = new DESTRUCTEUR_DE_<POINT_>( *ptrPoint ) ;
*
- * Note that neither ptrPoint, nor ptrDestruction should be destroyed by the user.
+ * Note that neither ptrPoint, nor ptrDestruction should be destroyed by the user.
*
* <B>Design description</B>
*
- * The destruction object must be created dynamicaly because it suscribes himself in the list of
- * destruction to be performed at the end of the process.
+ * The destruction object must be created dynamicaly because it suscribes himself in the list of
+ * destruction to be performed at the end of the process.
*
*/
template <class TYPE> class DESTRUCTEUR_DE_ : public DESTRUCTEUR_GENERIQUE_
// std::cerr << "WARNING: automatic destruction for servant is no more used. It's too late in exit. Use explicit call" << std::endl;
/*
if(TServant* aServant = dynamic_cast<TServant*>(_PtrObjet)){
- PortableServer::POA_var aPOA = aServant->_default_POA();
- PortableServer::ObjectId_var anObjectId = aPOA->servant_to_id(aServant);
- aPOA->deactivate_object(anObjectId.in());
- aServant->_remove_ref();
+ PortableServer::POA_var aPOA = aServant->_default_POA();
+ PortableServer::ObjectId_var anObjectId = aPOA->servant_to_id(aServant);
+ aPOA->deactivate_object(anObjectId.in());
+ aServant->_remove_ref();
*/
}else{
- //cerr << "DESTRUCTEUR_GENERIQUE_::operator() deleting _PtrObjet" << endl;
- TYPE* aPtr = static_cast<TYPE*>(_PtrObjet);
- delete aPtr;
+ //cerr << "DESTRUCTEUR_GENERIQUE_::operator() deleting _PtrObjet" << endl;
+ TYPE* aPtr = static_cast<TYPE*>(_PtrObjet);
+ delete aPtr;
}
_PtrObjet = NULL ;
}
};
-# endif /* # if !defined( __DESTRUCTEUR_GENERIQUE__H__ ) */
+# endif /* # if !defined( __DESTRUCTEUR_GENERIQUE__H__ ) */
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: Utils_ExceptHandler.cxx
-// Created: Mon Mar 15 10:23:41 2004
-// Author: Oksana TCHEBANOVA
-// <ota@localhost.localdomain>
+// File: Utils_ExceptHandler.cxx
+// Created: Mon Mar 15 10:23:41 2004
+// Author: Oksana TCHEBANOVA
+// <ota@localhost.localdomain>
//
#include "Utils_ExceptHandlers.hxx"
#include "Utils_CorbaException.hxx"
const struct utsname get_uname( void )
{
- struct utsname hostid;
+ struct utsname hostid;
#if defined(_DEBUG_) || defined(_DEBUG)
- const int retour=uname(&hostid);
- ASSERT(retour>=0);
+ const int retour=uname(&hostid);
+ ASSERT(retour>=0);
#else
- uname(&hostid);
+ uname(&hostid);
#endif
- return hostid ;
+ return hostid ;
}
const char* get_adip( void )
{
- struct utsname hostid;
+ struct utsname hostid;
#if defined(_DEBUG_) || defined(_DEBUG)
- const int retour=uname(&hostid);
- ASSERT(retour>=0);
+ const int retour=uname(&hostid);
+ ASSERT(retour>=0);
#else
- uname(&hostid);
+ uname(&hostid);
#endif
- const hostent* pour_adip=gethostbyname(hostid.nodename);
- ASSERT(pour_adip!=NULL);
- const in_addr ip_addr=*(struct in_addr*)(pour_adip->h_addr) ;
- return duplicate(inet_ntoa(ip_addr));
+ const hostent* pour_adip=gethostbyname(hostid.nodename);
+ ASSERT(pour_adip!=NULL);
+ const in_addr ip_addr=*(struct in_addr*)(pour_adip->h_addr) ;
+ return duplicate(inet_ntoa(ip_addr));
}
const char* const get_pwname( void )
{
- struct passwd *papa = getpwuid(getuid());
- return papa->pw_name ;
+ struct passwd *papa = getpwuid(getuid());
+ return papa->pw_name ;
}
#else /* Windows functionality */
const char* get_uname( void )
{
- static std::string hostName(256, 0);
- static DWORD nSize = hostName.length();
- static int res = ::GetComputerNameEx(ComputerNameDnsFullyQualified, &hostName[0], &nSize);
- ASSERT( res );
- return hostName.c_str();
+ static std::string hostName(256, 0);
+ static DWORD nSize = hostName.length();
+ static int res = ::GetComputerNameEx(ComputerNameDnsFullyQualified, &hostName[0], &nSize);
+ ASSERT( res );
+ return hostName.c_str();
}
const char* get_adip( void )
{
- //#include <Nspapi.h>
- //#include <Svcguid.h>
- //static GUID sType = SVCID_HOSTNAME;
- //static CSADDR_INFO* ips = new CSADDR_INFO[8]; // in case multiple IP addresses are returned
- //static DWORD nSize = 1024;
- //static std::string uname = get_uname();
- //static int res = ::GetAddressByName( NS_DEFAULT, &sType, &uname[0], 0, 0, 0, ips, &nSize, 0, 0 );
- //if ( res )
- // return ips[0].LocalAddr.lpSockaddr->sa_data;
-
- static hostent* he = ::gethostbyname( get_uname() );
- if ( he && he->h_addr_list && he->h_length >0 ) {
- static char str[16];
+ //#include <Nspapi.h>
+ //#include <Svcguid.h>
+ //static GUID sType = SVCID_HOSTNAME;
+ //static CSADDR_INFO* ips = new CSADDR_INFO[8]; // in case multiple IP addresses are returned
+ //static DWORD nSize = 1024;
+ //static std::string uname = get_uname();
+ //static int res = ::GetAddressByName( NS_DEFAULT, &sType, &uname[0], 0, 0, 0, ips, &nSize, 0, 0 );
+ //if ( res )
+ // return ips[0].LocalAddr.lpSockaddr->sa_data;
+
+ static hostent* he = ::gethostbyname( get_uname() );
+ if ( he && he->h_addr_list && he->h_length >0 ) {
+ static char str[16];
unsigned i1 = (unsigned char)he->h_addr_list[0][0];
unsigned i2 = (unsigned char)he->h_addr_list[0][1];
unsigned i3 = (unsigned char)he->h_addr_list[0][2];
unsigned i4 = (unsigned char)he->h_addr_list[0][3];
sprintf ( str, "%03u.%03u.%03u.%03u", i1, i2, i3, i4 );
- return str;
- }
- return "<unknown>";
+ return str;
+ }
+ return "<unknown>";
}
const char* const get_pwname( void )
}
PSID getuid() {
- PSID retVal = NULL;
- HANDLE hProcessToken = INVALID_HANDLE_VALUE;
- PTOKEN_OWNER pTKowner = NULL;
- LPVOID buffer = NULL;
- DWORD dwsize = 0;
-
- if ( !OpenProcessToken ( GetCurrentProcess (), TOKEN_QUERY, &hProcessToken )) return 0;
- if (!GetTokenInformation(hProcessToken, TokenOwner, buffer, dwsize, &dwsize)) return 0;
- pTKowner = (PTOKEN_OWNER)buffer;
- if ( pTKowner != NULL ) {
- retVal = pTKowner->Owner;
- }
- if ( hProcessToken != INVALID_HANDLE_VALUE ) CloseHandle ( hProcessToken );
-
- return retVal;
+ PSID retVal = NULL;
+ HANDLE hProcessToken = INVALID_HANDLE_VALUE;
+ PTOKEN_OWNER pTKowner = NULL;
+ LPVOID buffer = NULL;
+ DWORD dwsize = 0;
+
+ if ( !OpenProcessToken ( GetCurrentProcess (), TOKEN_QUERY, &hProcessToken )) return 0;
+ if (!GetTokenInformation(hProcessToken, TokenOwner, buffer, dwsize, &dwsize)) return 0;
+ pTKowner = (PTOKEN_OWNER)buffer;
+ if ( pTKowner != NULL ) {
+ retVal = pTKowner->Owner;
+ }
+ if ( hProcessToken != INVALID_HANDLE_VALUE ) CloseHandle ( hProcessToken );
+
+ return retVal;
}
#define getcwd _getcwd
#endif /* WIN32 */
-Identity::Identity( const char *name ): _name(duplicate(name)),\
- _hostid(get_uname()),\
- _adip(get_adip()),\
- _uid(getuid()) ,\
- _pwname(get_pwname()) ,\
- _dir(getcwd(NULL,256)),\
- _pid(getpid()) ,\
- _start(time(NULL)),\
- _cstart(ctime(&_start))
+Identity::Identity( const char *name ): _name(duplicate(name)),\
+ _hostid(get_uname()),\
+ _adip(get_adip()),\
+ _uid(getuid()) ,\
+ _pwname(get_pwname()) ,\
+ _dir(getcwd(NULL,256)),\
+ _pid(getpid()) ,\
+ _start(time(NULL)),\
+ _cstart(ctime(&_start))
//CCRT
{
- ASSERT(strlen(_dir)<256);
+ ASSERT(strlen(_dir)<256);
}
Identity::~Identity(void)
{
- delete [] (char*)_name ;
- (char*&)_name = NULL ;
+ delete [] (char*)_name ;
+ (char*&)_name = NULL ;
- //delete [] (char*)_dir ;
- //(char*&)_dir = NULL ;
- free((char*)_dir);
-#ifndef WIN32
+ //delete [] (char*)_dir ;
+ //(char*&)_dir = NULL ;
+ free((char*)_dir);
+#ifndef WIN32
// free the memory only on Unix
// becasue at Windows it is the same static variable
// (function get_adip() returns the same char* as get_uname() )
- delete [] (char*)_adip ;
+ delete [] (char*)_adip ;
#endif
- (char*&)_adip = NULL ;
+ (char*&)_adip = NULL ;
}
const char* const Identity::name (void) const
{
- return _name ;
+ return _name ;
}
#ifndef WIN32
- const pid_t& Identity::pid(void) const
+ const pid_t& Identity::pid(void) const
#else
- const DWORD& Identity::pid(void) const
+ const DWORD& Identity::pid(void) const
#endif
{
- return _pid ;
+ return _pid ;
}
#ifndef WIN32
}
#ifndef WIN32
- const uid_t& Identity::uid(void) const
+ const uid_t& Identity::uid(void) const
#else
- const PSID& Identity::uid(void) const
+ const PSID& Identity::uid(void) const
#endif
{
- return _uid ;
+ return _uid ;
}
const time_t &Identity::start(void) const
{
- return _start ;
+ return _start ;
}
const char* const Identity::rep (void) const
{
- return _dir ;
+ return _dir ;
}
const char* const Identity::pwname (void) const
{
- return _pwname ;
+ return _pwname ;
}
const char* const Identity::adip (void) const
{
- return _adip ;
+ return _adip ;
}
/*------------------*/
#ifndef WIN32
return _hostid.nodename;
#else
- return _hostid;
+ return _hostid;
#endif
}
const char* Identity::start_char(void) const
{
- return ctime(&_start) ;
+ return ctime(&_start) ;
}
std::ostream & operator<< ( std::ostream& os , const Identity& monid )
{
- ASSERT(monid._name!=NULL) ;
+ ASSERT(monid._name!=NULL) ;
os << "Identity :" << std::endl ;
- os << '\t' << "Component name : " << monid._name << std::endl ;
- os << '\t' << "Numero de PID : " << monid._pid << std::endl;
- os << '\t' << "Uid utilisateur : " << monid._uid << std::endl;
- os << '\t' << "nom utilisateur : " << monid._pwname << std::endl;
+ os << '\t' << "Component name : " << monid._name << std::endl ;
+ os << '\t' << "Numero de PID : " << monid._pid << std::endl;
+ os << '\t' << "Uid utilisateur : " << monid._uid << std::endl;
+ os << '\t' << "nom utilisateur : " << monid._pwname << std::endl;
#ifndef WIN32
- os << '\t' << "Nom de machine : " << monid._hostid.nodename << std::endl;
+ os << '\t' << "Nom de machine : " << monid._hostid.nodename << std::endl;
#else
- os << '\t' << "Nom de machine : " << monid._hostid << std::endl;
+ os << '\t' << "Nom de machine : " << monid._hostid << std::endl;
#endif
- os << '\t' << "Adresse IP : " << monid._adip << std::endl;
- os << '\t' << "Heure de lancement : " << monid._cstart ; //ctime(&monid._start) ;
- os << '\t' << "Dans le repertoire : " << monid._dir << std::endl;
+ os << '\t' << "Adresse IP : " << monid._adip << std::endl;
+ os << '\t' << "Heure de lancement : " << monid._cstart ; //ctime(&monid._start) ;
+ os << '\t' << "Dans le repertoire : " << monid._dir << std::endl;
- return os ;
+ return os ;
}
{
protected :
- const char* const _name ;
- const char* const _adip; // Internet address
+ const char* const _name ;
+ const char* const _adip; // Internet address
#ifndef WIN32
const struct utsname _hostid;
- const pid_t _pid ;
- const uid_t _uid ;
+ const pid_t _pid ;
+ const uid_t _uid ;
#else
- const char* const _hostid;
- const DWORD _pid ;
- const PSID _uid ;
-#endif
- const char* const _pwname ;
- const char* const _dir ;
- const time_t _start;
- const char* const _cstart ;
+ const char* const _hostid;
+ const DWORD _pid ;
+ const PSID _uid ;
+#endif
+ const char* const _pwname ;
+ const char* const _dir ;
+ const time_t _start;
+ const char* const _cstart ;
private :
- Identity( void );
- Identity( const Identity &monid );
+ Identity( void );
+ Identity( const Identity &monid );
public :
- Identity(const char *name);
- ~Identity();
- friend std::ostream & operator<< ( std::ostream& os , const Identity& monid );
+ Identity(const char *name);
+ ~Identity();
+ friend std::ostream & operator<< ( std::ostream& os , const Identity& monid );
#ifndef WIN32
- const pid_t& pid(void) const;
- const struct utsname& hostid(void) const;
- const uid_t& uid(void) const;
+ const pid_t& pid(void) const;
+ const struct utsname& hostid(void) const;
+ const uid_t& uid(void) const;
#else
- const DWORD& pid(void) const;
+ const DWORD& pid(void) const;
const char* const hostid(void) const;
- const PSID& uid(void) const;
+ const PSID& uid(void) const;
#endif
- const char* const name( void ) const;
- const char* const adip(void) const;
- const char* const pwname(void) const;
- const time_t& start(void) const;
- const char* const rep (void) const;
+ const char* const name( void ) const;
+ const char* const adip(void) const;
+ const char* const pwname(void) const;
+ const time_t& start(void) const;
+ const char* const rep (void) const;
- const char* host_char(void ) const;
- const char* start_char(void) const;
+ const char* host_char(void ) const;
+ const char* start_char(void) const;
} ;
-# endif /* # if !defined( __IDENTITE_H__ ) */
+# endif /* # if !defined( __IDENTITE_H__ ) */
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SALOME Utils : general SALOME's definitions and tools
-// File: Utils_Mutex.cxx
-// Author: Sergey ANIKIN
+// File: Utils_Mutex.cxx
+// Author: Sergey ANIKIN
// Module : SALOME
// $Header$
//
#endif
if ( myCount && (--myCount) < 1 ) {
myCount = 0;
- pthread_mutex_unlock( &myMutex );
+ pthread_mutex_unlock( &myMutex );
}
}
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SALOME Utils : general SALOME's definitions and tools
-// File: Utils_Mutex.hxx
-// Author: Sergey ANIKIN
+// File: Utils_Mutex.hxx
+// Author: Sergey ANIKIN
// Module : SALOME
// $Header$
//
try {
if ( CORBA::is_nil( _orb ) )
{
- try
- {
+ try
+ {
#if OMNIORB_VERSION >= 4
- _orb = CORBA::ORB_init( argc, argv, "omniORB4" ) ;
+ _orb = CORBA::ORB_init( argc, argv, "omniORB4" ) ;
#else
- _orb = CORBA::ORB_init( argc, argv, "omniORB3" ) ;
+ _orb = CORBA::ORB_init( argc, argv, "omniORB3" ) ;
#endif
- }
- catch( const CORBA::Exception &ex )
- {
- throw CommException( "Unable to create an ORB connexion" ) ;
- }
+ }
+ catch( const CORBA::Exception &ex )
+ {
+ throw CommException( "Unable to create an ORB connexion" ) ;
+ }
}
return _orb ;
} catch ( CommException& e) {throw e;}
{
private :
- CORBA::ORB_var _orb ;
+ CORBA::ORB_var _orb ;
public :
- ORB_INIT( void );
- virtual ~ORB_INIT();
- CORBA::ORB_var & operator() ( int argc , char **argv ) throw( CommException ) ;
+ ORB_INIT( void );
+ virtual ~ORB_INIT();
+ CORBA::ORB_var & operator() ( int argc , char **argv ) throw( CommException ) ;
- inline CORBA::ORB_var &orb( void );
+ inline CORBA::ORB_var &orb( void );
} ;
inline CORBA::ORB_var &ORB_INIT::orb( void )
{
- return _orb ;
+ return _orb ;
}
# endif
SALOME_Exception::SALOME_Exception( void ): exception() , _text(0)
{
- MESSAGE( "You must use the standard builder: SALOME_Exception::SALOME_Exception( const char *text )" ) ;
- INTERRUPTION(1) ;
+ MESSAGE( "You must use the standard builder: SALOME_Exception::SALOME_Exception( const char *text )" ) ;
+ INTERRUPTION(1) ;
}
const char *makeText( const char *text, const char *fileName, const unsigned int lineNumber )
{
- char *newText = 0 ;
-
- ASSERT(text) ;
- const size_t l1 = 1+strlen(text) ;
- ASSERT(l1>1) ;
-
- const char* prefix = "Salome Exception" ;
- const size_t l0 = 2+strlen(prefix) ;
-
- if ( fileName )
- {
- const size_t l2 = 4+strlen(fileName) ;
- ASSERT(l2>4) ;
-
- ASSERT(lineNumber>=1) ;
- const size_t l3 = 4+int(log10(float(lineNumber))) ;
-
- newText = new char [ 1+l0+l1+l2+l3 ] ;
- sprintf( newText , "%s in %s [%u] : %s" , prefix, fileName, lineNumber, text ) ;
- }
- else
- {
- newText = new char [ 1+l0+l1 ] ;
- sprintf( newText , "%s : %s" , prefix, text ) ;
- }
- ASSERT(newText) ;
- return newText ;
+ char *newText = 0 ;
+
+ ASSERT(text) ;
+ const size_t l1 = 1+strlen(text) ;
+ ASSERT(l1>1) ;
+
+ const char* prefix = "Salome Exception" ;
+ const size_t l0 = 2+strlen(prefix) ;
+
+ if ( fileName )
+ {
+ const size_t l2 = 4+strlen(fileName) ;
+ ASSERT(l2>4) ;
+
+ ASSERT(lineNumber>=1) ;
+ const size_t l3 = 4+int(log10(float(lineNumber))) ;
+
+ newText = new char [ 1+l0+l1+l2+l3 ] ;
+ sprintf( newText , "%s in %s [%u] : %s" , prefix, fileName, lineNumber, text ) ;
+ }
+ else
+ {
+ newText = new char [ 1+l0+l1 ] ;
+ sprintf( newText , "%s : %s" , prefix, text ) ;
+ }
+ ASSERT(newText) ;
+ return newText ;
}
SALOME_Exception::~SALOME_Exception() throw ()
{
- if ( _text )
- {
- delete [] ((char*)_text);
- char** pRef = (char**)&_text;
- *pRef = 0;
- }
- ASSERT(_text==NULL) ;
+ if ( _text )
+ {
+ delete [] ((char*)_text);
+ char** pRef = (char**)&_text;
+ *pRef = 0;
+ }
+ ASSERT(_text==NULL) ;
}
SALOME_Exception::SALOME_Exception( const SALOME_Exception &ex ): _text(duplicate(ex._text))
{
- ;
+ ;
}
std::ostream & operator<<( std::ostream &os , const SALOME_Exception &ex )
{
- os << ex._text ;
- return os ;
+ os << ex._text ;
+ return os ;
}
const char* SALOME_Exception::what( void ) const throw ()
{
- return _text ;
+ return _text ;
}
{
private :
- SALOME_Exception( void );
+ SALOME_Exception( void );
protected :
- const char* _text ; // non constant pointer but read only char variable
+ const char* _text ; // non constant pointer but read only char variable
public :
- SALOME_Exception( const char *text, const char *fileName=0, const unsigned int lineNumber=0 );
- SALOME_Exception( const SALOME_Exception &ex );
- virtual ~SALOME_Exception() throw ();
- friend std::ostream & operator<<( std::ostream &os , const SALOME_Exception &ex );
- virtual const char *what( void ) const throw () ;
+ SALOME_Exception( const char *text, const char *fileName=0, const unsigned int lineNumber=0 );
+ SALOME_Exception( const SALOME_Exception &ex );
+ virtual ~SALOME_Exception() throw ();
+ friend std::ostream & operator<<( std::ostream &os , const SALOME_Exception &ex );
+ virtual const char *what( void ) const throw () ;
} ;
-#endif /* #if !defined( __Utils_SALOME_Exception_hxx__ ) */
+#endif /* #if !defined( __Utils_SALOME_Exception_hxx__ ) */
* To create a single instance a POINT_ object :
*
* # include "Utils_SINGLETON.hxx"
- * ...
- * ptrPoint = SINGLETON_<POINT_>::Instance() ;
+ * ...
+ * ptrPoint = SINGLETON_<POINT_>::Instance() ;
*
*
* <B>Design description</B>
*
- * -# the user creates an object of class TYPE By using a class method : SINGLETON_<TYPE>::Instance() which
- * returns a pointer to the single object ;
- * -# this class method uses the default constructor to create an object ;
- * -# at the same time, this class method reate a destructor object which is added to the generic list
- * of destructors objects to be executed at the end of the application (atexit) ;
- * -# at the end of the application process all the deletions are performed by the Nettoyage() C function
- * which execute the destructions objects then deletes the destructions objects themselves ;
- * -# the Nettoyage() C function is recorded using atexit() C function through the creation of a static
- * single object ATEXIT_().
+ * -# the user creates an object of class TYPE By using a class method : SINGLETON_<TYPE>::Instance() which
+ * returns a pointer to the single object ;
+ * -# this class method uses the default constructor to create an object ;
+ * -# at the same time, this class method reate a destructor object which is added to the generic list
+ * of destructors objects to be executed at the end of the application (atexit) ;
+ * -# at the end of the application process all the deletions are performed by the Nettoyage() C function
+ * which execute the destructions objects then deletes the destructions objects themselves ;
+ * -# the Nettoyage() C function is recorded using atexit() C function through the creation of a static
+ * single object ATEXIT_().
*/
public :
- static TYPE *Instance( void ); //!< Singleton dynamic creation using the default builder
- static bool IsAlreadyExisting( void ); //!< returns True if the singleton is already existing
- static int Destruction( void ); //!< destroys the Singleton before the end of the application process
+ static TYPE *Instance( void ); //!< Singleton dynamic creation using the default builder
+ static bool IsAlreadyExisting( void ); //!< returns True if the singleton is already existing
+ static int Destruction( void ); //!< destroys the Singleton before the end of the application process
private :
- TYPE _Instance ;
- static SINGLETON_ *PtrSingleton ;
+ TYPE _Instance ;
+ static SINGLETON_ *PtrSingleton ;
- SINGLETON_( void );
- ~SINGLETON_();
+ SINGLETON_( void );
+ ~SINGLETON_();
-} ; /* class SINGLETON_<TYPE> */
+} ; /* class SINGLETON_<TYPE> */
*/
template <class TYPE> TYPE *SINGLETON_<TYPE>::Instance( void )
{
- if ( ! PtrSingleton )
- {
- //MESSAGE("SINGLETON_<TYPE>::Instance( void )") ;
- PtrSingleton = new SINGLETON_<TYPE> ;
- new DESTRUCTEUR_DE_<TYPE>( PtrSingleton->_Instance ) ;
- }
- return &PtrSingleton->_Instance ;
+ if ( ! PtrSingleton )
+ {
+ //MESSAGE("SINGLETON_<TYPE>::Instance( void )") ;
+ PtrSingleton = new SINGLETON_<TYPE> ;
+ new DESTRUCTEUR_DE_<TYPE>( PtrSingleton->_Instance ) ;
+ }
+ return &PtrSingleton->_Instance ;
}
template <class TYPE> bool SINGLETON_<TYPE>::IsAlreadyExisting( void )
{
- return PtrSingleton ? true : false ;
+ return PtrSingleton ? true : false ;
}
template <class TYPE> SINGLETON_<TYPE>::SINGLETON_( void )
{
- //MESSAGE("CREATION d'un SINGLETON_") ;
+ //MESSAGE("CREATION d'un SINGLETON_") ;
}
/*!
- The method SINGLETON_<TYPE>::Destruction can be called by the user. If it is not
- the function nettoyage() calls it atexit.
+ The method SINGLETON_<TYPE>::Destruction can be called by the user. If it is not
+ the function nettoyage() calls it atexit.
- N.B. : the singleton objects are destroyed in the reverse order of there creation.
+ N.B. : the singleton objects are destroyed in the reverse order of there creation.
*/
template <class TYPE> int SINGLETON_<TYPE>::Destruction( void )
{
- int k = - 1 ;
- //BEGIN_OF("SINGLETON_<TYPE>::Destruction( void )") ;
- if ( PtrSingleton )
- {
- //MESSAGE("Destruction du SINGLETON_") ;
-
-
- std::list<DESTRUCTEUR_GENERIQUE_ *>::iterator k ;
- for( k=DESTRUCTEUR_GENERIQUE_::Destructeurs->begin() ; k!=DESTRUCTEUR_GENERIQUE_::Destructeurs->end();k++)
- {
- if ( *k == PtrSingleton->_Instance )
- {
- DESTRUCTEUR_GENERIQUE_::Destructeurs->erase( k ) ;
- break ;
- }
- }
- delete PtrSingleton ;
- PtrSingleton = NULL ;
- }
- //END_OF("SINGLETON_<TYPE>::Destruction( void )") ;
- return k ;
+ int k = - 1 ;
+ //BEGIN_OF("SINGLETON_<TYPE>::Destruction( void )") ;
+ if ( PtrSingleton )
+ {
+ //MESSAGE("Destruction du SINGLETON_") ;
+
+
+ std::list<DESTRUCTEUR_GENERIQUE_ *>::iterator k ;
+ for( k=DESTRUCTEUR_GENERIQUE_::Destructeurs->begin() ; k!=DESTRUCTEUR_GENERIQUE_::Destructeurs->end();k++)
+ {
+ if ( *k == PtrSingleton->_Instance )
+ {
+ DESTRUCTEUR_GENERIQUE_::Destructeurs->erase( k ) ;
+ break ;
+ }
+ }
+ delete PtrSingleton ;
+ PtrSingleton = NULL ;
+ }
+ //END_OF("SINGLETON_<TYPE>::Destruction( void )") ;
+ return k ;
}
//MESSAGE("passage dans SINGLETON_<TYPE>::~SINGLETON_( void )") ;
}
-# endif /* # if !defined( __SINGLETON__H__ ) */
+# endif /* # if !defined( __SINGLETON__H__ ) */
SYSTEMTIME st;
GetSystemTime(&st);
SystemTimeToFileTime(&st, RefToInitialTMS);
- time(RefToCurrentTimeB);
+ time(RefToCurrentTimeB);
#endif
}
}
GetSystemTime(&st);
SystemTimeToFileTime(&st, RefToCurrentTMS);
Cumul_user += (int)(((ULARGE_INTEGER*)(RefToCurrentTMS))->QuadPart - ((ULARGE_INTEGER*)(RefToInitialTMS))->QuadPart) / 10000000;
- Cumul_sys = Cumul_user;
- time(RefToCurrentTimeB);
+ Cumul_sys = Cumul_user;
+ time(RefToCurrentTimeB);
#endif
Stopped = 1;
}
// $Header$
//
/*!
- * This function can be changed by strdup() if strdup() is ANSI.
- * It is strongly (and only) used in the Registry environment
- * (RegistryService, RegistryConnexion, Identity, ...)
+ * This function can be changed by strdup() if strdup() is ANSI.
+ * It is strongly (and only) used in the Registry environment
+ * (RegistryService, RegistryConnexion, Identity, ...)
*/
extern "C"
{
const char* duplicate( const char *const str )
{
- ASSERT(str!=NULL) ;
- const size_t length = strlen( str ) ;
- ASSERT(length>0) ;
- char *new_str = new char[ 1+length ] ;
- ASSERT(new_str) ;
- strcpy( new_str , str ) ;
- return new_str ;
+ ASSERT(str!=NULL) ;
+ const size_t length = strlen( str ) ;
+ ASSERT(length>0) ;
+ char *new_str = new char[ 1+length ] ;
+ ASSERT(new_str) ;
+ strcpy( new_str , str ) ;
+ return new_str ;
}