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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Nicola Baldo <nbaldo@cttc.es>
7 */
8
9#ifndef SPECTRUM_PHY_H
10#define SPECTRUM_PHY_H
11
12#include <ns3/nstime.h>
13#include <ns3/object.h>
14
15namespace ns3
16{
17
18class PacketBurst;
19class SpectrumChannel;
20class MobilityModel;
21class AntennaModel;
22class PhasedArrayModel;
23class SpectrumValue;
24class SpectrumModel;
25class NetDevice;
26struct SpectrumSignalParameters;
27
28/**
29 * \ingroup spectrum
30 *
31 * Abstract base class for Spectrum-aware PHY layers
32 *
33 */
34class SpectrumPhy : public Object
35{
36 public:
38 ~SpectrumPhy() override;
39
40 // Delete copy constructor and assignment operator to avoid misuse
41 SpectrumPhy(const SpectrumPhy&) = delete;
43
44 /**
45 * \brief Get the type ID.
46 * \return the object TypeId
47 */
48 static TypeId GetTypeId();
49
50 /**
51 * Set the associated NetDevice instance
52 *
53 * @param d the NetDevice instance
54 */
55 virtual void SetDevice(Ptr<NetDevice> d) = 0;
56
57 /**
58 * Get the associated NetDevice instance
59 *
60 * @return a Ptr to the associated NetDevice instance
61 */
62 virtual Ptr<NetDevice> GetDevice() const = 0;
63
64 /**
65 * Set the mobility model associated with this device.
66 *
67 * @param m the mobility model
68 */
69 virtual void SetMobility(Ptr<MobilityModel> m) = 0;
70
71 /**
72 * Get the associated MobilityModel instance
73 *
74 * @return a Ptr to the associated MobilityModel instance
75 */
76 virtual Ptr<MobilityModel> GetMobility() const = 0;
77
78 /**
79 * Set the channel attached to this device.
80 *
81 * @param c the channel
82 */
83 virtual void SetChannel(Ptr<SpectrumChannel> c) = 0;
84
85 /**
86 *
87 * @return returns the SpectrumModel that this SpectrumPhy expects to be used
88 * for all SpectrumValues that are passed to StartRx. If 0 is
89 * returned, it means that any model will be accepted.
90 */
92
93 /**
94 * \brief Get the AntennaModel used by this SpectrumPhy instance for
95 * transmission and/or reception
96 *
97 * Note that in general and depending on each module design, there can be
98 * multiple SpectrumPhy instances per NetDevice.
99 *
100 * @return a Ptr to the AntennaModel used by this SpectrumPhy instance for
101 * transmission and/or reception
102 */
103 virtual Ptr<Object> GetAntenna() const = 0;
104
105 /**
106 * Notify the SpectrumPhy instance of an incoming signal
107 *
108 * @param params the parameters of the signals being received
109 */
110 virtual void StartRx(Ptr<SpectrumSignalParameters> params) = 0;
111};
112} // namespace ns3
113
114#endif /* SPECTRUM_PHY_H */
A base class which provides memory management and object aggregation.
Definition object.h:78
Smart pointer class similar to boost::intrusive_ptr.
Abstract base class for Spectrum-aware PHY layers.
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
SpectrumPhy(const SpectrumPhy &)=delete
virtual Ptr< const SpectrumModel > GetRxSpectrumModel() const =0
static TypeId GetTypeId()
Get the type ID.
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:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.