|
|
The DynamicRequest class can be used to invoke requests on objects, without using IDL generated code to do so (i.e. you can talk to objects without having to know their interfaces at compile time)
Suppose you have the interface
interface SimpleSoundServer { [...] long play(string file); // plays a file and returns an id [...] };
And server is of type SimpleSoundServer, you can write in your C++ code:
long id; if(DynamicRequest(server).method("play").param("/tmp/bong.wav").invoke(id)) { cout << "playing file now, id is " << id << endl; } else { cout << "something went wrong with the dynamic request" << endl; }
You can of course also add parameters and other information one-by-one:
DynamicRequest request(server); request.method("play"); request.param("/tmp/bong.wav");
long id; if(request.invoke(id)) cout << "success" << endl;
|
creates a dynamic request which will be sent to a specific object
|
deletes the dynamic request
DynamicRequest& |
says that the following method will be a oneway method, for example
DynamicRequest(someobject).oneway().method("stop").invoke();
DynamicRequest& |
sets the method to invoke
DynamicRequest& |
adds a parameter to the call
bool |
executes the request, call this if you don't expect a return type
Returns: true if the request could be performed
bool |
executes the request: this version accepts an AnyRef& as result type
Returns: true if the request could be performed
Generated by: stefan@stefan on Sat Feb 24 19:11:23 2001, using kdoc 2.0a47. |