13.1.19 PortableServer Functions
Objects registered with POAs use sequences of octet,
specifically the PortableServer::POA::ObjectId
type,
as object identifiers. However, because C++ programmers often want
to use strings as object identifiers, the C++ mapping provides
several conversion functions that convert strings to
ObjectId
and vice versa:
/ C++
namespace PortableServer
{
char* ObjectId_to_string(const ObjectId&);
ObjectId* string_to_ObjectId(const char*);
}
These functions follow the normal C++ mapping rules for parameter passing and memory management.
If conversion of an ObjectId
to a string would
result in illegal characters in the string (such as a NULL), the
first two functions throw the CORBA::BAD_PARAM
exception.
Parent topic: Mappings