Salome HOME
Join modifications from branch BR_DEBUG_3_2_0b1
[samples/hello.git] / src / HELLO / HELLO.cxx
1 // Copyright (C) 2005  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 using namespace std;
20 #include "HELLO.hxx"
21 #include "utilities.h"
22
23 #include <string>
24
25
26 //=============================================================================
27 /*!
28  *  standard constructor
29  */
30 //=============================================================================
31
32 HELLO::HELLO(CORBA::ORB_ptr orb,
33         PortableServer::POA_ptr poa,
34         PortableServer::ObjectId * contId, 
35         const char *instanceName, 
36         const char *interfaceName) :
37   Engines_Component_i(orb, poa, contId, instanceName, interfaceName)
38 {
39   MESSAGE("activate object");
40   _thisObj = this ;
41   _id = _poa->activate_object(_thisObj);
42 }
43
44 HELLO::~HELLO()
45 {
46 }
47
48
49 char* HELLO::makeBanner(const char* name)
50 {
51     string banner="Hello, ";
52     banner+=name;
53     return CORBA::string_dup(banner.c_str());
54 }
55
56
57
58 extern "C"
59 {
60   PortableServer::ObjectId * HELLOEngine_factory(
61                                CORBA::ORB_ptr orb,
62                                PortableServer::POA_ptr poa, 
63                                PortableServer::ObjectId * contId,
64                                const char *instanceName, 
65                                const char *interfaceName)
66   {
67     MESSAGE("PortableServer::ObjectId * HELLOEngine_factory()");
68     SCRUTE(interfaceName);
69     HELLO * myHELLO 
70       = new HELLO(orb, poa, contId, instanceName, interfaceName);
71     return myHELLO->getId() ;
72   }
73 }