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] Fix MC with the class-hierarchification of simgrid::simix::Synchro
[simgrid.git]
/
src
/
mc
/
AddressSpace.hpp
diff --git
a/src/mc/AddressSpace.hpp
b/src/mc/AddressSpace.hpp
index
a5ff9b3
..
75fbcae
100644
(file)
--- a/
src/mc/AddressSpace.hpp
+++ b/
src/mc/AddressSpace.hpp
@@
-7,6
+7,7
@@
#ifndef SIMGRID_MC_ADDRESS_SPACE_H
#define SIMGRID_MC_ADDRESS_SPACE_H
#ifndef SIMGRID_MC_ADDRESS_SPACE_H
#define SIMGRID_MC_ADDRESS_SPACE_H
+#include <cassert>
#include <cstddef>
#include <cstdint>
#include <type_traits>
#include <cstddef>
#include <cstdint>
#include <type_traits>
@@
-90,6
+91,17
@@
public:
static constexpr ReadOptions lazy() { return ReadOptions(1); }
};
static constexpr ReadOptions lazy() { return ReadOptions(1); }
};
+/** A value read from another process */
+template<class T>
+class Remote {
+private:
+ char buffer[sizeof(T)];
+public:
+ void* data() { return buffer; }
+ const void* data() const { return buffer; }
+ constexpr std::size_t size() const { return sizeof(T); }
+};
+
/** A given state of a given process (abstract base class)
*
* Currently, this might either be:
/** A given state of a given process (abstract base class)
*
* Currently, this might either be:
@@
-126,6
+138,12
@@
public:
this->read_bytes(buffer, sizeof(T), ptr, process_index);
}
this->read_bytes(buffer, sizeof(T), ptr, process_index);
}
+ template<class T> inline
+ void read(Remote<T>& buffer, RemotePtr<T> ptr, int process_index = ProcessIndexAny)
+ {
+ this->read_bytes(buffer.data(), sizeof(T), ptr, process_index);
+ }
+
/** Read a given data structure from the address space */
template<class T> inline
T read(RemotePtr<T> ptr, int process_index = ProcessIndexMissing)
/** Read a given data structure from the address space */
template<class T> inline
T read(RemotePtr<T> ptr, int process_index = ProcessIndexMissing)