1 /* Copyright (c) 2013-2014. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #include "surf_routing_generic.hpp"
9 #ifndef SURF_ROUTING_DIJKSTRA_HPP_
10 #define SURF_ROUTING_DIJKSTRA_HPP_
12 typedef struct graph_node_data {
14 int graph_id; /* used for caching internal graph id's */
15 } s_graph_node_data_t, *graph_node_data_t;
17 typedef struct graph_node_map_element {
19 } s_graph_node_map_element_t, *graph_node_map_element_t;
21 typedef struct route_cache_element {
24 } s_route_cache_element_t, *route_cache_element_t;
30 typedef AsDijkstra *AsDijkstraPtr;
32 class AsDijkstra : public AsGeneric {
35 AsDijkstra(int cached);
37 xbt_node_t routeGraphNewNode(int id, int graph_id);
38 graph_node_map_element_t nodeMapSearch(int id);
39 void newRoute(int src_id, int dst_id, sg_platf_route_cbarg_t e_route);
41 void getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_platf_route_cbarg_t route, double *lat);
42 xbt_dynar_t getOnelinkRoutes();
43 void getRouteAndLatency(sg_platf_route_cbarg_t route, double *lat);
44 void parseASroute(sg_platf_route_cbarg_t route);
45 void parseRoute(sg_platf_route_cbarg_t route);
48 xbt_graph_t p_routeGraph; /* xbt_graph */
49 xbt_dict_t p_graphNodeMap; /* map */
50 xbt_dict_t p_routeCache; /* use in cache mode */
54 #endif /* SURF_ROUTING_DIJKSTRA_HPP_ */