SpectrumChannel implementation which handles a single spectrum model. More...
#include <single-model-spectrum-channel.h>
Public Types | |
typedef std::vector< Ptr < SpectrumPhy > > | PhyList |
Public Member Functions | |
SingleModelSpectrumChannel () | |
virtual void | AddPropagationLossModel (Ptr< PropagationLossModel > loss) |
set the single-frequency propagation loss model to be used More... | |
virtual void | AddRx (Ptr< SpectrumPhy > phy) |
add a SpectrumPhy to a channel, so it can receive packets More... | |
virtual void | AddSpectrumPropagationLossModel (Ptr< SpectrumPropagationLossModel > loss) |
set the frequency-dependent propagation loss model to be used More... | |
virtual Ptr< NetDevice > | GetDevice (uint32_t i) const |
virtual uint32_t | GetNDevices (void) const |
virtual Ptr < SpectrumPropagationLossModel > | GetSpectrumPropagationLossModel (void) |
virtual void | SetPropagationDelayModel (Ptr< PropagationDelayModel > delay) |
set the propagation delay model to be used More... | |
virtual void | StartTx (Ptr< SpectrumSignalParameters > params) |
Used by attached PHY instances to transmit signals on the channel. More... | |
Public Member Functions inherited from ns3::SpectrumChannel | |
virtual | ~SpectrumChannel () |
Public Member Functions inherited from ns3::Channel | |
Channel () | |
virtual | ~Channel () |
uint32_t | GetId (void) const |
Public Member Functions inherited from ns3::Object | |
Object () | |
virtual | ~Object () |
void | AggregateObject (Ptr< Object > other) |
void | Dispose (void) |
Run the DoDispose methods of this object and all the objects aggregated to it. More... | |
AggregateIterator | GetAggregateIterator (void) const |
virtual TypeId | GetInstanceTypeId (void) const |
template<typename T > | |
Ptr< T > | GetObject (void) const |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
void | Initialize (void) |
This method calls the virtual DoInitialize method on all the objects aggregated to this object. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
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. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Static Public Member Functions inherited from ns3::SpectrumChannel | |
static TypeId | GetTypeId (void) |
Static Public Member Functions inherited from ns3::Channel | |
static TypeId | GetTypeId (void) |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
Static Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
static void | Cleanup (void) |
Noop. More... | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Private Member Functions | |
virtual void | DoDispose () |
This method is called by Object::Dispose or by the object's destructor, whichever comes first. More... | |
void | StartRx (Ptr< SpectrumSignalParameters > params, Ptr< SpectrumPhy > receiver) |
used internally to reschedule transmission after the propagation delay More... | |
Private Attributes | |
double | m_maxLossDb |
TracedCallback< Ptr < SpectrumPhy >, Ptr < SpectrumPhy >, double > | m_pathLossTrace |
PhyList | m_phyList |
list of SpectrumPhy instances attached to the 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< const SpectrumModel > | m_spectrumModel |
SpectrumModel that this channel instance is supporting. More... | |
Ptr< SpectrumPropagationLossModel > | m_spectrumPropagationLoss |
frequency-dependent propagation loss model to be used with this channel More... | |
Additional Inherited Members | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
virtual void | DoInitialize (void) |
This method is called only once by Object::Initialize. More... | |
virtual void | NotifyNewAggregate (void) |
This method is invoked whenever two sets of objects are aggregated together. More... | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
virtual void | NotifyConstructionCompleted (void) |
This method is invoked once all member attributes have been initialized. 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:
Definition at line 40 of file single-model-spectrum-channel.h.
typedef std::vector<Ptr<SpectrumPhy> > ns3::SingleModelSpectrumChannel::PhyList |
Definition at line 62 of file single-model-spectrum-channel.h.
ns3::SingleModelSpectrumChannel::SingleModelSpectrumChannel | ( | ) |
Definition at line 50 of file single-model-spectrum-channel.cc.
References NS_LOG_FUNCTION.
|
virtual |
set the single-frequency propagation loss model to be used
loss | a pointer to the propagation loss model to be used. |
Implements ns3::SpectrumChannel.
Definition at line 235 of file single-model-spectrum-channel.cc.
References m_propagationLoss, NS_ASSERT, and 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 receiveing 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 102 of file single-model-spectrum-channel.cc.
References m_phyList, and NS_LOG_FUNCTION.
|
virtual |
set the frequency-dependent propagation loss model to be used
loss | a pointer to the propagation loss model to be used. |
Implements ns3::SpectrumChannel.
Definition at line 244 of file single-model-spectrum-channel.cc.
References m_spectrumPropagationLoss, NS_ASSERT, and NS_LOG_FUNCTION.
|
privatevirtual |
This method is called by Object::Dispose or by the object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overriden 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.
Definition at line 56 of file single-model-spectrum-channel.cc.
References ns3::Object::DoDispose(), m_phyList, m_propagationDelay, m_propagationLoss, m_spectrumModel, m_spectrumPropagationLoss, and NS_LOG_FUNCTION.
i | index of NetDevice to retrieve |
This method must be implemented by subclasses.
Implements ns3::Channel.
Definition at line 227 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 219 of file single-model-spectrum-channel.cc.
References m_phyList, and NS_LOG_FUNCTION.
|
virtual |
Definition at line 261 of file single-model-spectrum-channel.cc.
References m_spectrumPropagationLoss, and NS_LOG_FUNCTION.
|
static |
Definition at line 68 of file single-model-spectrum-channel.cc.
References m_maxLossDb, m_pathLossTrace, ns3::MakeTraceSourceAccessor(), NS_LOG_FUNCTION_NOARGS, and ns3::TypeId::SetParent().
|
virtual |
set the propagation delay model to be used
delay | Ptr to the propagation delay model to be used. |
Implements ns3::SpectrumChannel.
Definition at line 252 of file single-model-spectrum-channel.cc.
References m_propagationDelay, NS_ASSERT, and NS_LOG_FUNCTION.
|
private |
used internally to reschedule transmission after the propagation delay
params | |
receiver |
Definition at line 210 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 110 of file single-model-spectrum-channel.cc.
References ns3::PropagationLossModel::CalcRxPower(), ns3::MobilityModel::GetPosition(), m_maxLossDb, m_pathLossTrace, m_phyList, m_propagationDelay, m_propagationLoss, m_spectrumModel, m_spectrumPropagationLoss, NS_ASSERT, NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Simulator::Schedule(), ns3::Simulator::ScheduleWithContext(), and StartRx().
|
private |
Definition at line 110 of file single-model-spectrum-channel.h.
Referenced by GetTypeId(), and StartTx().
|
private |
Definition at line 112 of file single-model-spectrum-channel.h.
Referenced by GetTypeId(), and StartTx().
|
private |
list of SpectrumPhy instances attached to the channel
Definition at line 81 of file single-model-spectrum-channel.h.
Referenced by AddRx(), DoDispose(), GetDevice(), GetNDevices(), and StartTx().
|
private |
propagation delay model to be used with this channel
Definition at line 94 of file single-model-spectrum-channel.h.
Referenced by DoDispose(), SetPropagationDelayModel(), and StartTx().
|
private |
single-frequency propagation loss model to be used with this channel
Definition at line 101 of file single-model-spectrum-channel.h.
Referenced by AddPropagationLossModel(), DoDispose(), and StartTx().
|
private |
SpectrumModel that this channel instance is supporting.
Definition at line 87 of file single-model-spectrum-channel.h.
Referenced by DoDispose(), and StartTx().
|
private |
frequency-dependent propagation loss model to be used with this channel
Definition at line 107 of file single-model-spectrum-channel.h.
Referenced by AddSpectrumPropagationLossModel(), DoDispose(), GetSpectrumPropagationLossModel(), and StartTx().