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] Move Server in simgrid::mc
[simgrid.git]
/
src
/
mc
/
Server.hpp
diff --git
a/src/mc/mc_server.h
b/src/mc/Server.hpp
similarity index 74%
rename from
src/mc/mc_server.h
rename to
src/mc/Server.hpp
index
9daf0dd
..
1c82e5a
100644
(file)
--- a/
src/mc/mc_server.h
+++ b/
src/mc/Server.hpp
@@
-4,13
+4,11
@@
/* 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. */
/* 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_H
PP
+#define SIMGRID_MC_SERVER_H
PP
#include <poll.h>
#include <poll.h>
-#include <stdbool.h>
-
#include <sys/signalfd.h>
#include <sys/types.h>
#include <sys/signalfd.h>
#include <sys/types.h>
@@
-20,25
+18,16
@@
#include "src/mc/Process.hpp"
#include "mc_exit.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:
private:
pid_t pid;
int socket;
struct pollfd fds[2];
public:
-
s_mc_s
erver(pid_t pid, int socket);
+
S
erver(pid_t pid, int socket);
void start();
void shutdown();
void exit();
void start();
void shutdown();
void exit();
@@
-54,6
+43,9
@@
private:
void on_signal(const struct signalfd_siginfo* info);
};
void on_signal(const struct signalfd_siginfo* info);
};
-#endif
+extern Server* server;
+
+}
+}
#endif
#endif