From: Gabriel Corona Date: Mon, 22 Feb 2016 11:34:31 +0000 (+0100) Subject: [mc] Doc/cleanup ChunkedData X-Git-Tag: v3_13~741 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/33e118c08426a12ed80cd258ff1154f8bc70973b?ds=sidebyside [mc] Doc/cleanup ChunkedData --- diff --git a/src/mc/ChunkedData.hpp b/src/mc/ChunkedData.hpp index 05ef275b5b..dd7c6afcdc 100644 --- a/src/mc/ChunkedData.hpp +++ b/src/mc/ChunkedData.hpp @@ -19,18 +19,14 @@ namespace simgrid { namespace mc { +/** A byte-string represented as a sequence of chunks from a PageStor */ class ChunkedData { - PageStore* store_; + PageStore* store_ = nullptr; + /** Indices of the chunks */ std::vector pagenos_; public: - ChunkedData() : store_(nullptr) {} - ChunkedData(ChunkedData const& that) - { - store_ = that.store_; - pagenos_ = that.pagenos_; - for (std::size_t pageno : pagenos_) - store_->ref_page(pageno); - } + + ChunkedData() {} void clear() { for (std::size_t pageno : pagenos_) @@ -42,6 +38,14 @@ public: clear(); } + // Copy and move + ChunkedData(ChunkedData const& that) + { + store_ = that.store_; + pagenos_ = that.pagenos_; + for (std::size_t pageno : pagenos_) + store_->ref_page(pageno); + } ChunkedData(ChunkedData&& that) { store_ = that.store_;