Commit 2854efba authored by legoc's avatar legoc
Browse files

(split) Implemented Instance::getResult() with optional string result

parent ce1e1776
......@@ -4,6 +4,7 @@
* Removed Option enum and defined OUTPUSTREAM as const int.
* Added Instance::waitFor() and Instance::waitFor(int) for python binding.
* Implemented subscriber and requester with optional string result in receive() function.
* Implemented Instance::getResult() with optional string result.
1.0.2
-----
......
......@@ -291,8 +291,8 @@ public:
*/
int getExitCode() const;
bool getBinaryResult(std::string& result);
bool getResult(std::string& result);
std::optional<std::string> getBinaryResult();
std::optional<std::string> getResult();
std::shared_ptr<OutputStreamSocket> getOutputStreamSocket();
......
......@@ -748,21 +748,19 @@ int Instance::getExitCode() const {
return m_exitCode;
}
bool Instance::getBinaryResult(std::string& result) {
std::optional<std::string> Instance::getBinaryResult() {
waitFor();
result = m_resultData;
return m_hasResult;
}
bool Instance::getResult(std::string& result) {
if (m_hasResult) {
return m_resultData;
}
string bytes;
getBinaryResult(bytes);
parse(bytes, result);
return {};
}
return m_hasResult;
std::optional<std::string> Instance::getResult() {
return getBinaryResult();
}
std::shared_ptr<OutputStreamSocket> Instance::getOutputStreamSocket() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment