Skip to content

Commit

Permalink
fix: fix constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
nameoverflow committed Aug 30, 2018
1 parent 4a4a0cb commit b25f968
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion WeaselIPC/PipeChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ using namespace boost;
#define _ThrowCode(__c) throw __c
#define _ThrowIfNot(__c) { DWORD err; if ((err = ::GetLastError()) != __c) throw err; }

PipeChannelBase::PipeChannelBase(std::wstring &pn_cmd, size_t bs = 4 * 1024, SECURITY_ATTRIBUTES *s = NULL)
PipeChannelBase::PipeChannelBase(std::wstring &&pn_cmd, size_t bs = 4 * 1024, SECURITY_ATTRIBUTES *s = NULL)
: pname(pn_cmd),
write_stream(nullptr),
buff_size(bs),
Expand Down
6 changes: 3 additions & 3 deletions WeaselIPCServer/WeaselServerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace weasel {
using Respond = std::function<void(Msg)>;
using ServerHandler = std::function<void(PipeMessage, Respond)>;

PipeServer(std::wstring &pn_cmd, SECURITY_ATTRIBUTES *s);
PipeServer(std::wstring &&pn_cmd, SECURITY_ATTRIBUTES *s);

public:
void Listen(ServerHandler const &handler);
Expand Down Expand Up @@ -335,8 +335,8 @@ void ServerImpl::HandlePipeMessage(PipeMessage pipe_msg, _Resp resp)
resp(result);
}

PipeServer::PipeServer(std::wstring &pn_cmd, SECURITY_ATTRIBUTES *s)
: PipeChannel(pn_cmd, s)
PipeServer::PipeServer(std::wstring &&pn_cmd, SECURITY_ATTRIBUTES *s)
: PipeChannel(std::move(pn_cmd), s)
{}

void PipeServer::Listen(ServerHandler const &handler)
Expand Down
4 changes: 2 additions & 2 deletions include/PipeChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace weasel {
public:
using Stream = boost::interprocess::wbufferstream;

PipeChannelBase(std::wstring &pn_cmd, size_t bs, SECURITY_ATTRIBUTES *s);
PipeChannelBase(std::wstring &&pn_cmd, size_t bs, SECURITY_ATTRIBUTES *s);
PipeChannelBase(PipeChannelBase &&r);
~PipeChannelBase();

Expand Down Expand Up @@ -71,7 +71,7 @@ namespace weasel {

public:
PipeChannel(std::wstring &&pn_cmd, SECURITY_ATTRIBUTES *s = NULL, size_t bs = 4 * 1024)
: PipeChannelBase(pn_cmd, bs, s)
: PipeChannelBase(std::move(pn_cmd), bs, s)
{}

public:
Expand Down

0 comments on commit b25f968

Please sign in to comment.