summaryrefslogtreecommitdiff
path: root/src/SocketBuffer.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2014-06-05 23:33:58 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2014-06-05 23:33:58 +0900
commit0ee8104953ddce66a0bc9d48e17242c8cf04aca7 (patch)
treece98dde717cd9977f17a7de24aa09320686564de /src/SocketBuffer.h
parentc0e4381780ae05969aea56a1a11f598f5edce3d8 (diff)
Small code cleanup for SocketBuffer
Diffstat (limited to 'src/SocketBuffer.h')
-rw-r--r--src/SocketBuffer.h12
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();