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
single-model-spectrum-channel.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009 CTTC
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Nicola Baldo <nbaldo@cttc.es>
18
*/
19
20
#ifndef SINGLE_MODEL_SPECTRUM_CHANNEL_H
21
#define SINGLE_MODEL_SPECTRUM_CHANNEL_H
22
23
#include "
spectrum-channel.h
"
24
#include "
spectrum-model.h
"
25
26
#include <ns3/traced-callback.h>
27
28
namespace
ns3
29
{
30
31
/**
32
* \ingroup spectrum
33
*
34
* \brief SpectrumChannel implementation which handles a single spectrum model
35
*
36
* All SpectrumPhy layers attached to this SpectrumChannel
37
*/
38
class
SingleModelSpectrumChannel
:
public
SpectrumChannel
39
{
40
public
:
41
SingleModelSpectrumChannel
();
42
43
/**
44
* \brief Get the type ID.
45
* \return the object TypeId
46
*/
47
static
TypeId
GetTypeId
();
48
49
// inherited from SpectrumChannel
50
void
RemoveRx
(
Ptr<SpectrumPhy>
phy)
override
;
51
void
AddRx
(
Ptr<SpectrumPhy>
phy)
override
;
52
void
StartTx
(
Ptr<SpectrumSignalParameters>
params)
override
;
53
54
// inherited from Channel
55
std::size_t
GetNDevices
()
const override
;
56
Ptr<NetDevice>
GetDevice
(std::size_t i)
const override
;
57
58
/// Container: SpectrumPhy objects
59
typedef
std::vector<Ptr<SpectrumPhy>>
PhyList
;
60
61
private
:
62
void
DoDispose
()
override
;
63
64
/**
65
* Used internally to reschedule transmission after the propagation delay.
66
*
67
* \param params
68
* \param receiver
69
*/
70
void
StartRx
(
Ptr<SpectrumSignalParameters>
params,
Ptr<SpectrumPhy>
receiver);
71
72
/**
73
* List of SpectrumPhy instances attached to the channel.
74
*/
75
PhyList
m_phyList
;
76
77
/**
78
* SpectrumModel that this channel instance is supporting.
79
*/
80
Ptr<const SpectrumModel>
m_spectrumModel
;
81
};
82
83
}
// namespace ns3
84
85
#endif
/* SINGLE_MODEL_SPECTRUM_CHANNEL_H */
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::SingleModelSpectrumChannel
SpectrumChannel implementation which handles a single spectrum model.
Definition:
single-model-spectrum-channel.h:39
ns3::SingleModelSpectrumChannel::m_spectrumModel
Ptr< const SpectrumModel > m_spectrumModel
SpectrumModel that this channel instance is supporting.
Definition:
single-model-spectrum-channel.h:80
ns3::SingleModelSpectrumChannel::m_phyList
PhyList m_phyList
List of SpectrumPhy instances attached to the channel.
Definition:
single-model-spectrum-channel.h:75
ns3::SingleModelSpectrumChannel::StartTx
void StartTx(Ptr< SpectrumSignalParameters > params) override
Used by attached PHY instances to transmit signals on the channel.
Definition:
single-model-spectrum-channel.cc:101
ns3::SingleModelSpectrumChannel::DoDispose
void DoDispose() override
Destructor implementation.
Definition:
single-model-spectrum-channel.cc:55
ns3::SingleModelSpectrumChannel::RemoveRx
void RemoveRx(Ptr< SpectrumPhy > phy) override
Remove a SpectrumPhy from a channel.
Definition:
single-model-spectrum-channel.cc:75
ns3::SingleModelSpectrumChannel::SingleModelSpectrumChannel
SingleModelSpectrumChannel()
Definition:
single-model-spectrum-channel.cc:49
ns3::SingleModelSpectrumChannel::AddRx
void AddRx(Ptr< SpectrumPhy > phy) override
Add a SpectrumPhy to a channel, so it can receive packets.
Definition:
single-model-spectrum-channel.cc:86
ns3::SingleModelSpectrumChannel::GetDevice
Ptr< NetDevice > GetDevice(std::size_t i) const override
Definition:
single-model-spectrum-channel.cc:256
ns3::SingleModelSpectrumChannel::GetNDevices
std::size_t GetNDevices() const override
Definition:
single-model-spectrum-channel.cc:249
ns3::SingleModelSpectrumChannel::StartRx
void StartRx(Ptr< SpectrumSignalParameters > params, Ptr< SpectrumPhy > receiver)
Used internally to reschedule transmission after the propagation delay.
Definition:
single-model-spectrum-channel.cc:235
ns3::SingleModelSpectrumChannel::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
single-model-spectrum-channel.cc:64
ns3::SingleModelSpectrumChannel::PhyList
std::vector< Ptr< SpectrumPhy > > PhyList
Container: SpectrumPhy objects.
Definition:
single-model-spectrum-channel.h:59
ns3::SpectrumChannel
Defines the interface for spectrum-aware channel implementations.
Definition:
spectrum-channel.h:50
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
spectrum-channel.h
spectrum-model.h
src
spectrum
model
single-model-spectrum-channel.h
Generated on Tue May 28 2024 23:39:18 for ns-3 by
1.9.6