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
* SPDX-License-Identifier: GPL-2.0-only
3
*/
4
5
#ifndef NS3_CHANNEL_H
6
#define NS3_CHANNEL_H
7
8
#include "ns3/object.h"
9
#include "ns3/ptr.h"
10
11
#include <stdint.h>
12
#include <string>
13
14
namespace
ns3
15
{
16
17
class
NetDevice;
18
19
/**
20
* \ingroup network
21
* \defgroup channel Channel
22
*/
23
/**
24
* \ingroup channel
25
* \brief Abstract Channel Base Class.
26
*
27
* A channel is a logical path over which information flows. The path can
28
* be as simple as a short piece of wire, or as complicated as space-time.
29
*
30
* Subclasses must use Simulator::ScheduleWithContext to correctly update
31
* event contexts when scheduling an event from one node to another one.
32
*/
33
class
Channel
:
public
Object
34
{
35
public
:
36
/**
37
* \brief Get the type ID.
38
* \return the object TypeId
39
*/
40
static
TypeId
GetTypeId
();
41
42
Channel
();
43
~Channel
()
override
;
44
45
/**
46
* \returns the unique id of this channel
47
*
48
* This unique id happens to be also the index of the Channel into
49
* the ChannelList.
50
*/
51
uint32_t
GetId
()
const
;
52
53
/**
54
* \returns the number of NetDevices connected to this Channel.
55
*
56
* This method must be implemented by subclasses.
57
*/
58
virtual
std::size_t
GetNDevices
()
const
= 0;
59
/**
60
* \param i index of NetDevice to retrieve
61
* \returns one of the NetDevices connected to this channel.
62
*
63
* This method must be implemented by subclasses.
64
*/
65
virtual
Ptr<NetDevice>
GetDevice
(std::size_t i)
const
= 0;
66
67
private
:
68
uint32_t
m_id
;
//!< Channel id for this channel
69
};
70
71
}
// namespace ns3
72
73
#endif
/* NS3_CHANNEL_H */
ns3::Channel
Abstract Channel Base Class.
Definition
channel.h:34
ns3::Channel::m_id
uint32_t m_id
Channel id for this channel.
Definition
channel.h:68
ns3::Channel::GetDevice
virtual Ptr< NetDevice > GetDevice(std::size_t i) const =0
ns3::Channel::Channel
Channel()
Definition
channel.cc:37
ns3::Channel::GetId
uint32_t GetId() const
Definition
channel.cc:50
ns3::Channel::GetNDevices
virtual std::size_t GetNDevices() const =0
ns3::Channel::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
channel.cc:23
ns3::Channel::~Channel
~Channel() override
Definition
channel.cc:44
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
network
model
channel.h
Generated on Fri Nov 8 2024 13:59:04 for ns-3 by
1.11.0