Jump to content

SomDataResolve: Difference between revisions

From EDM2
No edit summary
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
{{DISPLAYTITLE:somDataResolve}}
{{DISPLAYTITLE:somDataResolve}}
This function accesses instance data within an object.  
This function accesses instance data within an object.


==Syntax==
==Syntax==
<PRE>
SOMObject    obj;
SOMObject    obj;
somDToken    dToken;
somDToken    dToken;
somToken    rc;
somToken    rc;
rc = somDataResolve(obj, dToken);


rc = somDataResolve(obj, dToken);
</PRE>
==Parameters==
==Parameters==
; obj (SOMObject) : A pointer to the object whose instance data is required.  
;obj (SOMObject) : A pointer to the object whose instance data is required.
 
; dToken (somDToken) : 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 below illustrates this.
; dToken (somDToken) : 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 below illustrates this.


==Return Code==
==Return Code==
; rc (somToken) : A somToken (that is, a pointer) that points to the data in obj identified by the dToken. If obj does not contain the requested data identified by dToken, somDataResolve generates a runtime error.
;rc (somToken): A somToken (that is, a pointer) that points to the data in obj identified by the dToken. If obj does not contain the requested data identified by dToken, somDataResolve generates a runtime error.
 


==Remarks==
==Remarks==
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.
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 GetData macro (which expands to a usage of somDataResolve).  
For C or C++ programmers with access to the C or C++ implementation bindings for a class, instance data can be accessed using the GetData macro (which expands to a usage of somDataResolve).


==Example Code==
==Example Code==
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".  
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".
<PRE>
<PRE>
#include <som.h>
#include <som.h>
Line 33: Line 29:


==Related==
==Related==
===Data Structures===
;Data Structures
*somToken (sombtype.h)
*somToken (sombtype.h)
* [[SOMObject]] (somobj.idl)
*[[SOMObject]] (somobj.idl)
*somDToken (somapi.h)
*somDToken (somapi.h)


[[Category:SOM Kernel]]
[[Category:SOM function]]

Latest revision as of 04:23, 6 May 2020

This function accesses instance data within an object.

Syntax

SOMObject    obj;
somDToken    dToken;
somToken     rc;

rc = somDataResolve(obj, dToken);

Parameters

obj (SOMObject)
A pointer to the object whose instance data is required.
dToken (somDToken)
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 below illustrates this.

Return Code

rc (somToken)
A somToken (that is, a pointer) that points to the data in obj identified by the dToken. If obj does not contain the requested data identified by dToken, somDataResolve generates a runtime error.

Remarks

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 GetData macro (which expands to a usage of somDataResolve).

Example Code

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

Data Structures
  • somToken (sombtype.h)
  • SOMObject (somobj.idl)
  • somDToken (somapi.h)