Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Replace the override word with MC_OVERRIDE
[simgrid.git] / src / mc / mc_process.h
index b8408c1..00251e4 100644 (file)
@@ -69,8 +69,16 @@ public:
   // Read memory:
   const void* read_bytes(void* buffer, std::size_t size,
     remote_ptr<void> address, int process_index = ProcessIndexAny,
-    ReadMode mode = Normal) const override;
+    ReadMode mode = Normal) const MC_OVERRIDE;
   void read_variable(const char* name, void* target, size_t size) const;
+  template<class T>
+  T read_variable(const char *name) const
+  {
+    static_assert(std::is_trivial<T>::value, "Cannot read a non-trivial type");
+    T res;
+    read_variable(name, &res, sizeof(T));
+    return res;
+  }
   char* read_string(remote_ptr<void> address) const;
 
   // Write memory:
@@ -104,13 +112,16 @@ public:
   }
   void ignore_region(std::uint64_t address, std::size_t size);
 
+  pid_t pid() const { return pid_; }
+
 private:
   void init_memory_map_info();
   void refresh_heap();
   void refresh_malloc_info();
-public: // to be private
+private:
   mc_process_flags_t process_flags;
-  pid_t pid;
+  pid_t pid_;
+public: // to be private
   int socket;
   int status;
   bool running;