2-131
DSOM Framework Reference
change_id Method
Purpose
Changes the reference data associated with an object.
IDL Syntax
void change_id (
in SOMDObject objref,
in ReferenceData id );
Description
The change_id changes the ReferenceData associated with the object identified by objref.
The ReferenceData previously stored in the SOMOA’s reference data table is replaced with
the value of id. The new ID cannot be larger than the maximum size of the original
ReferenceData (usually specified as 1024 bytes).
Parameters
receiver A pointer to the SOMOA object managing the implementation.
env A pointer to the Environment structure for the method caller.
objref A pointer to the SOMDObject which identifies the object.
id A pointer to the ReferenceData structure representing the object to be
created.
Example
#include <somd.h>
#include <repostry.h>
#include <intfacdf.h>
Environment ev;
ReferenceData id;
InterfaceDef intfdef;
SOMDObject objref;
string fname; /* file name to be saved with reference */
...
/* create the id for the reference */
id._maximum = id._length = strlen(fname)+1;
id._buffer = (string) SOMMalloc(strlen(fname)+1);
strcpy(id._buffer,fname);
/* get the interface def object for interface Foo*/
intfdef = _lookup_id(SOM_InterfaceRepository, &ev, ”Foo”);
objref = _create_constant(SOMD_SOMOAObject,
&ev, id, intfdef, SOMD_ImplDefObject);
Commenti su questo manuale