From c02ba8ae8eb038f8b216536c59d6870de407137f Mon Sep 17 00:00:00 2001 From: Krzysztof Jackiewicz Date: Wed, 27 Aug 2014 11:37:25 +0200 Subject: [PATCH] Add move ctors/operators to MessageBuffer and BinaryQueue Default implementations of move constructors and operators were added to make objects of these classess movable. Change-Id: I03322ead292adc29bed8a859fb7bc640b16fd251 --- src/manager/common/message-buffer.h | 3 +++ src/manager/dpl/core/include/dpl/binary_queue.h | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/manager/common/message-buffer.h b/src/manager/common/message-buffer.h index 6fc459c..9ce9d8e 100644 --- a/src/manager/common/message-buffer.h +++ b/src/manager/common/message-buffer.h @@ -49,6 +49,9 @@ public: : m_bytesLeft(0) {} + MessageBuffer(MessageBuffer&&) = default; + MessageBuffer& operator=(MessageBuffer&&) = default; + void Push(const RawBuffer &data); RawBuffer Pop(); diff --git a/src/manager/dpl/core/include/dpl/binary_queue.h b/src/manager/dpl/core/include/dpl/binary_queue.h index c1ad21f..79b3d65 100644 --- a/src/manager/dpl/core/include/dpl/binary_queue.h +++ b/src/manager/dpl/core/include/dpl/binary_queue.h @@ -127,6 +127,13 @@ class BinaryQueue BinaryQueue(const BinaryQueue &other); /** + * Construct binary queue by moving data from other binary queue + * + * @param[in] other Other binary queue to move from + */ + BinaryQueue(BinaryQueue&&) = default; + + /** * Destructor */ virtual ~BinaryQueue(); @@ -140,6 +147,13 @@ class BinaryQueue const BinaryQueue &operator=(const BinaryQueue &other); /** + * Assign data from other binary queue using move semantics + * + * @param[in] other Other binary queue to move from + */ + BinaryQueue &operator=(BinaryQueue&&) = default; + + /** * Append copy of @a bufferSize bytes from memory pointed by @a buffer * to the end of binary queue. Uses default deleter based on free. * -- 2.7.4