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);
30 int id(){return ID_;};
38 set<int> hosts_; //simgrid hosts
46 GTNETS_Link(const GTNETS_Link&);
49 GTNETS_Node* src_node();
50 GTNETS_Node* dst_node();
52 int id(){return ID_;};
53 void print_link_status();
54 int add_src(GTNETS_Node*);
55 int add_dst(GTNETS_Node*);
60 GTNETS_Node* src_node_;
61 GTNETS_Node* dst_node_;
65 // To create a topology:
68 // 3. add onehop links
69 class GTNETS_Topology{
74 bool is_router(int id);
75 int peer_node_id(int linkid, int cur_id);
77 int add_router(int id);
78 int add_onehop_route(int src, int dst, int link);
80 int nodeid_from_hostid(int);
83 void print_topology();
84 const vector<GTNETS_Node*>& nodes();
85 const map<int, GTNETS_Link*>& links();
90 map<int, GTNETS_Link*> links_;
91 vector<GTNETS_Node*> nodes_;
93 map<int, int> hosts_; //hostid->nodeid