Defines the interface for spectrum-aware channel implementations. More...
#include "spectrum-channel.h"
Public Types | |
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 | |
SpectrumChannel () | |
constructor More... | |
virtual | ~SpectrumChannel () |
destructor More... | |
void | AddPropagationLossModel (Ptr< PropagationLossModel > loss) |
Add the single-frequency propagation loss model to be used. More... | |
virtual void | AddRx (Ptr< SpectrumPhy > phy)=0 |
Add a SpectrumPhy to a channel, so it can receive packets. More... | |
void | AddSpectrumPropagationLossModel (Ptr< SpectrumPropagationLossModel > loss) |
Add the frequency-dependent propagation loss model to be used. More... | |
virtual void | DoDispose (void) |
Destructor implementation. 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... | |
virtual void | StartTx (Ptr< SpectrumSignalParameters > params)=0 |
Used by attached PHY instances to transmit signals on the channel. More... | |
![]() | |
Channel () | |
virtual | ~Channel () |
virtual Ptr< NetDevice > | GetDevice (std::size_t i) const =0 |
uint32_t | GetId (void) const |
virtual std::size_t | GetNDevices (void) const =0 |
![]() | |
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<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. 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) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (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) |
Register this type. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Protected Attributes | |
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< 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... | |
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... | |
![]() | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
Defines the interface for spectrum-aware channel implementations.
ns3::SpectrumChannel is accessible through the following paths with Config::Set and Config::Connect:
Size of this type is 136 bytes (on a 64-bit architecture).
Definition at line 48 of file spectrum-channel.h.
typedef void(* ns3::SpectrumChannel::GainTracedCallback) (Ptr< const MobilityModel > txMobility, Ptr< const MobilityModel > rxMobility, double txAntennaGain, double rxAntennaGain, double propagationGain, double pathloss) |
TracedCallback signature for path loss calculation events.
[in] | txMobility | The mobility model of the transmitter. |
[in] | rxMobility | The mobility model of the receiver. |
[in] | txAntennaGain | The transmitter antenna gain, in dB. |
[in] | rxAntennaGain | The receiver antenna gain, in dB. |
[in] | propagationGain | The propagation gain, in dB. |
[in] | pathloss | The path loss value, in dB. |
Definition at line 145 of file spectrum-channel.h.
typedef void(* ns3::SpectrumChannel::LossTracedCallback) (Ptr< const SpectrumPhy > txPhy, Ptr< const SpectrumPhy > rxPhy, double lossDb) |
TracedCallback signature for path loss calculation events.
[in] | txPhy | The TX SpectrumPhy instance. |
[in] | rxPhy | The RX SpectrumPhy instance. |
[in] | lossDb | The loss value, in dB. |
Definition at line 132 of file spectrum-channel.h.
typedef void(* ns3::SpectrumChannel::SignalParametersTracedCallback) (Ptr< SpectrumSignalParameters > params) |
TracedCallback signature for Ptr<const SpectrumSignalParameters>.
[in] | params | SpectrumSignalParameters instance. |
Definition at line 153 of file spectrum-channel.h.
ns3::SpectrumChannel::SpectrumChannel | ( | ) |
|
virtual |
destructor
Definition at line 39 of file spectrum-channel.cc.
void ns3::SpectrumChannel::AddPropagationLossModel | ( | Ptr< PropagationLossModel > | loss | ) |
Add the single-frequency propagation loss model to be used.
loss | a pointer to the propagation loss model to be used. |
Definition at line 117 of file spectrum-channel.cc.
References m_propagationLoss, NS_LOG_FUNCTION, and ns3::PropagationLossModel::SetNext().
Referenced by Bug2483TestCase::DoRun().
|
pure 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. |
Implemented in ns3::MultiModelSpectrumChannel, and ns3::SingleModelSpectrumChannel.
void ns3::SpectrumChannel::AddSpectrumPropagationLossModel | ( | Ptr< SpectrumPropagationLossModel > | loss | ) |
Add the frequency-dependent propagation loss model to be used.
loss | a pointer to the propagation loss model to be used. |
Definition at line 128 of file spectrum-channel.cc.
References m_spectrumPropagationLoss, and NS_LOG_FUNCTION.
|
virtual |
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::Object.
Reimplemented in ns3::MultiModelSpectrumChannel, and ns3::SingleModelSpectrumChannel.
Definition at line 44 of file spectrum-channel.cc.
References m_propagationDelay, m_propagationLoss, m_spectrumPropagationLoss, and NS_LOG_FUNCTION.
Referenced by ns3::SingleModelSpectrumChannel::DoDispose(), and ns3::MultiModelSpectrumChannel::DoDispose().
Ptr< SpectrumPropagationLossModel > ns3::SpectrumChannel::GetSpectrumPropagationLossModel | ( | void | ) |
Get the frequency-dependent propagation loss model.
Definition at line 146 of file spectrum-channel.cc.
References m_spectrumPropagationLoss, and NS_LOG_FUNCTION.
|
static |
Get the type ID.
Definition at line 53 of file spectrum-channel.cc.
References m_gainTrace, m_maxLossDb, m_pathLossTrace, m_propagationLoss, m_txSigParamsTrace, ns3::MakeDoubleAccessor(), ns3::MakePointerAccessor(), ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().
void ns3::SpectrumChannel::SetPropagationDelayModel | ( | Ptr< PropagationDelayModel > | delay | ) |
Set the propagation delay model to be used.
delay | Ptr to the propagation delay model to be used. |
Definition at line 139 of file spectrum-channel.cc.
References m_propagationDelay, and NS_ASSERT.
Referenced by Bug2483TestCase::DoRun().
|
pure virtual |
Used by attached PHY instances to transmit signals on the channel.
params | the parameters of the signals being transmitted |
Implemented in ns3::MultiModelSpectrumChannel, and ns3::SingleModelSpectrumChannel.
|
protected |
The Gain
trace source.
Fired whenever a new path loss value is calculated. Exporting pointer to the mobility model of the transmitter and the receiver, Tx antenna gain, Rx antenna gain, propagation gain and pathloss
Definition at line 168 of file spectrum-channel.h.
Referenced by GetTypeId().
|
protected |
Maximum loss [dB].
Any device above this loss is considered out of range.
Definition at line 180 of file spectrum-channel.h.
Referenced by GetTypeId(), ns3::SingleModelSpectrumChannel::StartTx(), and ns3::MultiModelSpectrumChannel::StartTx().
|
protected |
The PathLoss
trace source.
Exporting the pointers to the Tx and Rx SpectrumPhy and a pathloss value, in dB.
Definition at line 161 of file spectrum-channel.h.
Referenced by GetTypeId(), ns3::SingleModelSpectrumChannel::StartTx(), and ns3::MultiModelSpectrumChannel::StartTx().
|
protected |
Propagation delay model to be used with this channel.
Definition at line 190 of file spectrum-channel.h.
Referenced by DoDispose(), SetPropagationDelayModel(), ns3::SingleModelSpectrumChannel::StartTx(), and ns3::MultiModelSpectrumChannel::StartTx().
|
protected |
Single-frequency propagation loss model to be used with this channel.
Definition at line 185 of file spectrum-channel.h.
Referenced by AddPropagationLossModel(), DoDispose(), GetTypeId(), ns3::SingleModelSpectrumChannel::StartTx(), and ns3::MultiModelSpectrumChannel::StartTx().
|
protected |
Frequency-dependent propagation loss model to be used with this channel.
Definition at line 195 of file spectrum-channel.h.
Referenced by AddSpectrumPropagationLossModel(), DoDispose(), GetSpectrumPropagationLossModel(), ns3::SingleModelSpectrumChannel::StartTx(), and ns3::MultiModelSpectrumChannel::StartTx().
|
protected |
Traced callback for SpectrumSignalParameters in StartTx requests.
Definition at line 173 of file spectrum-channel.h.
Referenced by GetTypeId(), ns3::SingleModelSpectrumChannel::StartTx(), and ns3::MultiModelSpectrumChannel::StartTx().