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
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
12
namespace
ns3
13
{
14
15
struct
SpectrumSignalParameters;
16
class
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
*/
28
class
SpectrumTransmitFilter
:
public
Object
29
{
30
public
:
31
SpectrumTransmitFilter
();
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
*/
45
void
SetNext
(
Ptr<SpectrumTransmitFilter>
next);
46
47
/**
48
* Return the next transmit filter in the chain
49
*
50
* \return next transmit filter in the chain
51
*/
52
Ptr<const SpectrumTransmitFilter>
GetNext
()
const
;
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
*/
64
bool
Filter
(
Ptr<const SpectrumSignalParameters>
params,
Ptr<const SpectrumPhy>
receiverPhy);
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
*/
102
virtual
bool
DoFilter
(
Ptr<const SpectrumSignalParameters>
params,
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 */
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::SpectrumTransmitFilter
spectrum-aware transmit filter object
Definition
spectrum-transmit-filter.h:29
ns3::SpectrumTransmitFilter::Filter
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...
Definition
spectrum-transmit-filter.cc:60
ns3::SpectrumTransmitFilter::AssignStreams
int64_t AssignStreams(int64_t stream)
If this loss model uses objects of type RandomVariableStream, set the stream numbers to the integers ...
Definition
spectrum-transmit-filter.cc:80
ns3::SpectrumTransmitFilter::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
spectrum-transmit-filter.cc:23
ns3::SpectrumTransmitFilter::DoFilter
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...
ns3::SpectrumTransmitFilter::GetNext
Ptr< const SpectrumTransmitFilter > GetNext() const
Return the next transmit filter in the chain.
Definition
spectrum-transmit-filter.cc:54
ns3::SpectrumTransmitFilter::DoAssignStreams
virtual int64_t DoAssignStreams(int64_t stream)=0
Assign a fixed random variable stream number to the random variables used by this model.
ns3::SpectrumTransmitFilter::SpectrumTransmitFilter
SpectrumTransmitFilter()
Definition
spectrum-transmit-filter.cc:30
ns3::SpectrumTransmitFilter::SetNext
void SetNext(Ptr< SpectrumTransmitFilter > next)
Add a transmit filter to be consulted next if this filter does not filter the signal.
Definition
spectrum-transmit-filter.cc:48
ns3::SpectrumTransmitFilter::m_next
Ptr< SpectrumTransmitFilter > m_next
SpectrumTransmitFilter chained to this one.
Definition
spectrum-transmit-filter.h:105
ns3::SpectrumTransmitFilter::DoDispose
void DoDispose() override
Destructor implementation.
Definition
spectrum-transmit-filter.cc:36
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
spectrum
model
spectrum-transmit-filter.h
Generated on Fri Nov 8 2024 13:59:06 for ns-3 by
1.11.0