A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
channel.h
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License version 2 as
5  * published by the Free Software Foundation;
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15  */
16 
17 #ifndef NS3_CHANNEL_H
18 #define NS3_CHANNEL_H
19 
20 #include <string>
21 #include <stdint.h>
22 #include "ns3/object.h"
23 #include "ns3/ptr.h"
24 
25 namespace ns3 {
26 
27 class NetDevice;
28 
43 class Channel : public Object
44 {
45 public:
46  static TypeId GetTypeId (void);
47 
48  Channel ();
49  virtual ~Channel ();
50 
57  uint32_t GetId (void) const;
58 
64  virtual uint32_t GetNDevices (void) const = 0;
71  virtual Ptr<NetDevice> GetDevice (uint32_t i) const = 0;
72 
73 private:
74  uint32_t m_id; // Channel id for this channel
75 };
76 
77 } // namespace ns3
78 
79 #endif /* NS3_CHANNEL_H */
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
Abstract Channel Base Class.
Definition: channel.h:43
uint32_t GetId(void) const
Definition: channel.cc:58
virtual Ptr< NetDevice > GetDevice(uint32_t i) const =0
virtual uint32_t GetNDevices(void) const =0
a base class which provides memory management and object aggregation
Definition: object.h:63
a unique identifier for an interface.
Definition: type-id.h:44