1 /* Copyright (c) 2016-2020. 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 #include "src/kernel/EngineImpl.hpp"
7 #include "simgrid/Exception.hpp"
8 #include "simgrid/kernel/routing/NetPoint.hpp"
9 #include "simgrid/kernel/routing/NetZoneImpl.hpp"
10 #include "simgrid/s4u/Host.hpp"
11 #include "src/kernel/resource/DiskImpl.hpp"
12 #include "src/simix/smx_private.hpp"
13 #include "src/surf/StorageImpl.hpp"
14 #include "src/surf/network_interface.hpp"
15 #include "src/surf/xml/platf.hpp" // FIXME: KILLME. There must be a better way than mimicking XML here
20 EngineImpl::~EngineImpl()
22 /* Since hosts_ is a std::map, the hosts are destroyed in the lexicographic order, which ensures that the output is
25 while (not hosts_.empty())
26 hosts_.begin()->second->destroy();
28 /* Also delete the other data */
30 for (auto const& kv : netpoints_)
33 for (auto const& kv : storages_)
37 for (auto const& kv : links_)
42 void EngineImpl::load_deployment(const std::string& file) const
47 surf_parse_open(file);
52 void EngineImpl::register_function(const std::string& name, const actor::ActorCodeFactory& code)
54 registered_functions[name] = code;
56 void EngineImpl::register_default(const actor::ActorCodeFactory& code)
58 default_function = code;
62 } // namespace simgrid