Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
NetworkModelIntf: Interface to dynamic factors
[simgrid.git] / include / simgrid / kernel / resource / NetworkModelIntf.hpp
1 /* Copyright (c) 2004-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 SIMGRID_KERNEL_RESOURCE_NETWORKMODELINTF_HPP
7 #define SIMGRID_KERNEL_RESOURCE_NETWORKMODELINTF_HPP
8
9 #include <simgrid/s4u/Link.hpp>
10 #include <simgrid/s4u/NetZone.hpp>
11
12 #include <unordered_set>
13 #include <vector>
14
15 namespace simgrid {
16 namespace kernel {
17 namespace resource {
18
19 /** @ingroup SURF_interface
20  * @brief Network Model interface class
21  * @details Defines the methods that a Network model must implement
22  */
23 class XBT_PUBLIC NetworkModelIntf {
24 public:
25   using NetworkFactorCb     = double(double size, const std::vector<s4u::Link*>& links,
26                                  const std::unordered_set<s4u::NetZone*>& netzones);
27   virtual void set_lat_factor_cb(const std::function<NetworkFactorCb>& cb)        = 0;
28   virtual void set_bw_factor_cb(const std::function<NetworkFactorCb>& cb)         = 0;
29 };
30
31 } // namespace resource
32 } // namespace kernel
33 } // namespace simgrid
34
35 #endif /* SIMGRID_KERNEL_RESOURCE_NETWORKMODELINTF_HPP */