/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#ifndef SIMGRID_MC_SERVER_H
-#define SIMGRID_MC_SERVER_H
+#ifndef SIMGRID_MC_SERVER_HPP
+#define SIMGRID_MC_SERVER_HPP
#include <poll.h>
-#include <stdbool.h>
-
#include <sys/signalfd.h>
#include <sys/types.h>
#include "src/mc/Process.hpp"
#include "mc_exit.h"
-SG_BEGIN_DECL()
-
-#define MC_SERVER_ERROR SIMGRID_ERROR
-
-typedef struct s_mc_server s_mc_server_t, *mc_server_t;
-
-extern mc_server_t mc_server;
+namespace simgrid {
+namespace mc {
-SG_END_DECL()
-
-#ifdef __cplusplus
-
-struct s_mc_server {
+class Server {
private:
pid_t pid;
int socket;
struct pollfd fds[2];
public:
- s_mc_server(pid_t pid, int socket);
+ Server(pid_t pid, int socket);
void start();
void shutdown();
void exit();
void on_signal(const struct signalfd_siginfo* info);
};
-#endif
+extern Server* server;
+
+}
+}
#endif