Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
prefer returning a NetZone than a pair of NetPoints and adapt callbacks for fancy...
[simgrid.git] / src / kernel / routing / NetZone_test.hpp
1 /* Copyright (c) 2017-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 NETZONE_TEST_HPP
7 #define NETZONE_TEST_HPP
8
9 #include "simgrid/s4u/NetZone.hpp"
10 #include "xbt/log.h"
11 XBT_LOG_EXTERNAL_CATEGORY(ker_platform);
12
13 // Callback function common to several routing unit tests
14 struct CreateHost {
15   simgrid::s4u::NetZone* operator()(simgrid::s4u::NetZone* zone, const std::vector<unsigned long>& /*coord*/,
16                                     unsigned long id) const
17   {
18     XBT_CINFO(ker_platform,"PROUT");
19     auto* host_zone = simgrid::s4u::create_empty_zone("zone-" +std::to_string(id))->set_parent(zone);
20     host_zone->create_host(std::to_string(id), "1Gf");
21     host_zone->seal();
22     return host_zone;
23   }
24 };
25
26 #endif