Salome HOME
NRI : Remove dependence with VISU.
[modules/kernel.git] / src / TestContainer / SALOME_TestComponent_i.cxx
1 using namespace std;
2 //=============================================================================
3 // File      : SALOME_TestComponent_i.cxx
4 // Created   : jeu jui 12 12:28:26 CEST 2001
5 // Author    : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
6 // Project   : SALOME
7 // Copyright : EDF 2001
8 // $Header$
9 //=============================================================================
10
11 #include "utilities.h"
12 #include "SALOME_TestComponent_i.hxx"
13 #include <stdio.h>
14
15 Engines_TestComponent_i::Engines_TestComponent_i(CORBA::ORB_ptr orb,
16                                                  PortableServer::POA_ptr poa,
17                                                  PortableServer::ObjectId * contId, 
18                                                  const char *instanceName, 
19                                                  const char *interfaceName) :
20   Engines_Component_i(orb, poa, contId, instanceName, interfaceName)
21 {
22   MESSAGE("activate object")
23   _thisObj = this ;
24   _id = _poa->activate_object(_thisObj);
25   //SCRUTE(this)
26 }
27
28 Engines_TestComponent_i::Engines_TestComponent_i()
29 {
30 }
31
32 Engines_TestComponent_i::~Engines_TestComponent_i()
33 {
34 }
35
36 char* Engines_TestComponent_i::Coucou(CORBA::Long L)
37 {
38   char s[100];
39   sprintf(s, "TestComponent_i : L = %ld", (long) L);
40
41   return CORBA::string_dup(s);
42 }
43
44 extern "C"
45 {
46   PortableServer::ObjectId * SalomeTestComponentEngine_factory(
47                                  CORBA::ORB_ptr orb,
48                                  PortableServer::POA_ptr poa, 
49                                  PortableServer::ObjectId * contId,
50                                  const char *instanceName, 
51                                  const char *interfaceName)
52   {
53     MESSAGE("PortableServer::ObjectId * TestComponent_factory()");
54     SCRUTE(interfaceName);
55     Engines_TestComponent_i * myTestComponent 
56       = new Engines_TestComponent_i(orb, poa, contId, instanceName, interfaceName);
57     return myTestComponent->getId() ;
58   }
59 }
60