1 /* Copyright (c) 2007-2022. The SimGrid Team. All rights reserved. */
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. */
6 #ifndef SIMGRID_MC_REMOTE_EVENTLOOP_HPP
7 #define SIMGRID_MC_REMOTE_EVENTLOOP_HPP
9 #include "src/mc/mc_forward.hpp"
10 #include "src/mc/remote/Channel.hpp"
12 #include <event2/event.h>
20 std::unique_ptr<event_base, decltype(&event_base_free)> base_{nullptr, &event_base_free};
21 std::unique_ptr<event, decltype(&event_free)> socket_event_{nullptr, &event_free};
22 std::unique_ptr<event, decltype(&event_free)> signal_event_{nullptr, &event_free};
27 explicit CheckerSide(int sockfd) : channel_(sockfd) {}
30 CheckerSide(CheckerSide const&) = delete;
31 CheckerSide& operator=(CheckerSide const&) = delete;
32 CheckerSide& operator=(CheckerSide&&) = delete;
34 Channel const& get_channel() const { return channel_; }
35 Channel& get_channel() { return channel_; }
37 void start(void (*handler)(int, short, void*), ModelChecker* mc);
38 void dispatch() const;
39 void break_loop() const;
43 } // namespace simgrid