Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
MC: actually remove the comm channel from RemoteClientMemory
[simgrid.git] / src / mc / remote / CheckerSide.hpp
1 /* Copyright (c) 2007-2020. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef SIMGRID_MC_REMOTE_EVENTLOOP_HPP
7 #define SIMGRID_MC_REMOTE_EVENTLOOP_HPP
8
9 #include "src/mc/remote/Channel.hpp"
10
11 #include <event2/event.h>
12 #include <functional>
13
14 namespace simgrid {
15 namespace mc {
16
17 class CheckerSide {
18   struct event_base* base_    = nullptr;
19   struct event* socket_event_ = nullptr;
20   struct event* signal_event_ = nullptr;
21
22   Channel channel_;
23
24 public:
25   explicit CheckerSide(int sockfd) : channel_(sockfd) {}
26   ~CheckerSide();
27
28   Channel const& get_channel() const { return channel_; }
29   Channel& get_channel() { return channel_; }
30
31   void start(void (*handler)(int, short, void*));
32   void dispatch();
33   void break_loop();
34 };
35
36 } // namespace mc
37 } // namespace simgrid
38
39 #endif