-// Copyright (C) 2007-2012 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
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// Create an instance of component
Engines::EngineComponent_ptr
Engines_MPIContainer_i::create_component_instance_env( const char* componentName,
- CORBA::Long studyId,
const Engines::FieldsDict& env,
CORBA::String_out reason)
{
st->ip = ip;
st->tior = _tior;
st->compoName = componentName;
- st->studyId = studyId;
pthread_create(&(th[ip]),NULL,th_createcomponentinstance,(void*)st);
}
}
- Engines::EngineComponent_ptr cptr = Lcreate_component_instance(componentName,studyId);
+ Engines::EngineComponent_ptr cptr = Lcreate_component_instance(componentName);
if(_numproc == 0){
for(int ip=1;ip<_nbproc;ip++)
}
Engines::EngineComponent_ptr
-Engines_MPIContainer_i::Lcreate_component_instance( const char* genericRegisterName, CORBA::Long studyId)
+Engines_MPIContainer_i::Lcreate_component_instance( const char* genericRegisterName )
{
- if (studyId < 0) {
- INFOS("studyId must be > 0 for mono study instance, =0 for multiStudy");
- return Engines::EngineComponent::_nil() ;
- }
-
Engines::EngineComponent_var iobject = Engines::EngineComponent::_nil() ;
Engines::MPIObject_var pobj;
(char*)"create_component_instance",
(char*)"ssl",
aCompName.c_str(),
- instanceName.c_str(),
- studyId);
+ instanceName.c_str());
const char *ior;
const char *error;
PyArg_ParseTuple(result,"ss", &ior, &error);
{
void* handle = _library_map[impl_name];
iobject = createMPIInstance(genericRegisterName,
- handle,
- studyId);
+ handle);
return iobject._retn();
}
Engines::EngineComponent_ptr
Engines_MPIContainer_i::createMPIInstance(std::string genericRegisterName,
- void *handle,
- int studyId)
+ void *handle)
{
Engines::EngineComponent_var iobject;
Engines::MPIObject_var pobj;
PortableServer::ObjectId *id ; //not owner, do not delete (nore use var)
id = (MPIComponent_factory) ( _orb, _poa, _id, instanceName.c_str(), aGenRegisterName.c_str() ) ;
- // --- get reference & servant from id
+ // --- get reference from id
CORBA::Object_var obj = _poa->id_to_reference(*id);
iobject = Engines::EngineComponent::_narrow( obj ) ;
pobj = Engines::MPIObject::_narrow(obj) ;
- Engines_Component_i *servant =
- dynamic_cast<Engines_Component_i*>(_poa->reference_to_servant(iobject));
- ASSERT(servant);
- //SCRUTE(servant->pd_refCount);
- servant->_remove_ref(); // compensate previous id_to_reference
- //SCRUTE(servant->pd_refCount);
_listInstances_map[instanceName] = iobject;
_cntInstances_map[aGenRegisterName] += 1;
- //SCRUTE(servant->pd_refCount);
-#ifndef _DEBUG_
- servant->setStudyId(studyId);
-#else
- bool ret_studyId = servant->setStudyId(studyId);
- ASSERT(ret_studyId);
-#endif
// --- register the engine under the name
// containerName(.dir)/instanceName(.object)
void *th_createcomponentinstance(void *s)
{
thread_st *st = (thread_st*)s;
- (Engines::MPIContainer::_narrow((*(st->tior))[st->ip]))->create_component_instance(st->compoName.c_str(),st->studyId);
+ (Engines::MPIContainer::_narrow((*(st->tior))[st->ip]))->create_component_instance(st->compoName.c_str());
return NULL;
}