1-10 SOMobjects Base Toolkit: Programmer’s Reference Manual
somDataResolve Function
Purpose
Accesses instance data within an object.
Syntax
somToken somDataResolve (SOMObject obj, somDToken dToken);
Description
The somDataResolve function is used to access instance data within an object. This
function is of use primarily to class implementors (rather than class clients) who are not
using the SOM C or C++ language bindings.
For C or C++ programmers with access to the C or C++ implementation bindings for a class,
instance data can be accessed using the <className>GetData macro (which expands to a
usage of somDataResolve).
Parameters
obj A pointer to the object whose instance data is required.
dToken A data token for the required instance data. The SOM API specifies that the
data token for accessing the instance data introduced by a class is found in
the instanceDataToken component of the auxiliary class data structure for
that class. The example which follows illustrates this.
Return Value
A somToken (that is, a pointer) that points to the data in obj identified by the dToken.
C Example
The following C/C++ expression evaluates to the address of the instance data introduced by
class “XYZ” within the object “obj”. This assumes that “obj” points to an instance of “XYZ” or
a subclass of “XYZ”.
include <som.h>
somDataResolve(obj, XYZCClassData.instanceDataToken)
Related Information
Data Structures: somToken (somapi.h), SOMObject (somobj.idl),
somDToken (somapi.h)
Kommentare zu diesen Handbüchern