A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::UanTransducerHd Class Reference

Half duplex implementation of transducer object. More...

#include <uan-transducer-hd.h>

+ Inheritance diagram for ns3::UanTransducerHd:
+ Collaboration diagram for ns3::UanTransducerHd:

Public Member Functions

 UanTransducerHd ()
virtual ~UanTransducerHd ()
virtual void AddPhy (Ptr< UanPhy >)
virtual void Clear (void)
virtual const ArrivalListGetArrivalList (void) const
virtual Ptr< UanChannelGetChannel (void) const
virtual const UanPhyListGetPhyList (void) const
virtual State GetState (void) const
virtual bool IsRx (void) const
virtual bool IsTx (void) const
virtual void Receive (Ptr< Packet > packet, double rxPowerDb, UanTxMode txMode, UanPdp pdp)
 Receive Notify this object that a new packet has arrived at this nodes location.
virtual void SetChannel (Ptr< UanChannel > chan)
virtual void Transmit (Ptr< UanPhy > src, Ptr< Packet > packet, double txPowerDb, UanTxMode txMode)
 Transmit a packet from this transducer.

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::UanTransducerHd.

Protected Member Functions

virtual void DoDispose ()

Private Member Functions

void EndTx (void)
void RemoveArrival (UanPacketArrival arrival)

Private Attributes

ArrivalList m_arrivalList
Ptr< UanChannelm_channel
bool m_cleared
EventId m_endTxEvent
Time m_endTxTime
UanPhyList m_phyList
State m_state

Additional Inherited Members

- Public Types inherited from ns3::UanTransducer
typedef std::list
< UanPacketArrival
ArrivalList
 Arrival list is a standard template library list of UanPacketArrivals objects.
enum  State { TX, RX }
 Transducer state (receiving or transmitting) More...
typedef std::list< Ptr< UanPhy > > UanPhyList
 UanPhyList is a standard template library list of UanPhy objects.

Detailed Description

Half duplex implementation of transducer object.

This class will only allow attached Phy's to receive packets if not in TX mode

Definition at line 34 of file uan-transducer-hd.h.

Constructor & Destructor Documentation

ns3::UanTransducerHd::UanTransducerHd ( )

Definition at line 35 of file uan-transducer-hd.cc.

ns3::UanTransducerHd::~UanTransducerHd ( )
virtual

Definition at line 43 of file uan-transducer-hd.cc.

Member Function Documentation

void ns3::UanTransducerHd::AddPhy ( Ptr< UanPhy phy)
virtual
Parameters
phyAdd phy above this transducer (may connect > 1 Phy to a transducer)

Implements ns3::UanTransducer.

Definition at line 213 of file uan-transducer-hd.cc.

References m_phyList.

void ns3::UanTransducerHd::Clear ( void  )
virtual

Clears all pointer references

Implements ns3::UanTransducer.

Definition at line 48 of file uan-transducer-hd.cc.

References ns3::EventId::Cancel(), ns3::UanChannel::Clear(), m_arrivalList, m_channel, m_cleared, m_endTxEvent, and m_phyList.

Referenced by DoDispose().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::UanTransducerHd::DoDispose ( void  )
protectedvirtual

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 81 of file uan-transducer-hd.cc.

References Clear().

+ Here is the call graph for this function:

void ns3::UanTransducerHd::EndTx ( void  )
private

Definition at line 194 of file uan-transducer-hd.cc.

References m_endTxTime, m_state, NS_ASSERT, ns3::UanTransducer::RX, ns3::Seconds(), and ns3::UanTransducer::TX.

Referenced by Transmit().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const UanTransducer::ArrivalList & ns3::UanTransducerHd::GetArrivalList ( void  ) const
virtual
Returns
List of all packets currently crossing this node in the water.

Implements ns3::UanTransducer.

Definition at line 117 of file uan-transducer-hd.cc.

References m_arrivalList.

Ptr< UanChannel > ns3::UanTransducerHd::GetChannel ( void  ) const
virtual
Returns
Channel this transducer is attached to

Implements ns3::UanTransducer.

Definition at line 208 of file uan-transducer-hd.cc.

References m_channel.

const UanTransducer::UanPhyList & ns3::UanTransducerHd::GetPhyList ( void  ) const
virtual
Returns
List of all Phy's this transducer sends packets to.

Implements ns3::UanTransducer.

Definition at line 219 of file uan-transducer-hd.cc.

References m_phyList.

UanTransducer::State ns3::UanTransducerHd::GetState ( void  ) const
virtual
Returns
State (TX or RX) of this transducer

Implements ns3::UanTransducer.

Definition at line 97 of file uan-transducer-hd.cc.

References m_state.

TypeId ns3::UanTransducerHd::GetTypeId ( void  )
static

This method returns the TypeId associated to ns3::UanTransducerHd.

No Attributes defined for this type.
No TraceSources defined for this type.

Reimplemented from ns3::UanTransducer.

Definition at line 87 of file uan-transducer-hd.cc.

References ns3::TypeId::SetParent().

+ Here is the call graph for this function:

bool ns3::UanTransducerHd::IsRx ( void  ) const
virtual
Returns
True if this transducer is available for receiving an incoming packet.

Implements ns3::UanTransducer.

Definition at line 104 of file uan-transducer-hd.cc.

References m_state, and ns3::UanTransducer::RX.

bool ns3::UanTransducerHd::IsTx ( void  ) const
virtual
Returns
True if there is a packet being transmitted from this transducer.

Implements ns3::UanTransducer.

Definition at line 110 of file uan-transducer-hd.cc.

References m_state, and ns3::UanTransducer::TX.

void ns3::UanTransducerHd::Receive ( Ptr< Packet packet,
double  rxPowerDb,
UanTxMode  txMode,
UanPdp  pdp 
)
virtual

Receive Notify this object that a new packet has arrived at this nodes location.

Parameters
packetPacket arriving
rxPowerDbSignal power in dB of arriving packet
txModeMode arriving packet is using
pdpPDP of arriving signal

Implements ns3::UanTransducer.

Definition at line 123 of file uan-transducer-hd.cc.

References ns3::UanTxMode::GetDataRateBps(), ns3::Packet::GetSize(), m_arrivalList, m_phyList, m_state, ns3::Simulator::Now(), NS_LOG_DEBUG, RemoveArrival(), ns3::UanTransducer::RX, ns3::Simulator::Schedule(), and ns3::Seconds().

+ Here is the call graph for this function:

void ns3::UanTransducerHd::RemoveArrival ( UanPacketArrival  arrival)
private

Definition at line 225 of file uan-transducer-hd.cc.

References ns3::UanPacketArrival::GetPacket(), m_arrivalList, and m_phyList.

Referenced by Receive().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::UanTransducerHd::SetChannel ( Ptr< UanChannel chan)
virtual
Parameters
chanChannel this transducer is attached to

Implements ns3::UanTransducer.

Definition at line 201 of file uan-transducer-hd.cc.

References m_channel, and NS_LOG_DEBUG.

void ns3::UanTransducerHd::Transmit ( Ptr< UanPhy src,
Ptr< Packet packet,
double  txPowerDb,
UanTxMode  txMode 
)
virtual

Transmit a packet from this transducer.

Parameters
srcSource PHY
packetPacket to transmit
txPowerDbOutgoing Tx power of packet
txModeMode to transmit packet with.

Implements ns3::UanTransducer.

Definition at line 151 of file uan-transducer-hd.cc.

References EndTx(), ns3::UanTxMode::GetDataRateBps(), ns3::Packet::GetSize(), m_channel, m_endTxEvent, m_endTxTime, m_phyList, m_state, ns3::UanPhy::NotifyTxBegin(), ns3::UanPhy::NotifyTxDrop(), ns3::UanPhy::NotifyTxEnd(), ns3::Now(), ns3::Simulator::Now(), NS_LOG_DEBUG, ns3::Simulator::Remove(), ns3::Simulator::Schedule(), ns3::Seconds(), ns3::UanTransducer::TX, and ns3::UanChannel::TxPacket().

+ Here is the call graph for this function:

Member Data Documentation

ArrivalList ns3::UanTransducerHd::m_arrivalList
private

Definition at line 57 of file uan-transducer-hd.h.

Referenced by Clear(), GetArrivalList(), Receive(), and RemoveArrival().

Ptr<UanChannel> ns3::UanTransducerHd::m_channel
private

Definition at line 59 of file uan-transducer-hd.h.

Referenced by Clear(), GetChannel(), SetChannel(), and Transmit().

bool ns3::UanTransducerHd::m_cleared
private

Definition at line 62 of file uan-transducer-hd.h.

Referenced by Clear().

EventId ns3::UanTransducerHd::m_endTxEvent
private

Definition at line 60 of file uan-transducer-hd.h.

Referenced by Clear(), and Transmit().

Time ns3::UanTransducerHd::m_endTxTime
private

Definition at line 61 of file uan-transducer-hd.h.

Referenced by EndTx(), and Transmit().

UanPhyList ns3::UanTransducerHd::m_phyList
private

Definition at line 58 of file uan-transducer-hd.h.

Referenced by AddPhy(), Clear(), GetPhyList(), Receive(), RemoveArrival(), and Transmit().

State ns3::UanTransducerHd::m_state
private

Definition at line 56 of file uan-transducer-hd.h.

Referenced by EndTx(), GetState(), IsRx(), IsTx(), Receive(), and Transmit().


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