A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
spectrum-transmit-filter.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 University of Washington
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 */
6
7#ifndef SPECTRUM_TRANSMIT_FILTER_H
8#define SPECTRUM_TRANSMIT_FILTER_H
9
10#include <ns3/object.h>
11
12namespace ns3
13{
14
15struct SpectrumSignalParameters;
16class SpectrumPhy;
17
18/**
19 * \ingroup spectrum
20 *
21 * \brief spectrum-aware transmit filter object
22 *
23 * Interface for transmit filters that permit an early discard of signal
24 * reception before propagation loss models or receiving Phy objects have
25 * to process the signal, for performance optimization purposes.
26 *
27 */
29{
30 public:
32
33 /**
34 * \brief Get the type ID.
35 * \return the object TypeId
36 */
37 static TypeId GetTypeId();
38
39 /**
40 * Add a transmit filter to be consulted next if this filter does not
41 * filter the signal
42 *
43 * \param next next transmit filter to add to the chain
44 */
46
47 /**
48 * Return the next transmit filter in the chain
49 *
50 * \return next transmit filter in the chain
51 */
53
54 /**
55 * Evaluate whether the signal to be scheduled on the receiving Phy should
56 * instead be filtered (discarded) before being processed in this channel
57 * and on the receiving Phy.
58 *
59 * \param params the spectrum signal parameters.
60 * \param receiverPhy pointer to the receiving SpectrumPhy
61 *
62 * \return whether to perform filtering of the signal
63 */
65
66 /**
67 * If this loss model uses objects of type RandomVariableStream,
68 * set the stream numbers to the integers starting with the offset
69 * 'stream'. Return the number of streams (possibly zero) that
70 * have been assigned. If there are SpectrumTransmitFilters chained
71 * together, this method will also assign streams to the
72 * downstream models.
73 *
74 * \param stream the stream index offset start
75 * \return the number of stream indices assigned by this model
76 */
77 int64_t AssignStreams(int64_t stream);
78
79 protected:
80 void DoDispose() override;
81 /**
82 * Assign a fixed random variable stream number to the random variables used by this model.
83 *
84 * Subclasses must implement this; those not using random variables can return zero.
85 *
86 * \param stream first stream index to use
87 * \return the number of stream indices assigned by this model
88 */
89 virtual int64_t DoAssignStreams(int64_t stream) = 0;
90
91 private:
92 /**
93 * Evaluate whether the signal to be scheduled on the receiving Phy should
94 * instead be filtered (discarded) before being processed in this channel
95 * and on the receiving Phy.
96 *
97 * \param params the spectrum signal parameters.
98 * \param receiverPhy pointer to the receiving SpectrumPhy
99 *
100 * \return whether to perform filtering of the signal
101 */
103 Ptr<const SpectrumPhy> receiverPhy) = 0;
104
105 Ptr<SpectrumTransmitFilter> m_next{nullptr}; //!< SpectrumTransmitFilter chained to this one.
106};
107
108} // namespace ns3
109
110#endif /* SPECTRUM_TRANSMIT_FILTER_H */
A base class which provides memory management and object aggregation.
Definition object.h:78
Smart pointer class similar to boost::intrusive_ptr.
spectrum-aware transmit filter object
bool Filter(Ptr< const SpectrumSignalParameters > params, Ptr< const SpectrumPhy > receiverPhy)
Evaluate whether the signal to be scheduled on the receiving Phy should instead be filtered (discarde...
int64_t AssignStreams(int64_t stream)
If this loss model uses objects of type RandomVariableStream, set the stream numbers to the integers ...
static TypeId GetTypeId()
Get the type ID.
virtual bool DoFilter(Ptr< const SpectrumSignalParameters > params, Ptr< const SpectrumPhy > receiverPhy)=0
Evaluate whether the signal to be scheduled on the receiving Phy should instead be filtered (discarde...
Ptr< const SpectrumTransmitFilter > GetNext() const
Return the next transmit filter in the chain.
virtual int64_t DoAssignStreams(int64_t stream)=0
Assign a fixed random variable stream number to the random variables used by this model.
void SetNext(Ptr< SpectrumTransmitFilter > next)
Add a transmit filter to be consulted next if this filter does not filter the signal.
Ptr< SpectrumTransmitFilter > m_next
SpectrumTransmitFilter chained to this one.
void DoDispose() override
Destructor implementation.
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.