1 //=============================================================================
2 // File : TestMPIComponentEngine.cxx
3 // Created : mer jui 4 12:28:26 CEST 2003
4 // Author : Bernard SECHER, 2003
6 // Copyright : CEA 2003
8 //=============================================================================
10 #include "utilities.h"
11 #include "TestMPIComponentEngine.hxx"
14 TestMPIComponentEngine::TestMPIComponentEngine(int nbproc, int numproc,
16 PortableServer::POA_ptr poa,
17 PortableServer::ObjectId * contId,
18 const char *instanceName,
19 const char *interfaceName,
21 Engines_Component_i(orb, poa, contId, instanceName, interfaceName,true,regist), MPIObject_i(nbproc,numproc)
23 MESSAGE("activate object")
25 _id = _poa->activate_object(_thisObj);
28 TestMPIComponentEngine::TestMPIComponentEngine(): Engines_Component_i(), MPIObject_i()
32 TestMPIComponentEngine::~TestMPIComponentEngine()
36 void TestMPIComponentEngine::Coucou(CORBA::Long L)
38 BEGIN_OF("[" << _numproc << "] TestMPIComponentEngine::Coucou()");
40 for(int ip=1;ip<_nbproc;ip++)
41 Engines::TestMPIComponent::_narrow((*_tior)[ip])->SPCoucou(L);
42 MESSAGE("[" << _numproc << "] TestMPIComponentEngine : L = " << L);
43 END_OF("[" << _numproc << "] TestMPIComponentEngine::Coucou()");
46 void TestMPIComponentEngine::SPCoucou(CORBA::Long L)
48 BEGIN_OF("[" << _numproc << "] TestMPIComponentEngine::SPCoucou()");
49 MESSAGE("[" << _numproc << "] TestMPIComponentEngine : L = " << L);
50 END_OF("[" << _numproc << "] TestMPIComponentEngine::SPCoucou()");
55 PortableServer::ObjectId * TestMPIComponentEngine_factory(
56 int nbproc, int numproc,
58 PortableServer::POA_ptr poa,
59 PortableServer::ObjectId * contId,
60 const char *instanceName,
61 const char *interfaceName)
64 TestMPIComponentEngine * myTestMPIComponent;
65 MESSAGE("[" << numproc << "] PortableServer::ObjectId * TestMPIComponentEngine_factory()");
66 SCRUTE(interfaceName);
73 = new TestMPIComponentEngine(nbproc,numproc,orb, poa, contId, instanceName, interfaceName,regist);
74 return myTestMPIComponent->getId() ;