1 /* Copyright (c) 2007, 2009, 2010. 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. */
8 #ifndef _GTNETS_TOPOLOGY_H
9 #define _GTNETS_TOPOLOGY_H
24 GTNETS_Node(const GTNETS_Node & node);
39 set < int >hosts_; //simgrid hosts
47 GTNETS_Link(const GTNETS_Link &);
50 GTNETS_Node *src_node();
51 GTNETS_Node *dst_node();
56 void print_link_status();
57 int add_src(GTNETS_Node *);
58 int add_dst(GTNETS_Node *);
63 GTNETS_Node *src_node_;
64 GTNETS_Node *dst_node_;
68 // To create a topology:
71 // 3. add onehop links
72 class GTNETS_Topology {
77 bool is_router(int id);
78 int peer_node_id(int linkid, int cur_id);
80 int add_router(int id);
81 int add_onehop_route(int src, int dst, int link);
83 int nodeid_from_hostid(int);
86 void print_topology();
87 const vector < GTNETS_Node * >&nodes();
88 const map < int, GTNETS_Link * >&links();
93 map < int, GTNETS_Link * >links_;
94 vector < GTNETS_Node * >nodes_;
96 map < int, int >hosts_; //hostid->nodeid