Bull DPX/20 Podręcznik Użytkownika Strona 246

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 424
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 245
2-78
SOMobjects Base Toolkit: Programmers Reference Manual
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 sends a request to execute the call:
* result = methodLong(fooObj, &ev, 100,200);
* using the DII without waiting for the result. Then, later,
* waits for and then uses the result.
*/
Environment ev;
NVList arglist;
long rc;
Foo fooObj;
Request reqObj;
NamedValue result;
/* see the Example code for invoke to see how the request
* is built
*/
/* Create the Request, reqObj */
rc = _create_request(fooObj, &ev, (Context *)NULL, ”methodLong”,
arglist, &result, &reqObj, (Flags)0);
/* Finally, send the request */
rc = _send(reqObj, &ev, (Flags)0);
/* do some work, i.e. don’t wait for the result */
/* wait here for the result of the request */
rc = _get_response(reqObj, &ev, (Flags)0);
/* use the result */
if (result–>argument._value == 9600) {...}
/* throw away the reqObj */
_destroy(reqObj, &ev);
Original Class
Request
Related Information
Methods: invoke, send, get_response
Przeglądanie stron 245
1 2 ... 241 242 243 244 245 246 247 248 249 250 251 ... 423 424

Komentarze do niniejszej Instrukcji

Brak uwag