A Discrete-Event Network Simulator
API
channel.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License version 2 as
4  * published by the Free Software Foundation;
5  *
6  * This program is distributed in the hope that it will be useful,
7  * but WITHOUT ANY WARRANTY; without even the implied warranty of
8  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9  * GNU General Public License for more details.
10  *
11  * You should have received a copy of the GNU General Public License
12  * along with this program; if not, write to the Free Software
13  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14  */
15 
16 #ifndef NS3_CHANNEL_H
17 #define NS3_CHANNEL_H
18 
19 #include "ns3/object.h"
20 #include "ns3/ptr.h"
21 
22 #include <stdint.h>
23 #include <string>
24 
25 namespace ns3
26 {
27 
28 class NetDevice;
29 
44 class Channel : public Object
45 {
46  public:
51  static TypeId GetTypeId();
52 
53  Channel();
54  ~Channel() override;
55 
62  uint32_t GetId() const;
63 
69  virtual std::size_t GetNDevices() const = 0;
76  virtual Ptr<NetDevice> GetDevice(std::size_t i) const = 0;
77 
78  private:
79  uint32_t m_id;
80 };
81 
82 } // namespace ns3
83 
84 #endif /* NS3_CHANNEL_H */
Abstract Channel Base Class.
Definition: channel.h:45
virtual Ptr< NetDevice > GetDevice(std::size_t i) const =0
uint32_t m_id
Channel id for this channel.
Definition: channel.h:79
uint32_t GetId() const
Definition: channel.cc:61
virtual std::size_t GetNDevices() const =0
static TypeId GetTypeId()
Get the type ID.
Definition: channel.cc:34
~Channel() override
Definition: channel.cc:55
A base class which provides memory management and object aggregation.
Definition: object.h:89
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.