From: Krzysztof Jackiewicz Date: Wed, 27 Aug 2014 09:37:25 +0000 (+0200) Subject: Add move ctors/operators to MessageBuffer and BinaryQueue X-Git-Tag: accepted/tizen/common/20140925.172038~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c02ba8ae8eb038f8b216536c59d6870de407137f;p=platform%2Fcore%2Fsecurity%2Fkey-manager.git 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 --- 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. *