SpectrumChannel implementation which handles a single spectrum model. More...
#include "single-model-spectrum-channel.h"
Public Types | |
typedef std::vector< Ptr< SpectrumPhy > > | PhyList |
Container: SpectrumPhy objects. More... | |
![]() | |
typedef void(* | GainTracedCallback) (Ptr< const MobilityModel > txMobility, Ptr< const MobilityModel > rxMobility, double txAntennaGain, double rxAntennaGain, double propagationGain, double pathloss) |
TracedCallback signature for path loss calculation events. More... | |
typedef void(* | LossTracedCallback) (Ptr< const SpectrumPhy > txPhy, Ptr< const SpectrumPhy > rxPhy, double lossDb) |
TracedCallback signature for path loss calculation events. More... | |
typedef void(* | SignalParametersTracedCallback) (Ptr< SpectrumSignalParameters > params) |
TracedCallback signature for Ptr<const SpectrumSignalParameters>. More... | |
Public Member Functions | |
SingleModelSpectrumChannel () | |
virtual void | AddRx (Ptr< SpectrumPhy > phy) |
Add a SpectrumPhy to a channel, so it can receive packets. More... | |
virtual Ptr< NetDevice > | GetDevice (std::size_t i) const |
virtual std::size_t | GetNDevices (void) const |
virtual void | RemoveRx (Ptr< SpectrumPhy > phy) |
Remove a SpectrumPhy from a channel. More... | |
virtual void | StartTx (Ptr< SpectrumSignalParameters > params) |
Used by attached PHY instances to transmit signals on the channel. More... | |
![]() | |
SpectrumChannel () | |
constructor More... | |
virtual | ~SpectrumChannel () |
destructor More... | |
void | AddPhasedArraySpectrumPropagationLossModel (Ptr< PhasedArraySpectrumPropagationLossModel > loss) |
Add the frequency-dependent propagation loss model that is compapatible with the phased antenna arrays at the TX and RX. More... | |
void | AddPropagationLossModel (Ptr< PropagationLossModel > loss) |
Add the single-frequency propagation loss model to be used. More... | |
void | AddSpectrumPropagationLossModel (Ptr< SpectrumPropagationLossModel > loss) |
Add the frequency-dependent propagation loss model to be used. More... | |
Ptr< PhasedArraySpectrumPropagationLossModel > | GetPhasedArraySpectrumPropagationLossModel (void) |
Get the frequency-dependent propagation loss model that is compatible with the phased antenna arrays at TX and RX. More... | |
Ptr< PropagationLossModel > | GetPropagationLossModel (void) |
Get the propagation loss model. More... | |
Ptr< SpectrumPropagationLossModel > | GetSpectrumPropagationLossModel (void) |
Get the frequency-dependent propagation loss model. More... | |
void | SetPropagationDelayModel (Ptr< PropagationDelayModel > delay) |
Set the propagation delay model to be used. More... | |
![]() | |
Channel () | |
virtual | ~Channel () |
uint32_t | GetId (void) const |
![]() | |
Object () | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose (void) |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator (void) const |
Get an iterator to the Objects aggregated to this one. More... | |
virtual TypeId | GetInstanceTypeId (void) const |
Get the most derived TypeId for this Object. More... | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. More... | |
void | Initialize (void) |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized (void) const |
Check if the object has been initialized. More... | |
![]() | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= ([[maybe_unused]] const SimpleRefCount &o) |
Assignment operator. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
![]() | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising erros. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. More... | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. More... | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. More... | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. More... | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. More... | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Private Member Functions | |
virtual void | DoDispose () |
Destructor implementation. More... | |
void | StartRx (Ptr< SpectrumSignalParameters > params, Ptr< SpectrumPhy > receiver) |
Used internally to reschedule transmission after the propagation delay. More... | |
Private Attributes | |
PhyList | m_phyList |
List of SpectrumPhy instances attached to the channel. More... | |
Ptr< const SpectrumModel > | m_spectrumModel |
SpectrumModel that this channel instance is supporting. More... | |
Additional Inherited Members | |
![]() | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoInitialize (void) |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate (void) |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
![]() | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted (void) |
Notifier called once the ObjectBase is fully constructed. More... | |
![]() | |
TracedCallback< Ptr< const MobilityModel >, Ptr< const MobilityModel >, double, double, double, double > | m_gainTrace |
The Gain trace source. More... | |
double | m_maxLossDb |
Maximum loss [dB]. More... | |
TracedCallback< Ptr< const SpectrumPhy >, Ptr< const SpectrumPhy >, double > | m_pathLossTrace |
The PathLoss trace source. More... | |
Ptr< PhasedArraySpectrumPropagationLossModel > | m_phasedArraySpectrumPropagationLoss |
Frequency-dependent propagation loss model to be used with this channel. More... | |
Ptr< PropagationDelayModel > | m_propagationDelay |
Propagation delay model to be used with this channel. More... | |
Ptr< PropagationLossModel > | m_propagationLoss |
Single-frequency propagation loss model to be used with this channel. More... | |
Ptr< SpectrumPropagationLossModel > | m_spectrumPropagationLoss |
Frequency-dependent propagation loss model to be used with this channel. More... | |
TracedCallback< Ptr< SpectrumSignalParameters > > | m_txSigParamsTrace |
Traced callback for SpectrumSignalParameters in StartTx requests. More... | |
![]() | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
SpectrumChannel implementation which handles a single spectrum model.
All SpectrumPhy layers attached to this SpectrumChannel
ns3::SingleModelSpectrumChannel is accessible through the following paths with Config::Set and Config::Connect:
No Attributes are defined for this type.
No TraceSources are defined for this type.
Size of this type is 176 bytes (on a 64-bit architecture).
Definition at line 40 of file single-model-spectrum-channel.h.
typedef std::vector<Ptr<SpectrumPhy> > ns3::SingleModelSpectrumChannel::PhyList |
Container: SpectrumPhy objects.
Definition at line 63 of file single-model-spectrum-channel.h.
ns3::SingleModelSpectrumChannel::SingleModelSpectrumChannel | ( | ) |
Definition at line 48 of file single-model-spectrum-channel.cc.
References NS_LOG_FUNCTION.
|
virtual |
Add a SpectrumPhy to a channel, so it can receive packets.
This method is used to attach a SpectrumPhy instance to a SpectrumChannel instance, so that the SpectrumPhy can receive packets sent on that channel. Note that a SpectrumPhy that only transmits (without receiving ever) does not need to be added to the channel.
This method is to be implemented by all classes inheriting from SpectrumChannel.
phy | the SpectrumPhy instance to be added to the channel as a receiver. |
Implements ns3::SpectrumChannel.
Definition at line 87 of file single-model-spectrum-channel.cc.
References m_phyList, NS_LOG_FUNCTION, and third::phy.
|
privatevirtual |
Destructor implementation.
This method is called by Dispose() or by the Object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.
It is safe to call GetObject() from within this method.
Reimplemented from ns3::SpectrumChannel.
Definition at line 54 of file single-model-spectrum-channel.cc.
References ns3::SpectrumChannel::DoDispose(), m_phyList, m_spectrumModel, and NS_LOG_FUNCTION.
i | index of NetDevice to retrieve |
This method must be implemented by subclasses.
Implements ns3::Channel.
Definition at line 229 of file single-model-spectrum-channel.cc.
References m_phyList, and NS_LOG_FUNCTION.
|
virtual |
This method must be implemented by subclasses.
Implements ns3::Channel.
Definition at line 222 of file single-model-spectrum-channel.cc.
References m_phyList, and NS_LOG_FUNCTION.
|
static |
Get the type ID.
Definition at line 63 of file single-model-spectrum-channel.cc.
References NS_LOG_FUNCTION_NOARGS, and ns3::TypeId::SetParent().
|
virtual |
Remove a SpectrumPhy from a channel.
This method is used to detach a SpectrumPhy instance from a SpectrumChannel instance, so that the SpectrumPhy does not receive packets sent on that channel.
This method is to be implemented by all classes inheriting from SpectrumChannel.
phy | the SpectrumPhy instance to be removed from the channel as a receiver. |
Implements ns3::SpectrumChannel.
Definition at line 76 of file single-model-spectrum-channel.cc.
References m_phyList, NS_LOG_FUNCTION, and third::phy.
|
private |
Used internally to reschedule transmission after the propagation delay.
params | |
receiver |
Definition at line 215 of file single-model-spectrum-channel.cc.
References NS_LOG_FUNCTION, and ns3::SpectrumPhy::StartRx().
Referenced by StartTx().
|
virtual |
Used by attached PHY instances to transmit signals on the channel.
params | the parameters of the signals being transmitted |
Implements ns3::SpectrumChannel.
Definition at line 95 of file single-model-spectrum-channel.cc.
References ns3::PropagationLossModel::CalcRxPower(), ns3::AntennaModel::GetGainDb(), ns3::Node::GetId(), ns3::NetDevice::GetNode(), ns3::MobilityModel::GetPosition(), ns3::SpectrumChannel::m_gainTrace, ns3::SpectrumChannel::m_maxLossDb, ns3::SpectrumChannel::m_pathLossTrace, m_phyList, ns3::SpectrumChannel::m_propagationDelay, ns3::SpectrumChannel::m_propagationLoss, m_spectrumModel, ns3::SpectrumChannel::m_spectrumPropagationLoss, ns3::SpectrumChannel::m_txSigParamsTrace, ns3::MicroSeconds(), NS_ASSERT, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Simulator::Schedule(), ns3::Simulator::ScheduleWithContext(), and StartRx().
|
private |
List of SpectrumPhy instances attached to the channel.
Definition at line 79 of file single-model-spectrum-channel.h.
Referenced by AddRx(), DoDispose(), GetDevice(), GetNDevices(), RemoveRx(), and StartTx().
|
private |
SpectrumModel that this channel instance is supporting.
Definition at line 84 of file single-model-spectrum-channel.h.
Referenced by DoDispose(), and StartTx().