Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add implementations for EventSet + Configurations
[simgrid.git] / src / mc / explo / udpor / StateManager.hpp
1 /* Copyright (c) 2007-2023. 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_UDPOR_GLOBAL_HPP
7 #define SIMGRID_MC_UDPOR_GLOBAL_HPP
8
9 #include "src/mc/api/State.hpp"
10 #include "src/mc/explo/udpor/udpor_forward.hpp"
11
12 #include <optional>
13
14 namespace simgrid::mc::udpor {
15
16 class StateManager {
17 private:
18   using Handle = StateHandle;
19
20   Handle current_handle_ = 1ul;
21   std::unordered_map<Handle, std::unique_ptr<State>> state_map_;
22
23 public:
24   Handle record_state(std::unique_ptr<State>);
25   std::optional<std::reference_wrapper<State>> get_state(Handle);
26 };
27
28 } // namespace simgrid::mc::udpor
29 #endif