[omniORB] Questions about Naming Service

Alexander Uwah uwah@uni-duisburg.de
Fri, 30 Apr 1999 17:50:43 +0200


Hello,
I=B4m quite new to CORBA/omniORB so I don=B4t know a lot of things.
I=B4m currently trying to write a function with which I can bind an Objec=
t to an
already existing tree. In the followin, I shall use a UNIX-Filesystem sty=
le to
denote the tree.
For example: "/text.kind1/Echo.kind2" should be the tree:
=09root
=09|
=09text.kind
=09|
=09Echo.kind=09(the object is bound to this context)

in which everything behind the dot "." is the kind component of the name.

Now my problem:
I would like to bind a object, say an object called Obj1 to a tree like s=
ay:
=09root
=09|
=09text.kind
=09|
=09shorttext.kind
=09|
=09Obj1.kind

Is it possible for me to do something like:
=09CosNaming::Name contextName;
=09CosNaming::NamingContext_var pathContext;

=09contextName.length(2);
=09contextName[0].id=3D"text";
=09contextName[0].kind=3D"kind";
=09contextName[1].id=3D"shorttext";
=09contextName[1].kind=3D"kind";

=09pathContext=3DrootContext->bind_new_context(contextName,  p_orb);

// and then eventually bind the object under the name Obj1.kind:

=09CosNaming::Name objectName;
=09objectName.length(1);

=09objectName[0].id=3D"Obj1";
=09objectName[0].kind=3D"kind";

=09pathContext->bind(objectName,   p_obj );

// ( where p_obj is a pointer to my Object with=20
//CORBA::Object_ptr p_obj; )

// without having to repeatedly create a new context Name for each contex=
t in
the path??