Ilya Moiseenko | 1eff17d | 2011-08-17 10:55:53 -0700 | [diff] [blame] | 1 | /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2011 University of California, Los Angeles |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License version 2 as |
| 7 | * published by the Free Software Foundation; |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 | * |
| 18 | * Author: Ilya Moiseenko <iliamo@cs.ucla.edu> |
| 19 | */ |
| 20 | |
| 21 | #ifndef __ANNOTATED_TOPOLOGY_READER_H__ |
| 22 | #define __ANNOTATED_TOPOLOGY_READER_H__ |
| 23 | |
| 24 | #include "ns3/nstime.h" |
| 25 | #include "ns3/topology-reader.h" |
| 26 | |
| 27 | namespace ns3 |
| 28 | { |
| 29 | /** |
| 30 | * Input File Format |
| 31 | * 1st line is NumberOfNodes TAB NumberofLinks |
| 32 | * Nth line is NodeID1 TAB NodeID2 TAB DataRateKBPS TAB DelayMiliseconds TAB QueueSizeInPackets1 TAB QueueSizeInPackets2 |
| 33 | * |
| 34 | */ |
| 35 | class AnnotatedTopologyReader : public TopologyReader |
| 36 | { |
| 37 | public: |
| 38 | typedef std::list< Link >::iterator LinksIterator; |
| 39 | static TypeId GetTypeId (void); |
| 40 | |
| 41 | AnnotatedTopologyReader (); |
| 42 | virtual ~AnnotatedTopologyReader (); |
| 43 | |
| 44 | /** |
| 45 | * \brief Main topology reading function. |
| 46 | * |
| 47 | * This method opens an input stream and reads the Orbis-format file. |
| 48 | * Every row represents a topology link (the ids of a couple of nodes), |
| 49 | * so the input file is read line by line to figure out how many links |
| 50 | * and nodes are in the topology. |
| 51 | * |
| 52 | * \return the container of the nodes created (or empty container if there was an error) |
| 53 | */ |
| 54 | virtual NodeContainer Read (void); |
| 55 | |
| 56 | private: |
| 57 | AnnotatedTopologyReader (const AnnotatedTopologyReader&); |
| 58 | AnnotatedTopologyReader& operator= (const AnnotatedTopologyReader&); |
| 59 | }; |
| 60 | } |
| 61 | |
| 62 | |
| 63 | #endif |
| 64 | |
| 65 | |