2-71
DSOM Framework Reference
object_to_string Method
Purpose
Converts an object reference to an external form (string) which can be stored outside the
ORB.
IDL Syntax
string object_to_string (
in SOMDObject obj);
Description
The object_to_string method converts the object reference to a form (string) which can be
stored externally.
Ownership of allocated memory is transferred to the caller.
Parameters
receiver A pointer to the ORB object.
env A pointer to the Environment structure for the method caller.
obj A pointer to a SOMDObject object representing the reference to be
converted.
Return Value
The object_to_string method returns a string representing the external (string) form of the
referenced object.
Example
#include <somd.h>
#include <car.h>
Environment ev;
Car car;
string objrefstr;
SOM_InitEnvironment(&ev);
SOMD_Init(&ev);
/* create a remote Car object */
car = _somdNewObject(SOMD_ObjectMgr, &ev, “Car”, ””);
/* save the reference to the object */
objrefstr = _object_to_string(SOMD_ORBObject, &ev, car);
FileWrite(”/u/joe/mycar”, objrefstr);
Original Class
ORB
Related Information
Methods: string_to_object
Komentáře k této Příručce