Commit 5ff36030 authored by legoc's avatar legoc
Browse files

Instance::getOutputStreamSocket() now returns a unique_ptr<OutputStreamSocket>

parent 25333246
......@@ -6,6 +6,7 @@
* Implemented subscriber and requester with optional string result in receive() function.
* Implemented Instance::getResult() with optional string result.
* Implemented OutputStreamSocket::receive() with optional Output result.
* Instance::getOutputStreamSocket() now returns a unique_ptr<OutputStreamSocket>.
1.0.2
-----
......
......@@ -294,7 +294,7 @@ public:
std::optional<std::string> getBinaryResult();
std::optional<std::string> getResult();
std::shared_ptr<OutputStreamSocket> getOutputStreamSocket();
std::unique_ptr<OutputStreamSocket> getOutputStreamSocket();
private:
Instance(Server* server);
......@@ -307,7 +307,7 @@ private:
State waitFor(int states, const std::string& eventName, KeyValue& keyValue, StateHandlerType handler, bool blocking);
Server* m_server;
std::shared_ptr<OutputStreamSocket> m_outputStreamSocket;
std::unique_ptr<OutputStreamSocket> m_outputStreamSocket;
int m_id;
std::string m_errorMessage;
Com m_com;
......
......@@ -55,11 +55,11 @@ class OutputStreamSocket {
friend class Services;
friend class application::Instance;
void setApplicationId(int id);
public:
~OutputStreamSocket();
void setApplicationId(int id);
std::optional<Output> receive();
void cancel();
bool isEnded() const;
......
......@@ -763,8 +763,8 @@ std::optional<std::string> Instance::getResult() {
return getBinaryResult();
}
std::shared_ptr<OutputStreamSocket> Instance::getOutputStreamSocket() {
return m_outputStreamSocket;
std::unique_ptr<OutputStreamSocket> Instance::getOutputStreamSocket() {
return std::move(m_outputStreamSocket);
}
///////////////////////////////////////////////////////////////////////////////
......
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