A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::UanChannel Class Reference

Channel class used by UAN devices. More...

#include "uan-channel.h"

+ Inheritance diagram for ns3::UanChannel:
+ Collaboration diagram for ns3::UanChannel:

Public Types

typedef std::vector< std::pair< Ptr< UanNetDevice >, Ptr< UanTransducer > > > UanDeviceList
 UanDeviceList is a standard template vector of pairs (UanNetDevice, UanTransducer)
 

Public Member Functions

 UanChannel ()
 Constructor.
 
 ~UanChannel () override
 Dummy destructor, see DoDispose.
 
void AddDevice (Ptr< UanNetDevice > dev, Ptr< UanTransducer > trans)
 Adds device to receiver list for this channel.
 
void Clear ()
 Clear all pointer references.
 
Ptr< NetDeviceGetDevice (std::size_t i) const override
 
std::size_t GetNDevices () const override
 
double GetNoiseDbHz (double fKhz)
 Get the noise level on the channel.
 
void SetNoiseModel (Ptr< UanNoiseModel > noise)
 Set the noise model this channel will use to determine ambient channel noise.
 
void SetPropagationModel (Ptr< UanPropModel > prop)
 Set the propagation model this channel will use for path loss/propagation delay.
 
virtual void TxPacket (Ptr< UanTransducer > src, Ptr< Packet > packet, double txPowerDb, UanTxMode txmode)
 Send a packet out on the channel.
 
- Public Member Functions inherited from ns3::Channel
 Channel ()
 
 ~Channel () override
 
uint32_t GetId () const
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::Channel
static TypeId GetTypeId ()
 Get the type ID.
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 

Protected Member Functions

void DoDispose () override
 Destructor implementation.
 
void SendUp (uint32_t i, Ptr< Packet > packet, double rxPowerDb, UanTxMode txMode, UanPdp pdp)
 Send a packet up to the receiving UanTransducer.
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
 
virtual void DoInitialize ()
 Initialize() implementation.
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.
 

Protected Attributes

bool m_cleared
 Has Clear ever been called on the channel.
 
UanDeviceList m_devList
 The list of devices on this channel.
 
Ptr< UanNoiseModelm_noise
 The noise model.
 
Ptr< UanPropModelm_prop
 The propagation model.
 

Additional Inherited Members

Detailed Description

Channel class used by UAN devices.

Definition at line 35 of file uan-channel.h.

Member Typedef Documentation

◆ UanDeviceList

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 42 of file uan-channel.h.

Constructor & Destructor Documentation

◆ UanChannel()

ns3::UanChannel::UanChannel ( )

Constructor.

Definition at line 57 of file uan-channel.cc.

◆ ~UanChannel()

ns3::UanChannel::~UanChannel ( )
override

Dummy destructor, see DoDispose.

Definition at line 64 of file uan-channel.cc.

Member Function Documentation

◆ AddDevice()

void ns3::UanChannel::AddDevice ( Ptr< UanNetDevice > dev,
Ptr< UanTransducer > trans )

Adds device to receiver list for this channel.

Parameters
devNet Device of node.
transTransducer of net device attached to this channel.

Definition at line 130 of file uan-channel.cc.

References m_devList, and NS_LOG_DEBUG.

◆ Clear()

void ns3::UanChannel::Clear ( )

Clear all pointer references.

Definition at line 69 of file uan-channel.cc.

References m_cleared, m_devList, m_noise, and m_prop.

Referenced by DoDispose().

+ Here is the caller graph for this function:

◆ DoDispose()

void ns3::UanChannel::DoDispose ( )
overrideprotectedvirtual

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.

Definition at line 104 of file uan-channel.cc.

References Clear(), and ns3::Object::DoDispose().

+ Here is the call graph for this function:

◆ GetDevice()

Ptr< NetDevice > ns3::UanChannel::GetDevice ( std::size_t i) const
overridevirtual
Parameters
iindex of NetDevice to retrieve
Returns
one of the NetDevices connected to this channel.

This method must be implemented by subclasses.

Implements ns3::Channel.

Definition at line 124 of file uan-channel.cc.

References m_devList.

◆ GetNDevices()

std::size_t ns3::UanChannel::GetNDevices ( ) const
overridevirtual
Returns
the number of NetDevices connected to this Channel.

This method must be implemented by subclasses.

Implements ns3::Channel.

Definition at line 118 of file uan-channel.cc.

References m_devList.

◆ GetNoiseDbHz()

double ns3::UanChannel::GetNoiseDbHz ( double fKhz)

Get the noise level on the channel.

Parameters
fKhzFrequency in kHz.
Returns
Ambient noise in dB/Hz on channel at a frequency.

Definition at line 199 of file uan-channel.cc.

References m_noise, and NS_ASSERT.

◆ GetTypeId()

TypeId ns3::UanChannel::GetTypeId ( )
static

Register this type.

Returns
The object TypeId.

Definition at line 37 of file uan-channel.cc.

References m_noise, m_prop, ns3::MakePointerAccessor(), ns3::MakePointerChecker(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ SendUp()

void ns3::UanChannel::SendUp ( uint32_t i,
Ptr< Packet > packet,
double rxPowerDb,
UanTxMode txMode,
UanPdp pdp )
protected

Send a packet up to the receiving UanTransducer.

Parameters
iDevice number.
packetThe received packet.
rxPowerDbSignal power in dB of arriving packet.
txModeMode arriving packet is using.
pdpPDP of arriving signal.

Definition at line 192 of file uan-channel.cc.

References m_devList, and NS_LOG_DEBUG.

Referenced by TxPacket().

+ Here is the caller graph for this function:

◆ SetNoiseModel()

void ns3::UanChannel::SetNoiseModel ( Ptr< UanNoiseModel > noise)

Set the noise model this channel will use to determine ambient channel noise.

Parameters
noiseThe noise model.

Definition at line 185 of file uan-channel.cc.

References m_noise, and NS_ASSERT.

◆ SetPropagationModel()

void ns3::UanChannel::SetPropagationModel ( Ptr< UanPropModel > prop)

Set the propagation model this channel will use for path loss/propagation delay.

Parameters
propThe propagation model.

Definition at line 111 of file uan-channel.cc.

References m_prop, and NS_LOG_DEBUG.

◆ TxPacket()

void ns3::UanChannel::TxPacket ( Ptr< UanTransducer > src,
Ptr< Packet > packet,
double txPowerDb,
UanTxMode txmode )
virtual

Send a packet out on the channel.

Parameters
srcTransducer transmitting packet.
packetPacket to be transmitted.
txPowerDbTransmission power in dB.
txmodeUanTxMode defining modulation of transmitted packet.

Definition at line 137 of file uan-channel.cc.

References m_devList, m_prop, NS_ASSERT, NS_LOG_DEBUG, ns3::Simulator::ScheduleWithContext(), and SendUp().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_cleared

bool ns3::UanChannel::m_cleared
protected

Has Clear ever been called on the channel.

Definition at line 111 of file uan-channel.h.

Referenced by Clear().

◆ m_devList

UanDeviceList ns3::UanChannel::m_devList
protected

The list of devices on this channel.

Definition at line 107 of file uan-channel.h.

Referenced by AddDevice(), Clear(), GetDevice(), GetNDevices(), SendUp(), and TxPacket().

◆ m_noise

Ptr<UanNoiseModel> ns3::UanChannel::m_noise
protected

The noise model.

Definition at line 109 of file uan-channel.h.

Referenced by Clear(), GetNoiseDbHz(), GetTypeId(), and SetNoiseModel().

◆ m_prop

Ptr<UanPropModel> ns3::UanChannel::m_prop
protected

The propagation model.

Definition at line 108 of file uan-channel.h.

Referenced by Clear(), GetTypeId(), SetPropagationModel(), and TxPacket().


The documentation for this class was generated from the following files: