delete copy constructor and operator assign for most classes
This commit is contained in:
@@ -44,6 +44,9 @@ public:
|
|||||||
public:
|
public:
|
||||||
ClientPool() = default;
|
ClientPool() = default;
|
||||||
|
|
||||||
|
ClientPool(const ClientPool&) = delete;
|
||||||
|
ClientPool& operator=(const ClientPool&) = delete;
|
||||||
|
|
||||||
~ClientPool();
|
~ClientPool();
|
||||||
|
|
||||||
ClientPtr Get(const Key& key) const;
|
ClientPtr Get(const Key& key) const;
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ class ClientSession {
|
|||||||
public:
|
public:
|
||||||
explicit ClientSession(std::size_t buffer_size = 0);
|
explicit ClientSession(std::size_t buffer_size = 0);
|
||||||
|
|
||||||
|
ClientSession(const ClientSession&) = delete;
|
||||||
|
ClientSession& operator=(const ClientSession&) = delete;
|
||||||
|
|
||||||
~ClientSession();
|
~ClientSession();
|
||||||
|
|
||||||
// Start Asio loop in a thread.
|
// Start Asio loop in a thread.
|
||||||
|
|||||||
+2
-2
@@ -170,7 +170,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Error(Code code = kOK, const std::string& message = "")
|
explicit Error(Code code = kOK, const std::string& message = "")
|
||||||
: code_(code), message_(message), timeout_(false) {
|
: code_(code), message_(message) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note that `noexcept` is required by GCC.
|
// Note that `noexcept` is required by GCC.
|
||||||
@@ -206,7 +206,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
Code code_;
|
Code code_;
|
||||||
std::string message_;
|
std::string message_;
|
||||||
bool timeout_;
|
bool timeout_ = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::ostream& operator<<(std::ostream& os, const Error& error);
|
std::ostream& operator<<(std::ostream& os, const Error& error);
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ class Message {
|
|||||||
public:
|
public:
|
||||||
Message();
|
Message();
|
||||||
|
|
||||||
|
Message(const Message&) = delete;
|
||||||
|
Message& operator=(const Message&) = delete;
|
||||||
|
|
||||||
virtual ~Message() = default;
|
virtual ~Message() = default;
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ public:
|
|||||||
explicit BodyHandler(Message* message) : message_(message) {
|
explicit BodyHandler(Message* message) : message_(message) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BodyHandler(const BodyHandler&) = delete;
|
||||||
|
BodyHandler& operator=(const BodyHandler&) = delete;
|
||||||
|
|
||||||
virtual ~BodyHandler() = default;
|
virtual ~BodyHandler() = default;
|
||||||
|
|
||||||
virtual void AddContent(const char* data, std::size_t count) = 0;
|
virtual void AddContent(const char* data, std::size_t count) = 0;
|
||||||
|
|||||||
@@ -29,6 +29,11 @@ public:
|
|||||||
using ReadHandler =
|
using ReadHandler =
|
||||||
std::function<void(boost::system::error_code, std::size_t)>;
|
std::function<void(boost::system::error_code, std::size_t)>;
|
||||||
|
|
||||||
|
SocketBase() = default;
|
||||||
|
|
||||||
|
SocketBase(const SocketBase&) = delete;
|
||||||
|
SocketBase& operator=(const SocketBase&) = delete;
|
||||||
|
|
||||||
virtual ~SocketBase() = default;
|
virtual ~SocketBase() = default;
|
||||||
|
|
||||||
virtual void AsyncConnect(const std::string& host, const Endpoints& endpoints,
|
virtual void AsyncConnect(const std::string& host, const Endpoints& endpoints,
|
||||||
|
|||||||
+1
-4
@@ -27,9 +27,6 @@ public:
|
|||||||
|
|
||||||
explicit Url(const std::string& str, bool encode = false);
|
explicit Url(const std::string& str, bool encode = false);
|
||||||
|
|
||||||
Url(Url&&) = default;
|
|
||||||
Url& operator=(Url&&) = default;
|
|
||||||
|
|
||||||
const std::string& scheme() const {
|
const std::string& scheme() const {
|
||||||
return scheme_;
|
return scheme_;
|
||||||
}
|
}
|
||||||
@@ -134,7 +131,7 @@ public:
|
|||||||
std::regex operator()() const {
|
std::regex operator()() const {
|
||||||
std::regex::flag_type flags = std::regex::ECMAScript | std::regex::icase;
|
std::regex::flag_type flags = std::regex::ECMAScript | std::regex::icase;
|
||||||
|
|
||||||
return std::regex(url_, flags);
|
return std::regex{ url_, flags };
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -10,8 +10,13 @@ namespace webcc {
|
|||||||
|
|
||||||
class View {
|
class View {
|
||||||
public:
|
public:
|
||||||
|
View() = default;
|
||||||
|
|
||||||
virtual ~View() = default;
|
virtual ~View() = default;
|
||||||
|
|
||||||
|
View(const View&) = delete;
|
||||||
|
View& operator=(const View&) = delete;
|
||||||
|
|
||||||
virtual ResponsePtr Handle(RequestPtr request) = 0;
|
virtual ResponsePtr Handle(RequestPtr request) = 0;
|
||||||
|
|
||||||
// Return true if you want the request data of the given method to be streamed
|
// Return true if you want the request data of the given method to be streamed
|
||||||
|
|||||||
Reference in New Issue
Block a user