Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Factor common code.
[simgrid.git] / src / kernel / routing / NetZone_test.hpp
1 /* Copyright (c) 2017-2021. 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 NETZONE_TEST_HPP
7 #define NETZONE_TEST_HPP
8
9 #include "simgrid/kernel/routing/NetPoint.hpp"
10 #include "simgrid/s4u/Host.hpp"
11 #include "simgrid/s4u/NetZone.hpp"
12
13 // Callback function common to several routing unit tests
14 struct CreateHost {
15   std::pair<simgrid::kernel::routing::NetPoint*, simgrid::kernel::routing::NetPoint*>
16   operator()(simgrid::s4u::NetZone* zone, const std::vector<unsigned int>& /*coord*/, int id) const
17   {
18     const simgrid::s4u::Host* host = zone->create_host(std::to_string(id), 1e9)->seal();
19     return std::make_pair(host->get_netpoint(), nullptr);
20   }
21 };
22
23 #endif