]> SALOME platform Git repositories - samples/hello.git/blob - src/HELLO/HELLO.cxx
Salome HOME
premiere version
[samples/hello.git] / src / HELLO / HELLO.cxx
1 using namespace std;
2 #include "HELLO.hxx"
3 #include "utilities.h"
4
5 #include <string>
6
7
8 //=============================================================================
9 /*!
10  *  standard constructor
11  */
12 //=============================================================================
13
14 HELLO::HELLO(CORBA::ORB_ptr orb,
15         PortableServer::POA_ptr poa,
16         PortableServer::ObjectId * contId, 
17         const char *instanceName, 
18         const char *interfaceName) :
19   Engines_Component_i(orb, poa, contId, instanceName, interfaceName)
20 {
21   MESSAGE("activate object");
22   _thisObj = this ;
23   _id = _poa->activate_object(_thisObj);
24 }
25
26 HELLO::~HELLO()
27 {
28 }
29
30
31 char* HELLO::makeBanner(const char* name)
32 {
33     string banner="Hello, ";
34     banner+=name;
35     return CORBA::string_dup(banner.c_str());
36 }
37
38
39
40 extern "C"
41 {
42   PortableServer::ObjectId * HELLOEngine_factory(
43                                CORBA::ORB_ptr orb,
44                                PortableServer::POA_ptr poa, 
45                                PortableServer::ObjectId * contId,
46                                const char *instanceName, 
47                                const char *interfaceName)
48   {
49     MESSAGE("PortableServer::ObjectId * HELLOEngine_factory()");
50     SCRUTE(interfaceName);
51     HELLO * myHELLO 
52       = new HELLO(orb, poa, contId, instanceName, interfaceName);
53     return myHELLO->getId() ;
54   }
55 }