2-99
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_request_args(fooObj, &ev,
”methodLong”, &arglist, &result);
/* 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);
/* Finally, create the Request, reqObj */
rc = _create_request(fooObj, &ev, (Context *)NULL, ”methodLong”,
arglist, &result, &reqObj, (Flags)0);
Original Class
SOMDObject
Related Information
Methods: duplicate, release, create_request, create_operation_list
Kommentare zu diesen Handbüchern