X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9b67f9757c2b3384bb3c0e8ef256fbdf6c2e7821..2c8e75834bbb63acef15c560c3de978ab3cb6fbf:/src/surf/gtnets/gtnets_topology.h diff --git a/src/surf/gtnets/gtnets_topology.h b/src/surf/gtnets/gtnets_topology.h index b233d7e7e7..d73d6b1fcc 100644 --- a/src/surf/gtnets/gtnets_topology.h +++ b/src/surf/gtnets/gtnets_topology.h @@ -1,6 +1,7 @@ /* $ID$ */ -/* Copyright (c) 2007 Kayo Fujiwara. All rights reserved. */ +/* Copyright (c) 2007, 2009, 2010. The SimGrid Team. + * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -18,47 +19,51 @@ using namespace std; class GTNETS_Link; -class GTNETS_Node{ +class GTNETS_Node { - public: +public: GTNETS_Node(int); - GTNETS_Node(const GTNETS_Node& node); - ~GTNETS_Node(); + GTNETS_Node(const GTNETS_Node & node); + ~GTNETS_Node(); int add_host(int); int add_router(int); - int id(){return ID_;}; + int id() { + return ID_; + }; bool is_router(); bool include(int); void print_hosts(); - private: +private: int ID_; int is_router_; - set hosts_; //simgrid hosts + set < int >hosts_; //simgrid hosts }; -class GTNETS_Link{ +class GTNETS_Link { - public: +public: GTNETS_Link(); GTNETS_Link(int id); - GTNETS_Link(const GTNETS_Link&); - ~GTNETS_Link(); + GTNETS_Link(const GTNETS_Link &); + ~GTNETS_Link(); - GTNETS_Node* src_node(); - GTNETS_Node* dst_node(); + GTNETS_Node *src_node(); + GTNETS_Node *dst_node(); int peer_node(int); - int id(){return ID_;}; + int id() { + return ID_; + }; void print_link_status(); - int add_src(GTNETS_Node*); - int add_dst(GTNETS_Node*); + int add_src(GTNETS_Node *); + int add_dst(GTNETS_Node *); bool route_exists(); - private: +private: int ID_; - GTNETS_Node* src_node_; - GTNETS_Node* dst_node_; + GTNETS_Node *src_node_; + GTNETS_Node *dst_node_; }; @@ -66,8 +71,8 @@ class GTNETS_Link{ // 1. add links // 2. add routers // 3. add onehop links -class GTNETS_Topology{ - public: +class GTNETS_Topology { +public: GTNETS_Topology(); ~GTNETS_Topology(); @@ -76,23 +81,23 @@ class GTNETS_Topology{ int add_link(int id); int add_router(int id); int add_onehop_route(int src, int dst, int link); - + int nodeid_from_hostid(int); int link_size(); int node_size(); void print_topology(); - const vector& nodes(); - const map& links(); - - private: + const vector < GTNETS_Node * >&nodes(); + const map < int, GTNETS_Link * >&links(); + +private: int nodeID_; - map links_; - vector nodes_; + map < int, GTNETS_Link * >links_; + vector < GTNETS_Node * >nodes_; - map hosts_; //hostid->nodeid + map < int, int >hosts_; //hostid->nodeid - set routers_; + set < int >routers_; }; #endif