Overview | Converts a string (produced by CORBA::ORB::object_to_string) into an object reference. |
Original class | CORBA::ORB |
Exceptions | If the input string is not valid, or refers to a local object that is no longer valid (insofar as the ORB can determine), a CORBA::SystemException is thrown. |
Intended Usage
The ORB::string_to_object method is intended to be used by client or server applications to convert a string form of an object reference into an object. The string may be one of the Object URLs form or it may be a stringified object reference (IOR) generated by calling the CORBA::ORB::object_to_string method.
If the string is an IOR, then string_to_object behaves as follows:
Syntax
CORBA::Object_ptr string_to_object (const char* str);
Input parameters
Return values
Example
#include "corba.h" #include ... // Assume op initialized elsewhere // extern CORBA::ORB_ptr op; // // Let fstr be an object URL string of file type. The file should // contain another object reference, typically an IOR. // const char * fstr = "file://c:\objs\aUrl.txt"; CORBA::Object_ptr objPtr = op->string_to_object(fstr); ... // // Let ns be an object URL corbaloc string representing the Naming Service // const char * ns = "corbaloc:rir:/NameService"; CORBA::Object_ptr ns_objPtr = op->string_to_object(ns); ...
Also see the example in ORB::object_to_string.