Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into fix/execute_benched
[simgrid.git] / src / mc / remote / Client.hpp
index 7974601..dc10fd8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015. The SimGrid Team.
+/* Copyright (c) 2015-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -28,14 +28,22 @@ namespace mc {
  */
 class XBT_PUBLIC() Client {
 private:
-  bool active_ = false;
   Channel channel_;
-  static std::unique_ptr<Client> client_;
+  static std::unique_ptr<Client> instance_;
 
 public:
   Client();
-  explicit Client(int fd) : active_(true), channel_(fd) {}
+  explicit Client(int fd) : channel_(fd) {}
   void handleMessages();
+
+private:
+  void handleDeadlockCheck(s_mc_message_t* msg);
+  void handleContinue(s_mc_message_t* msg);
+  void handleSimcall(s_mc_message_simcall_handle_t* message);
+  void handleRestore(s_mc_message_restore_t* msg);
+  void handleActorEnabled(s_mc_message_actor_enabled_t* msg);
+
+public:
   Channel const& getChannel() const { return channel_; }
   Channel& getChannel() { return channel_; }
   void mainLoop();
@@ -51,17 +59,9 @@ public:
   // Singleton :/
   // TODO, remove the singleton antipattern.
   static Client* initialize();
-  static Client* get() { return client_.get(); }
+  static Client* get() { return instance_.get(); }
 };
 }
 }
 
-SG_BEGIN_DECL()
-
-#if SIMGRID_HAVE_MC
-void MC_ignore(void* addr, std::size_t size);
-#endif
-
-SG_END_DECL()
-
 #endif