spectrum: Add getter for propagation delay model

This commit is contained in:
Tom Henderson
2024-01-12 12:24:29 -08:00
parent 93cfd2d701
commit 839c58a7cd
2 changed files with 18 additions and 2 deletions

View File

@@ -19,6 +19,7 @@
#include "spectrum-channel.h"
#include <ns3/abort.h>
#include <ns3/double.h>
#include <ns3/log.h>
#include <ns3/pointer.h>
@@ -167,7 +168,7 @@ SpectrumChannel::GetSpectrumTransmitFilter() const
void
SpectrumChannel::SetPropagationDelayModel(Ptr<PropagationDelayModel> delay)
{
NS_ASSERT(!m_propagationDelay);
NS_ABORT_MSG_IF(m_propagationDelay, "Error, called SetPropagationDelayModel() twice");
m_propagationDelay = delay;
}
@@ -191,4 +192,10 @@ SpectrumChannel::GetPropagationLossModel()
return m_propagationLoss;
}
Ptr<PropagationDelayModel>
SpectrumChannel::GetPropagationDelayModel() const
{
return m_propagationDelay;
}
} // namespace ns3

View File

@@ -92,7 +92,10 @@ class SpectrumChannel : public Channel
Ptr<PhasedArraySpectrumPropagationLossModel> loss);
/**
* Set the propagation delay model to be used
* Set the propagation delay model to be used. This method will abort
* the simulation if there exists a previously set propagation delay model
* (i.e., unlike propagation loss models, multiple of which can be chained
* together, there is only one propagation delay model).
* \param delay Ptr to the propagation delay model to be used.
*/
void SetPropagationDelayModel(Ptr<PropagationDelayModel> delay);
@@ -116,6 +119,12 @@ class SpectrumChannel : public Channel
*/
Ptr<PropagationLossModel> GetPropagationLossModel();
/**
* Get the propagation delay model that has been set on the channel.
* \returns a pointer to the propagation delay model.
*/
Ptr<PropagationDelayModel> GetPropagationDelayModel() const;
/**
* Add the transmit filter to be used to filter possible signal receptions
* at the StartTx() time. This method may be called multiple