A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[mc] Doc/cleanup ChunkedData
[simgrid.git]
/
src
/
mc
/
ChunkedData.hpp
diff --git
a/src/mc/ChunkedData.hpp
b/src/mc/ChunkedData.hpp
index
05ef275
..
dd7c6af
100644
(file)
--- a/
src/mc/ChunkedData.hpp
+++ b/
src/mc/ChunkedData.hpp
@@
-19,18
+19,14
@@
namespace simgrid {
namespace mc {
namespace simgrid {
namespace mc {
+/** A byte-string represented as a sequence of chunks from a PageStor */
class ChunkedData {
class ChunkedData {
- PageStore* store_;
+ PageStore* store_ = nullptr;
+ /** Indices of the chunks */
std::vector<std::size_t> pagenos_;
public:
std::vector<std::size_t> 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_)
void clear()
{
for (std::size_t pageno : pagenos_)
@@
-42,6
+38,14
@@
public:
clear();
}
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_;
ChunkedData(ChunkedData&& that)
{
store_ = that.store_;