- enum ReadMode {
- Normal,
- /** Allows the `read_bytes` to return a pointer to another buffer
- * where the data ins available instead of copying the data into the buffer
- */
- Lazy
- };
- virtual ~AddressSpace();
- virtual const void* read_bytes(void* buffer, std::size_t size,
- remote_ptr<void> address, int process_index = ProcessIndexAny,
- ReadMode mode = Normal) const = 0;
-
- template<class T> inline
- void read(T *buffer, remote_ptr<T> ptr, int process_index = ProcessIndexAny)
+ explicit AddressSpace(RemoteSimulation* remote_simulation) : remote_simulation_(remote_simulation) {}
+ virtual ~AddressSpace() = default;
+
+ /** The process of this address space
+ *
+ * This is where we can get debug information, memory layout, etc.
+ */
+ simgrid::mc::RemoteSimulation* get_remote_simulation() const { return remote_simulation_; }
+
+ /** Read data from the address space
+ *
+ * @param buffer target buffer for the data
+ * @param size number of bytes to read
+ * @param address remote source address of the data
+ * @param options
+ */
+ virtual void* read_bytes(void* buffer, std::size_t size, RemotePtr<void> address,
+ ReadOptions options = ReadOptions::none()) const = 0;
+
+ /** Read a given data structure from the address space */
+ template <class T> inline void read(T* buffer, RemotePtr<T> ptr) const { this->read_bytes(buffer, sizeof(T), ptr); }
+
+ template <class T> inline void read(Remote<T>& buffer, RemotePtr<T> ptr) const
+ {
+ this->read_bytes(buffer.get_buffer(), sizeof(T), ptr);
+ }
+
+ /** Read a given data structure from the address space
+ *
+ * This version returns by value.
+ */
+ template <class T> inline Remote<T> read(RemotePtr<T> ptr) const