... | @@ -26,7 +26,7 @@ public class JavaApp { |
... | @@ -26,7 +26,7 @@ public class JavaApp { |
|
i++;
|
|
i++;
|
|
}
|
|
}
|
|
|
|
|
|
// Set the result.
|
|
// Set the string result.
|
|
This.setResult("This is a result");
|
|
This.setResult("This is a result");
|
|
|
|
|
|
This.terminate();
|
|
This.terminate();
|
... | @@ -34,7 +34,7 @@ public class JavaApp { |
... | @@ -34,7 +34,7 @@ public class JavaApp { |
|
}
|
|
}
|
|
```
|
|
```
|
|
|
|
|
|
In C++, we can get the result:
|
|
In C++, we can get the string result:
|
|
```cpp
|
|
```cpp
|
|
#include <cameo/api/cameo.h>
|
|
#include <cameo/api/cameo.h>
|
|
#include <iostream>
|
|
#include <iostream>
|
... | @@ -62,3 +62,13 @@ int main(int argc, char *argv[]) { |
... | @@ -62,3 +62,13 @@ int main(int argc, char *argv[]) { |
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
```
|
|
```
|
|
|
|
|
|
|
|
In Java and Python, you also have the *getResult()* method and function to retrieve the string result. If you need to set and get a binary result, use the related *setBinaryResult()* and *getBinaryResult()* methods and functions.
|
|
|
|
|
|
|
|
Use the return value can be very helpful to use an app as a function. However it is not recommended to use it in those cases:
|
|
|
|
* The execution of the app is very short.
|
|
|
|
* The data passed are big.
|
|
|
|
Indeed in that case it is better to setup a requester/responder communication to avoid too many creation and destruction of processes and to avoid a network overload.
|
|
|
|
|
|
|
|
|
|
|
|
|