Channel class used by UAN devices. More...
#include <uan-channel.h>
Public Types | |
typedef std::vector< std::pair< Ptr< UanNetDevice >, Ptr< UanTransducer > > > | UanDeviceList |
UanDeviceList is a standard template vector of pairs (UanNetDevice, UanTransducer) More... | |
Public Member Functions | |
UanChannel () | |
Constructor. More... | |
virtual | ~UanChannel () |
Dummy destructor, see DoDispose. More... | |
void | AddDevice (Ptr< UanNetDevice > dev, Ptr< UanTransducer > trans) |
Adds device to receiver list for this channel. More... | |
void | Clear (void) |
Clear all pointer references. More... | |
virtual Ptr< NetDevice > | GetDevice (uint32_t i) const |
virtual uint32_t | GetNDevices (void) const |
double | GetNoiseDbHz (double fKhz) |
Get the noise level on the channel. More... | |
void | SetNoiseModel (Ptr< UanNoiseModel > noise) |
Set the noise model this channel will use to determine ambient channel noise. More... | |
void | SetPropagationModel (Ptr< UanPropModel > prop) |
Set the propagation model this channel will use for path loss/propagation delay. More... | |
void | TxPacket (Ptr< UanTransducer > src, Ptr< Packet > packet, double txPowerDb, UanTxMode txmode) |
Send a packet out on the channel. 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 |
Implement the GetInstanceTypeId method defined in ObjectBase. 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. More... | |
void | Initialize (void) |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
![]() | |
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... | |
![]() | |
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) |
Register this type. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
![]() | |
static void | Cleanup (void) |
Noop. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Protected Member Functions | |
virtual void | DoDispose (void) |
Destructor implementation. More... | |
![]() | |
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... | |
Private Member Functions | |
void | SendUp (uint32_t i, Ptr< Packet > packet, double rxPowerDb, UanTxMode txMode, UanPdp pdp) |
Send a packet up to the receiving UanTransducer. More... | |
Private Attributes | |
bool | m_cleared |
Has Clear ever been called on the channel. More... | |
UanDeviceList | m_devList |
The list of devices on this channel. More... | |
Ptr< UanNoiseModel > | m_noise |
The noise model. More... | |
Ptr< UanPropModel > | m_prop |
The propagation model. More... | |
Additional Inherited Members | |
![]() | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
Channel class used by UAN devices.
ns3::UanChannel is accessible through the following paths with Config::Set and Config::Connect:
No TraceSources are defined for this type.
Size of this type is 80 bytes (on a 64-bit architecture).
Definition at line 45 of file uan-channel.h.
typedef std::vector<std::pair<Ptr<UanNetDevice>, Ptr<UanTransducer> > > ns3::UanChannel::UanDeviceList |
UanDeviceList is a standard template vector of pairs (UanNetDevice, UanTransducer)
Definition at line 52 of file uan-channel.h.
ns3::UanChannel::UanChannel | ( | ) |
Constructor.
Definition at line 69 of file uan-channel.cc.
|
virtual |
Dummy destructor, see DoDispose.
Definition at line 76 of file uan-channel.cc.
void ns3::UanChannel::AddDevice | ( | Ptr< UanNetDevice > | dev, |
Ptr< UanTransducer > | trans | ||
) |
Adds device to receiver list for this channel.
dev | Net Device of node. |
trans | Transducer of net device attached to this channel. |
Definition at line 142 of file uan-channel.cc.
References m_devList, and NS_LOG_DEBUG.
void ns3::UanChannel::Clear | ( | void | ) |
Clear all pointer references.
Definition at line 81 of file uan-channel.cc.
References m_cleared, m_devList, m_noise, and m_prop.
Referenced by DoDispose().
|
protectedvirtual |
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 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 117 of file uan-channel.cc.
References Clear(), and ns3::Object::DoDispose().
i | index of NetDevice to retrieve |
This method must be implemented by subclasses.
Implements ns3::Channel.
Definition at line 136 of file uan-channel.cc.
References m_devList.
|
virtual |
This method must be implemented by subclasses.
Implements ns3::Channel.
Definition at line 130 of file uan-channel.cc.
References m_devList.
double ns3::UanChannel::GetNoiseDbHz | ( | double | fKhz | ) |
Get the noise level on the channel.
fKhz | Frequency in kHz. |
Definition at line 215 of file uan-channel.cc.
|
static |
Register this type.
Definition at line 48 of file uan-channel.cc.
References m_noise, m_prop, ns3::MakePointerAccessor(), and ns3::TypeId::SetParent().
|
private |
Send a packet up to the receiving UanTransducer.
i | Device number. |
packet | The received packet. |
rxPowerDb | Signal power in dB of arriving packet. |
txMode | Mode arriving packet is using. |
pdp | PDP of arriving signal. |
Definition at line 207 of file uan-channel.cc.
References m_devList, and NS_LOG_DEBUG.
Referenced by TxPacket().
void ns3::UanChannel::SetNoiseModel | ( | Ptr< UanNoiseModel > | noise | ) |
Set the noise model this channel will use to determine ambient channel noise.
noise | The noise model. |
Definition at line 201 of file uan-channel.cc.
void ns3::UanChannel::SetPropagationModel | ( | Ptr< UanPropModel > | prop | ) |
Set the propagation model this channel will use for path loss/propagation delay.
prop | The propagation model. |
Definition at line 123 of file uan-channel.cc.
References m_prop, and NS_LOG_DEBUG.
void ns3::UanChannel::TxPacket | ( | Ptr< UanTransducer > | src, |
Ptr< Packet > | packet, | ||
double | txPowerDb, | ||
UanTxMode | txmode | ||
) |
Send a packet out on the channel.
src | Transducer transmitting packet. |
packet | Packet to be transmitted. |
txPowerDb | Transmission power in dB. |
txmode | UanTxMode defining modulation of transmitted packet. |
Definition at line 149 of file uan-channel.cc.
References ns3::Packet::Copy(), ns3::MobilityModel::GetDistanceFrom(), ns3::Object::GetObject(), m_devList, m_prop, NS_ASSERT, NS_LOG_DEBUG, ns3::Simulator::ScheduleWithContext(), and SendUp().
|
private |
Has Clear ever been called on the channel.
Definition at line 119 of file uan-channel.h.
Referenced by Clear().
|
private |
The list of devices on this channel.
Definition at line 115 of file uan-channel.h.
Referenced by AddDevice(), Clear(), GetDevice(), GetNDevices(), SendUp(), and TxPacket().
|
private |
The noise model.
Definition at line 117 of file uan-channel.h.
Referenced by Clear(), GetNoiseDbHz(), GetTypeId(), and SetNoiseModel().
|
private |
The propagation model.
Definition at line 116 of file uan-channel.h.
Referenced by Clear(), GetTypeId(), SetPropagationModel(), and TxPacket().