00001 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ 00002 /* 00003 * This program is free software; you can redistribute it and/or modify 00004 * it under the terms of the GNU General Public License version 2 as 00005 * published by the Free Software Foundation; 00006 * 00007 * This program is distributed in the hope that it will be useful, 00008 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00009 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00010 * GNU General Public License for more details. 00011 * 00012 * You should have received a copy of the GNU General Public License 00013 * along with this program; if not, write to the Free Software 00014 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00015 */ 00016 00017 #ifndef NS3_CHANNEL_H 00018 #define NS3_CHANNEL_H 00019 00020 #include <string> 00021 #include <stdint.h> 00022 #include "ns3/object.h" 00023 #include "ns3/ptr.h" 00024 00025 namespace ns3 { 00026 00027 class NetDevice; 00028 00029 /** 00030 * \ingroup node 00031 * \defgroup channel Channel 00032 */ 00033 /** 00034 * \ingroup channel 00035 * \brief Abstract Channel Base Class. 00036 * 00037 * A channel is a logical path over which information flows. The path can 00038 * be as simple as a short piece of wire, or as complicated as space-time. 00039 */ 00040 class Channel : public Object 00041 { 00042 public: 00043 static TypeId GetTypeId (void); 00044 00045 Channel (); 00046 Channel (std::string name); 00047 virtual ~Channel (); 00048 00049 void SetName(std::string); 00050 std::string GetName(void); 00051 00052 /** 00053 * \returns the number of NetDevices connected to this Channel. 00054 * 00055 * This method must be implemented by subclasses. 00056 */ 00057 virtual uint32_t GetNDevices (void) const = 0; 00058 /** 00059 * \param i index of NetDevice to retrieve 00060 * \returns one of the NetDevices connected to this channel. 00061 * 00062 * This method must be implemented by subclasses. 00063 */ 00064 virtual Ptr<NetDevice> GetDevice (uint32_t i) const = 0; 00065 00066 private: 00067 std::string m_name; 00068 }; 00069 00070 }; // namespace ns3 00071 00072 #endif /* NS3_CHANNEL_H */