Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
6f570ba7678185ba7d7c821137c1f7319243ddd9
[simgrid.git] / src / surf / surf_routing.hpp
1 /* Copyright (c) 2013-2016. 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 NETWORK_ROUTING_HPP_
7 #define NETWORK_ROUTING_HPP_
8
9 #include <xbt/base.h>
10 #include <xbt/signal.hpp>
11
12 #include "surf_interface.hpp"
13 #include "src/kernel/routing/AsImpl.hpp"
14
15 #include <float.h>
16 #include <vector>
17
18 SG_BEGIN_DECL()
19 XBT_PRIVATE xbt_node_t new_xbt_graph_node (xbt_graph_t graph, const char *name, xbt_dict_t nodes);
20 XBT_PRIVATE xbt_edge_t new_xbt_graph_edge (xbt_graph_t graph, xbt_node_t s, xbt_node_t d, xbt_dict_t edges);
21 SG_END_DECL()
22
23 namespace simgrid {
24 namespace kernel {
25 namespace routing {
26
27   XBT_PUBLIC_DATA(simgrid::xbt::signal<void(s4u::As*)>) asCreatedCallbacks;
28
29 /***********
30  * Classes *
31  ***********/
32
33 class XBT_PRIVATE Onelink;
34 class RoutingPlatf;
35
36 class AsRoute {
37 public:
38   explicit AsRoute(NetCard* gwSrc, NetCard* gwDst) : gw_src(gwSrc), gw_dst(gwDst) {}
39   const NetCard* gw_src;
40   const NetCard* gw_dst;
41   std::vector<Link*> links;
42 };
43
44 /** @ingroup SURF_routing_interface
45  * @brief Link of length 1, alongside with its source and destination. This is mainly useful in the ns3 bindings
46  */
47 class Onelink {
48 public:
49   Onelink(Link* link, NetCard* src, NetCard* dst) : src_(src), dst_(dst), link_(link){};
50   NetCard* src_;
51   NetCard* dst_;
52   Link* link_;
53 };
54
55 }}}
56
57 #endif /* NETWORK_ROUTING_HPP_ */