blob: 93e443fc1f7a7b51227c9275986fcc68035639d8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#include "test_i.h"
test_i::
test_i(CORBA::ORB_ptr orb)
{
this->orb_ = CORBA::ORB::_duplicate (orb);
}
void test_i::
the_operation(CORBA::Long & x)
{
x = 42;
}
char *
test_i::
create_and_activate_server()
{
PortableServer::Servant_var<test_i> impl(
new test_i (this->orb_.in ()));
CORBA::Object_var poa_object =
this->orb_->resolve_initial_references("RootPOA");
PortableServer::POA_var root_poa =
PortableServer::POA::_narrow (poa_object.in ());
PortableServer::ObjectId_var id =
root_poa->activate_object (impl.in ());
CORBA::Object_var object = root_poa->id_to_reference (id.in ());
Test_var ref = Test::_narrow (object.in ());
return this->orb_->object_to_string(ref.in());
}
void
test_i::shutdown ()
{
if (!CORBA::is_nil (this->orb_.in ()))
this->orb_->shutdown (false);
}
|