A Discrete-Event Network Simulator
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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Nicola Baldo <nbaldo@cttc.es>
7 */
8
9#ifndef SINGLE_MODEL_SPECTRUM_CHANNEL_H
10#define SINGLE_MODEL_SPECTRUM_CHANNEL_H
11
12#include "spectrum-channel.h"
13#include "spectrum-model.h"
14
15#include <ns3/traced-callback.h>
16
17namespace ns3
18{
19
20/**
21 * \ingroup spectrum
22 *
23 * \brief SpectrumChannel implementation which handles a single spectrum model
24 *
25 * All SpectrumPhy layers attached to this SpectrumChannel
26 */
28{
29 public:
31
32 /**
33 * \brief Get the type ID.
34 * \return the object TypeId
35 */
36 static TypeId GetTypeId();
37
38 // inherited from SpectrumChannel
39 void RemoveRx(Ptr<SpectrumPhy> phy) override;
40 void AddRx(Ptr<SpectrumPhy> phy) override;
41 void StartTx(Ptr<SpectrumSignalParameters> params) override;
42
43 // inherited from Channel
44 std::size_t GetNDevices() const override;
45 Ptr<NetDevice> GetDevice(std::size_t i) const override;
46
47 /// Container: SpectrumPhy objects
48 typedef std::vector<Ptr<SpectrumPhy>> PhyList;
49
50 private:
51 void DoDispose() override;
52
53 /**
54 * Used internally to reschedule transmission after the propagation delay.
55 *
56 * \param params
57 * \param receiver
58 */
60
61 /**
62 * List of SpectrumPhy instances attached to the channel.
63 */
65
66 /**
67 * SpectrumModel that this channel instance is supporting.
68 */
70};
71
72} // namespace ns3
73
74#endif /* SINGLE_MODEL_SPECTRUM_CHANNEL_H */
Smart pointer class similar to boost::intrusive_ptr.
SpectrumChannel implementation which handles a single spectrum model.
Ptr< const SpectrumModel > m_spectrumModel
SpectrumModel that this channel instance is supporting.
PhyList m_phyList
List of SpectrumPhy instances attached to the channel.
void StartTx(Ptr< SpectrumSignalParameters > params) override
Used by attached PHY instances to transmit signals on the channel.
void DoDispose() override
Destructor implementation.
void RemoveRx(Ptr< SpectrumPhy > phy) override
Remove a SpectrumPhy from a channel.
void AddRx(Ptr< SpectrumPhy > phy) override
Add a SpectrumPhy to a channel, so it can receive packets.
Ptr< NetDevice > GetDevice(std::size_t i) const override
void StartRx(Ptr< SpectrumSignalParameters > params, Ptr< SpectrumPhy > receiver)
Used internally to reschedule transmission after the propagation delay.
static TypeId GetTypeId()
Get the type ID.
std::vector< Ptr< SpectrumPhy > > PhyList
Container: SpectrumPhy objects.
Defines the interface for spectrum-aware channel implementations.
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.