diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2014-06-05 23:33:58 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2014-06-05 23:33:58 +0900 |
| commit | 0ee8104953ddce66a0bc9d48e17242c8cf04aca7 (patch) | |
| tree | ce98dde717cd9977f17a7de24aa09320686564de /src/SocketBuffer.h | |
| parent | c0e4381780ae05969aea56a1a11f598f5edce3d8 (diff) | |
Small code cleanup for SocketBuffer
Diffstat (limited to 'src/SocketBuffer.h')
| -rw-r--r-- | src/SocketBuffer.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/SocketBuffer.h b/src/SocketBuffer.h index 32d78287..256e3ce1 100644 --- a/src/SocketBuffer.h +++ b/src/SocketBuffer.h @@ -109,13 +109,13 @@ private: // to the data to be sent in the next send() call. size_t offset_; public: - SocketBuffer(const std::shared_ptr<SocketCore>& socket); + SocketBuffer(std::shared_ptr<SocketCore> socket); ~SocketBuffer(); // Don't allow copying - SocketBuffer(const SocketBuffer&); - SocketBuffer& operator=(const SocketBuffer&); + SocketBuffer(const SocketBuffer&) = delete; + SocketBuffer& operator=(const SocketBuffer&) = delete; // Feeds data pointered by bytes with length len into queue. This // object gets ownership of bytes, so caller must not delete or @@ -124,16 +124,14 @@ public: // each time the data is sent. It will be deleted by this object. It // can be null. void pushBytes(unsigned char* bytes, size_t len, - std::unique_ptr<ProgressUpdate> progressUpdate = - std::unique_ptr<ProgressUpdate>{}); + std::unique_ptr<ProgressUpdate> progressUpdate = nullptr); // Feeds data into queue. This function doesn't send data. If // progressUpdate is not null, its update() function will be called // each time the data is sent. It will be deleted by this object. It // can be null. void pushStr(std::string data, - std::unique_ptr<ProgressUpdate> progressUpdate = - std::unique_ptr<ProgressUpdate>{}); + std::unique_ptr<ProgressUpdate> progressUpdate = nullptr); // Sends data in queue. Returns the number of bytes sent. ssize_t send(); |
