blob: c1a47f4e299b903133221db8a440fd242ec22430 (
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
44
45
|
// $Id$
#include "Simple_Naming_i.h"
#include "orbsvcs/PSS/PSDL_Code_Gen.h"
Naming_Context_i::Naming_Context_i (CORBA::ORB_ptr orb)
: code_gen_ (0),
orb_ (orb)
{
// constructor
// An instance of TAO_PSDL_Code_Gen
ACE_NEW (this->code_gen_,
TAO_PSDL_Code_Gen (this->orb_.in ()));
}
Naming_Context_i::~Naming_Context_i ()
{
delete this->code_gen_;
}
int
Naming_Context_i::bind (const char *n,
const char *obj
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
// Save the binding to database.
int result =
this->code_gen_->set_name_obj_ref (n, obj ACE_ENV_ARG_PARAMETER);
return result;
}
char *
Naming_Context_i::find (const char *n
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
// Get the Stringified object reference corresponding to
// 'n'
CORBA::String_var obj_ref =
this->code_gen_->get_obj_ref (n ACE_ENV_ARG_PARAMETER);
return CORBA::string_dup (obj_ref.in ());
}
|