Skip navigation.

CORBA Programming Reference

  Previous Next vertical dots separating previous/next from contents/index/pdf Contents View as PDF   Get Adobe Reader

 


PortableServer::POA::create_reference_with_id

Synopsis

Creates an object reference that encapsulates the specified ObjectId and interface repository ID values.

C++ Binding

CORBA::Object_ptr create_reference_with_id (
const ObjectId & oid,
const char * intf)

Arguments

oid

ObjectId that identifies the object on which that operation was invoked.

intf

The interface repository ID.

Exceptions

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.

Description

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.

Return Values

Returns Object_ptr.

Example

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);

 

Skip navigation bar  Back to Top Previous Next