CORBA Programming Reference
Creates an object reference that encapsulates the specified ObjectId
and interface repository ID values.
CORBA::Object_ptr create_reference_with_id (
const ObjectId & oid,
const char * intf)
If the POA has a LifespanPolicy with value SYSTEM_ID and it detects that the ObjectId
value was not generated by the system or for this POA, the operation will raise the BAD_PARAM system exception.
The create_reference operation creates an object reference that encapsulates the specified ObjectId
and interface repository ID values. This operation collects the necessary information to constitute the reference from information associated with the POA and from parameters to the operation. This operation only creates a reference; it does not associate the reference with an active servant. The resulting reference may be passed to clients, so that subsequent requests on those references cause the invocation to be returned to the same POA with ObjectId
specified.
Note: This function is supported only for a joint client/server.
PortableServer::ObjectId_var oid =
PortableServer::string_to_ObjectId("myLittleFoo");
CORBA::Object_var obj = poa->create_reference_with_id(
oid.in(), "IDL:Foo:1.0");
Foo_var foo = Foo::_narrow(obj);