1 /* Copyright (c) 2007, 2009-2011, 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 #ifndef _GTNETS_TOPOLOGY_H
8 #define _GTNETS_TOPOLOGY_H
23 GTNETS_Node(const GTNETS_Node & node);
38 set < int >hosts_; //simgrid hosts
46 GTNETS_Link(const GTNETS_Link &);
49 GTNETS_Node *src_node();
50 GTNETS_Node *dst_node();
55 void print_link_status();
56 int add_src(GTNETS_Node *);
57 int add_dst(GTNETS_Node *);
62 GTNETS_Node *src_node_;
63 GTNETS_Node *dst_node_;
67 // To create a topology:
70 // 3. add onehop links
71 class GTNETS_Topology {
76 bool is_router(int id);
77 int peer_node_id(int linkid, int cur_id);
79 int add_router(int id);
80 int add_onehop_route(int src, int dst, int link);
82 int nodeid_from_hostid(int);
85 void print_topology();
86 const vector < GTNETS_Node * >&nodes();
87 const map < int, GTNETS_Link * >&links();
92 map < int, GTNETS_Link * >links_;
93 vector < GTNETS_Node * >nodes_;
95 map < int, int >hosts_; //hostid->nodeid