Bull DPX/20 Betriebsanweisung Seite 244

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 424
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 243
2-76
SOMobjects Base Toolkit: Programmers Reference Manual
Return Value
The add_arg method returns an ORBStatus value representing the return code of the
operation.
Example
#include <somd.h>
#include <repostry.h>
#include <intfacdf.h>
#include <foo.h> /* provided by user */
/* assume following method declaration in interface Foo:
* long methodLong (in long inLong,inout long inoutLong);
* then the following code builds a request to execute the call:
* result = methodLong(fooObj, &ev, 100,200);
*using the DII.
*/
Environment ev;
OperationDef opdef;
Description desc;
OperationDescription *opdesc;
long rc;
long value1 = 100;
long value2 = 200;
Foo fooObj;
Request reqObj;
NamedValue result;
/* Get the OperationDef from the Interface Repository. */
opdef = _lookup_id(SOM_InterfaceRepository,
&ev, ”Foo::methodLong”);
/* Get the operation description structure. */
desc = _describe(opdef, &ev);
opdesc = (OperationDescription *) desc.value._value;
/* Fill in the TypeCode field for result. */
result.argument._type = opdesc–>result;
/* Create the Request, reqObj */
rc = _create_request(fooObj, &ev, (Context *)NULL, ”methodLong”,
(NVList *)NULL, &result, &reqObj, (Flags)0);
/* Add arg1 info onto the request */
_add_arg(reqObj, &ev,
”inLong”, TC_long, &value1, sizeof(long), (Flags)0);
/* Add arg2 info onto the request */
_add_arg(reqObj, &ev,
”inoutLong”, TC_long, &value2, sizeof(long), (Flags)0);
Original Class
Request
Seitenansicht 243
1 2 ... 239 240 241 242 243 244 245 246 247 248 249 ... 423 424

Kommentare zu diesen Handbüchern

Keine Kommentare