X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FContainer%2FComponent_i.cxx;h=4bf755f93f0b966b7571eaeb1c5373fe5cf1d30e;hb=910e1b8c12ac2978e64847e9694b080c8381bc60;hp=d45bd4ed81f7c65c928cb7184d67a319472bf34c;hpb=2b900d8a3cd172e349ea0750b4506b516edf179c;p=modules%2Fkernel.git diff --git a/src/Container/Component_i.cxx b/src/Container/Component_i.cxx index d45bd4ed8..4bf755f93 100644 --- a/src/Container/Component_i.cxx +++ b/src/Container/Component_i.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -51,7 +51,6 @@ int SIGUSR11 = 1000; extern bool _Sleeping ; static Engines_Component_i * theEngines_Component ; -bool Engines_Component_i::_isMultiStudy = true; bool Engines_Component_i::_isMultiInstance = false; /*! \class Engines_Component_i @@ -101,7 +100,6 @@ Engines_Component_i::Engines_Component_i(CORBA::ORB_ptr orb, _Executed(false) , _graphName("") , _nodeName(""), - _studyId(-1), _id(0), _contId(0), _CanceledThread(false) @@ -155,7 +153,6 @@ Engines_Component_i::Engines_Component_i(CORBA::ORB_ptr orb, _Executed(false) , _graphName("") , _nodeName(""), - _studyId(-1), _id(0), _contId(0), _CanceledThread(false) @@ -227,20 +224,6 @@ char* Engines_Component_i::interfaceName() return CORBA::string_dup(_interfaceName.c_str()) ; } -//============================================================================= -/*! - * CORBA method: Get study Id - * \return -1: not initialised (Internal Error) - * 0: multistudy component instance - * >0: study id associated to this instance - */ -//============================================================================= - -CORBA::Long Engines_Component_i::getStudyId() -{ - return _studyId; -} - //============================================================================= /*! * CORBA method: Test if instance is alive and responds @@ -606,31 +589,6 @@ Engines_Container_i *Engines_Component_i::GetContainerPtr() return dynamic_cast(_poa->id_to_servant(contId)) ; } -//============================================================================= -/*! - * C++ method: set study Id - * \param studyId 0 if instance is not associated to a study, - * >0 otherwise (== study id) - * \return true if the set of study Id is OK - * must be set once by Container, at instance creation, - * and cannot be changed after. - */ -//============================================================================= - -CORBA::Boolean Engines_Component_i::setStudyId(CORBA::Long studyId) -{ - ASSERT( studyId >= 0); - CORBA::Boolean ret = false; - if (_studyId < 0) // --- not yet initialized - { - _studyId = studyId; - ret = true; - } - else - if ( _studyId == studyId) ret = true; - return ret; -} - //============================================================================= /*! * C++ method: return CORBA instance id, the id is set in derived class @@ -893,14 +851,19 @@ void Engines_Component_i::sendMessage(const char *event_type, std::string Engines_Component_i::GetDynLibraryName(const char *componentName) { -#ifndef WIN32 - std::string ret="lib"; - ret+=componentName; - ret+="Engine.so"; + std::string prefix, suffix; + std::string cname = componentName; +#if !defined(WIN32) + prefix = "lib"; +#endif +#if defined(WIN32) + suffix = "dll"; +#elif defined(__APPLE__) + suffix = "dylib"; #else - std::string ret=componentName; - ret+="Engine.dll"; + suffix = "so"; #endif + std::string ret = prefix + cname + std::string("Engine.") + suffix; return ret; } @@ -910,12 +873,11 @@ std::string Engines_Component_i::GetDynLibraryName(const char *componentName) */ //============================================================================= -Engines::TMPFile* Engines_Component_i::DumpPython(CORBA::Object_ptr theStudy, - CORBA::Boolean isPublished, +Engines::TMPFile* Engines_Component_i::DumpPython(CORBA::Boolean isPublished, CORBA::Boolean isMultiFile, CORBA::Boolean& isValidScript) { - const char* aScript = isMultiFile ? "def RebuildData(theStudy): pass" : ""; + const char* aScript = isMultiFile ? "def RebuildData(): pass" : ""; char* aBuffer = new char[strlen(aScript)+1]; strcpy(aBuffer, aScript); CORBA::Octet* anOctetBuf = (CORBA::Octet*)aBuffer;