3 /* Copyright (c) 2007 Kayo Fujiwara. All rights reserved. */
5 /* This program is free software; you can redistribute it and/or modify it
6 * under the terms of the license (GNU LGPL) which comes with this package. */
9 #ifndef _GTNETS_TOPOLOGY_H
10 #define _GTNETS_TOPOLOGY_H
25 GTNETS_Node(const GTNETS_Node & node);
40 set < int >hosts_; //simgrid hosts
48 GTNETS_Link(const GTNETS_Link &);
51 GTNETS_Node *src_node();
52 GTNETS_Node *dst_node();
57 void print_link_status();
58 int add_src(GTNETS_Node *);
59 int add_dst(GTNETS_Node *);
64 GTNETS_Node *src_node_;
65 GTNETS_Node *dst_node_;
69 // To create a topology:
72 // 3. add onehop links
73 class GTNETS_Topology {
78 bool is_router(int id);
79 int peer_node_id(int linkid, int cur_id);
81 int add_router(int id);
82 int add_onehop_route(int src, int dst, int link);
84 int nodeid_from_hostid(int);
87 void print_topology();
88 const vector < GTNETS_Node * >&nodes();
89 const map < int, GTNETS_Link * >&links();
94 map < int, GTNETS_Link * >links_;
95 vector < GTNETS_Node * >nodes_;
97 map < int, int >hosts_; //hostid->nodeid