3 #ifndef _GTNETS_TOPOLOGY_H
4 #define _GTNETS_TOPOLOGY_H
20 SGNode(int id, int hostid);
23 void add_link(SGLink*);
25 //get other link than the link with the given id.
26 //Note it's only for the case the node has two links.
27 SGLink* other_link(int);
29 bool has_link(SGLink*); //TODO can do const SGLink*?
33 vector<SGLink*>& links();
35 int id(){return ID_;};
40 vector<int> hosts_; //simgrid hosts
41 vector<SGLink*> links_;
47 SGLink(int id, SGNode* left, SGNode* right);
50 //for a temporary link set, that is, a link has at most two neibours.
58 bool is_inleft(SGLink*);
59 bool is_inright(SGLink*);
61 void add_left_link(SGLink*, int side);
62 void add_right_link(SGLink*, int side);
64 int id(){return ID_;};
81 void add_link(int src, int dst, int* links, int nsize);
83 void create_tmplink(int src, int dst, int* links, int nsize);
85 void merge_link(SGLink*);
87 void add_tmplink_to_links(map<int, SGLink*> tmplink); //???
89 void print_topology();
91 void create_gtnets_topology();
93 map<int, SGLink*>& get_links();
97 map<int, SGLink*> links_;
98 map<int, SGNode*> nodes_;