A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
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
30
/**
31
* \ingroup network
32
* \defgroup channel Channel
33
*/
34
/**
35
* \ingroup channel
36
* \brief Abstract Channel Base Class.
37
*
38
* A channel is a logical path over which information flows. The path can
39
* be as simple as a short piece of wire, or as complicated as space-time.
40
*
41
* Subclasses must use Simulator::ScheduleWithContext to correctly update
42
* event contexts when scheduling an event from one node to another one.
43
*/
44
class
Channel
:
public
Object
45
{
46
public
:
47
/**
48
* \brief Get the type ID.
49
* \return the object TypeId
50
*/
51
static
TypeId
GetTypeId
();
52
53
Channel
();
54
~Channel
()
override
;
55
56
/**
57
* \returns the unique id of this channel
58
*
59
* This unique id happens to be also the index of the Channel into
60
* the ChannelList.
61
*/
62
uint32_t
GetId
()
const
;
63
64
/**
65
* \returns the number of NetDevices connected to this Channel.
66
*
67
* This method must be implemented by subclasses.
68
*/
69
virtual
std::size_t
GetNDevices
()
const
= 0;
70
/**
71
* \param i index of NetDevice to retrieve
72
* \returns one of the NetDevices connected to this channel.
73
*
74
* This method must be implemented by subclasses.
75
*/
76
virtual
Ptr<NetDevice>
GetDevice
(std::size_t i)
const
= 0;
77
78
private
:
79
uint32_t
m_id
;
//!< Channel id for this channel
80
};
81
82
}
// namespace ns3
83
84
#endif
/* NS3_CHANNEL_H */
ns3::Channel
Abstract Channel Base Class.
Definition:
channel.h:45
ns3::Channel::m_id
uint32_t m_id
Channel id for this channel.
Definition:
channel.h:79
ns3::Channel::GetDevice
virtual Ptr< NetDevice > GetDevice(std::size_t i) const =0
ns3::Channel::Channel
Channel()
Definition:
channel.cc:48
ns3::Channel::GetId
uint32_t GetId() const
Definition:
channel.cc:61
ns3::Channel::GetNDevices
virtual std::size_t GetNDevices() const =0
ns3::Channel::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
channel.cc:34
ns3::Channel::~Channel
~Channel() override
Definition:
channel.cc:55
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:89
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
network
model
channel.h
Generated on Tue May 28 2024 23:38:30 for ns-3 by
1.9.6