summaryrefslogtreecommitdiff
path: root/src/RpcRequest.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-07-11 21:09:51 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-07-11 21:09:51 +0900
commit7c06b903f3493db95fcf4bd42cccc59e3b4d0692 (patch)
treef10a85795bb086e0b257a0e6c6c5ffb05f28f344 /src/RpcRequest.cc
parent7a57ecc5f814dc305e5e4b9bd960d69b43870c0e (diff)
Use std::unique_ptr for ValueBase object hierarchy
Diffstat (limited to 'src/RpcRequest.cc')
-rw-r--r--src/RpcRequest.cc34
1 files changed, 11 insertions, 23 deletions
diff --git a/src/RpcRequest.cc b/src/RpcRequest.cc
index 1ed1c1db..c9b531f7 100644
--- a/src/RpcRequest.cc
+++ b/src/RpcRequest.cc
@@ -39,35 +39,23 @@ namespace aria2 {
namespace rpc {
RpcRequest::RpcRequest()
- : jsonRpc(false)
+ : jsonRpc{false}
{}
-RpcRequest::RpcRequest(const std::string& methodName,
- const std::shared_ptr<List>& params)
- : methodName(methodName), params(params), jsonRpc(false)
+RpcRequest::RpcRequest(std::string methodName,
+ std::unique_ptr<List> params)
+ : methodName{std::move(methodName)}, params{std::move(params)},
+ jsonRpc{false}
{}
-RpcRequest::RpcRequest(const std::string& methodName,
- const std::shared_ptr<List>& params,
- const std::shared_ptr<ValueBase>& id)
- : methodName(methodName), params(params), id(id), jsonRpc(false)
+RpcRequest::RpcRequest(std::string methodName,
+ std::unique_ptr<List> params,
+ std::unique_ptr<ValueBase> id,
+ bool jsonRpc)
+ : methodName{std::move(methodName)}, params{std::move(params)},
+ id{std::move(id)}, jsonRpc{jsonRpc}
{}
-RpcRequest::RpcRequest(const RpcRequest& c)
- : methodName(c.methodName), params(c.params), id(c.id), jsonRpc(c.jsonRpc)
-{}
-
-RpcRequest::~RpcRequest() {}
-
-RpcRequest& RpcRequest::operator=(const RpcRequest& c)
-{
- if(this != &c) {
- methodName = c.methodName;
- params = c.params;
- }
- return *this;
-}
-
} // namespace rpc
} // namespace aria2