A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
spectrum-phy.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 SPECTRUM_PHY_H
21#define SPECTRUM_PHY_H
22
23#include <ns3/nstime.h>
24#include <ns3/object.h>
25
26namespace ns3
27{
28
29class PacketBurst;
30class SpectrumChannel;
31class MobilityModel;
32class AntennaModel;
33class PhasedArrayModel;
34class SpectrumValue;
35class SpectrumModel;
36class NetDevice;
37struct SpectrumSignalParameters;
38
39/**
40 * \ingroup spectrum
41 *
42 * Abstract base class for Spectrum-aware PHY layers
43 *
44 */
45class SpectrumPhy : public Object
46{
47 public:
49 ~SpectrumPhy() override;
50
51 // Delete copy constructor and assignment operator to avoid misuse
52 SpectrumPhy(const SpectrumPhy&) = delete;
54
55 /**
56 * \brief Get the type ID.
57 * \return the object TypeId
58 */
59 static TypeId GetTypeId();
60
61 /**
62 * Set the associated NetDevice instance
63 *
64 * @param d the NetDevice instance
65 */
66 virtual void SetDevice(Ptr<NetDevice> d) = 0;
67
68 /**
69 * Get the associated NetDevice instance
70 *
71 * @return a Ptr to the associated NetDevice instance
72 */
73 virtual Ptr<NetDevice> GetDevice() const = 0;
74
75 /**
76 * Set the mobility model associated with this device.
77 *
78 * @param m the mobility model
79 */
80 virtual void SetMobility(Ptr<MobilityModel> m) = 0;
81
82 /**
83 * Get the associated MobilityModel instance
84 *
85 * @return a Ptr to the associated MobilityModel instance
86 */
87 virtual Ptr<MobilityModel> GetMobility() const = 0;
88
89 /**
90 * Set the channel attached to this device.
91 *
92 * @param c the channel
93 */
94 virtual void SetChannel(Ptr<SpectrumChannel> c) = 0;
95
96 /**
97 *
98 * @return returns the SpectrumModel that this SpectrumPhy expects to be used
99 * for all SpectrumValues that are passed to StartRx. If 0 is
100 * returned, it means that any model will be accepted.
101 */
103
104 /**
105 * \brief Get the AntennaModel used by this SpectrumPhy instance for
106 * transmission and/or reception
107 *
108 * Note that in general and depending on each module design, there can be
109 * multiple SpectrumPhy instances per NetDevice.
110 *
111 * @return a Ptr to the AntennaModel used by this SpectrumPhy instance for
112 * transmission and/or reception
113 */
114 virtual Ptr<Object> GetAntenna() const = 0;
115
116 /**
117 * Notify the SpectrumPhy instance of an incoming signal
118 *
119 * @param params the parameters of the signals being received
120 */
121 virtual void StartRx(Ptr<SpectrumSignalParameters> params) = 0;
122};
123} // namespace ns3
124
125#endif /* SPECTRUM_PHY_H */
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
Abstract base class for Spectrum-aware PHY layers.
Definition: spectrum-phy.h:46
virtual Ptr< MobilityModel > GetMobility() const =0
Get the associated MobilityModel instance.
virtual void SetMobility(Ptr< MobilityModel > m)=0
Set the mobility model associated with this device.
virtual Ptr< Object > GetAntenna() const =0
Get the AntennaModel used by this SpectrumPhy instance for transmission and/or reception.
SpectrumPhy & operator=(const SpectrumPhy &)=delete
virtual Ptr< NetDevice > GetDevice() const =0
Get the associated NetDevice instance.
virtual void StartRx(Ptr< SpectrumSignalParameters > params)=0
Notify the SpectrumPhy instance of an incoming signal.
~SpectrumPhy() override
Definition: spectrum-phy.cc:48
SpectrumPhy(const SpectrumPhy &)=delete
virtual Ptr< const SpectrumModel > GetRxSpectrumModel() const =0
static TypeId GetTypeId()
Get the type ID.
Definition: spectrum-phy.cc:37
virtual void SetChannel(Ptr< SpectrumChannel > c)=0
Set the channel attached to this device.
virtual void SetDevice(Ptr< NetDevice > d)=0
Set the associated NetDevice instance.
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.