3 /* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
4 * All rights reserved. */
6 /* This program is free software; you can redistribute it and/or modify it
7 * under the terms of the license (GNU LGPL) which comes with this package. */
10 #ifndef _GTNETS_TOPOLOGY_H
11 #define _GTNETS_TOPOLOGY_H
26 GTNETS_Node(const GTNETS_Node & node);
41 set < int >hosts_; //simgrid hosts
49 GTNETS_Link(const GTNETS_Link &);
52 GTNETS_Node *src_node();
53 GTNETS_Node *dst_node();
58 void print_link_status();
59 int add_src(GTNETS_Node *);
60 int add_dst(GTNETS_Node *);
65 GTNETS_Node *src_node_;
66 GTNETS_Node *dst_node_;
70 // To create a topology:
73 // 3. add onehop links
74 class GTNETS_Topology {
79 bool is_router(int id);
80 int peer_node_id(int linkid, int cur_id);
82 int add_router(int id);
83 int add_onehop_route(int src, int dst, int link);
85 int nodeid_from_hostid(int);
88 void print_topology();
89 const vector < GTNETS_Node * >&nodes();
90 const map < int, GTNETS_Link * >&links();
95 map < int, GTNETS_Link * >links_;
96 vector < GTNETS_Node * >nodes_;
98 map < int, int >hosts_; //hostid->nodeid