Bull DPX/20 Betriebsanweisung Seite 265

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 424
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 264
2-97
DSOM Framework Reference
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;
NVList arglist;
long rc;
long value1 = 100;
long value2 = 200;
Foo fooObj;
Request reqObj;
NamedValue result;
Identifier name;
TypeCode tc;
void *dummy;
long dummylen;
Flags flags;
/* Get the OperationDef from the Interface Repository. */
opdef = _lookup_id(SOM_InterfaceRepository,
&ev, ”Foo::methodLong”);
/* Create a NamedValue list for the operation. */
rc= _create_operation_list(SOMD_ORBObject, &ev, opdef, &arglist);
/* Insert arg1 info into arglist */
_get_item(arglist, &ev,
0, &name, &tc, &dummy, &dummylen, &flags);
_set_item(arglist,&ev,0, name, tc, &value1, sizeof(long), flags);
/* Insert arg2 info into arglist */
_get_item(arglist, &ev,
1, &name, &tc, &dummy, &dummylen, &flags);
_set_item(arglist,&ev,1, name, tc, &value2, sizeof(long), flags);
/* 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;
/* Finally, create the Request, reqObj */
rc = _create_request(fooObj, &ev, (Context *)NULL, ”methodLong”,
arglist, &result, &reqObj, (Flags)0);
Original Class
SOMDObject
Related Information
Methods: create_request_args, create_list, create_operation_list
Seitenansicht 264
1 2 ... 260 261 262 263 264 265 266 267 268 269 270 ... 423 424

Kommentare zu diesen Handbüchern

Keine Kommentare