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 ()
 Constructor. More...
 
virtual ~UanTransducerHd ()
 Dummy destructor, see DoDispose. More...
 
virtual void AddPhy (Ptr< UanPhy >)
 Attach a physical network layer above this transducer. More...
 
virtual void Clear (void)
 Clears all pointer references. More...
 
virtual const ArrivalListGetArrivalList (void) const
 Get the list of overlapped (in time) packets at this transducer. More...
 
virtual Ptr< UanChannelGetChannel (void) const
 Get the attached channel. More...
 
virtual const UanPhyListGetPhyList (void) const
 Get the list of physical layer above this transducer. More...
 
virtual State GetState (void) const
 Get the transducer state. More...
 
virtual bool IsRx (void) const
 Is the state receiving (or available for reception)? More...
 
virtual bool IsTx (void) const
 Is the state transmitting? More...
 
virtual void Receive (Ptr< Packet > packet, double rxPowerDb, UanTxMode txMode, UanPdp pdp)
 Notify this object that a new packet has arrived at this nodes location. More...
 
virtual void SetChannel (Ptr< UanChannel > chan)
 Attach this transducer to a channel. More...
 
virtual void Transmit (Ptr< UanPhy > src, Ptr< Packet > packet, double txPowerDb, UanTxMode txMode)
 Transmit a packet from this transducer. More...
 
- 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...
 
SimpleRefCountoperator= (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)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::UanTransducer
static TypeId GetTypeId (void)
 Register this type. More...
 
- 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...
 

Protected Member Functions

virtual void DoDispose ()
 This method is called by Object::Dispose or by the object's destructor, whichever comes first. More...
 
- 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...
 

Private Member Functions

void EndTx (void)
 Handle end of transmission event. More...
 
void RemoveArrival (UanPacketArrival arrival)
 Remove an entry from the arrival list. More...
 

Private Attributes

ArrivalList m_arrivalList
 List of arriving packets which overlap in time. More...
 
Ptr< UanChannelm_channel
 The attached channel. More...
 
bool m_cleared
 Flab when we've been cleared. More...
 
EventId m_endTxEvent
 Event scheduled for end of transmission. More...
 
Time m_endTxTime
 Time at which transmission will be completed. More...
 
UanPhyList m_phyList
 List of physical layers attached above this tranducer. More...
 
State m_state
 Transducer state. More...
 

Additional Inherited Members

- Public Types inherited from ns3::UanTransducer
typedef std::list
< UanPacketArrival
ArrivalList
 List of arriving packets overlapping in time. More...
 
enum  State { TX, RX }
 Transducer state. More...
 
typedef std::list< Ptr< UanPhy > > UanPhyList
 List of UanPhy objects. More...
 

Detailed Description

Half duplex implementation of transducer object.

Doxygen introspection did not find any typical Config paths.

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


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

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

Constructor & Destructor Documentation

ns3::UanTransducerHd::UanTransducerHd ( )

Constructor.

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

ns3::UanTransducerHd::~UanTransducerHd ( )
virtual

Dummy destructor, see DoDispose.

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

Member Function Documentation

void ns3::UanTransducerHd::AddPhy ( Ptr< UanPhy phy)
virtual

Attach a physical network layer above this transducer.

More than one physical layer may be attached.

Parameters
phyThe physical layer.

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

References ns3::EventId::Cancel(), 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 83 of file uan-transducer-hd.cc.

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

+ Here is the call graph for this function:

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

Handle end of transmission event.

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

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

Referenced by Transmit().

+ Here is the caller graph for this function:

const UanTransducer::ArrivalList & ns3::UanTransducerHd::GetArrivalList ( void  ) const
virtual

Get the list of overlapped (in time) packets at this transducer.

Returns
List of all packets currently crossing this node in the water.

Implements ns3::UanTransducer.

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

References m_arrivalList.

Ptr< UanChannel > ns3::UanTransducerHd::GetChannel ( void  ) const
virtual

Get the attached channel.

Returns
The channel.

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

Get the list of physical layer above this transducer.

Returns
List of attached physical layers.

Implements ns3::UanTransducer.

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

References m_phyList.

UanTransducer::State ns3::UanTransducerHd::GetState ( void  ) const
virtual

Get the transducer state.

Returns
State (TX or RX) of this transducer.

Implements ns3::UanTransducer.

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

References m_state.

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

Register this type.

Returns
The object TypeId.

Definition at line 89 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

Is the state receiving (or available for reception)?

Returns
True if this transducer is available for receiving an incoming packet.

Implements ns3::UanTransducer.

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

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

bool ns3::UanTransducerHd::IsTx ( void  ) const
virtual

Is the state transmitting?

Returns
True if there is a packet being transmitted from this transducer.

Implements ns3::UanTransducer.

Definition at line 112 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

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 125 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, and ns3::Simulator::Schedule().

+ Here is the call graph for this function:

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

Remove an entry from the arrival list.

Parameters
arrivalThe packet arrival to remove.

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

Attach this transducer to a channel.

Parameters
chanThe channel

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 153 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::NotifyTxEnd(), ns3::Simulator::Now(), NS_LOG_DEBUG, ns3::Simulator::Remove(), ns3::Simulator::Schedule(), and ns3::UanTransducer::TX.

+ Here is the call graph for this function:

Member Data Documentation

ArrivalList ns3::UanTransducerHd::m_arrivalList
private

List of arriving packets which overlap in time.

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

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

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

The attached channel.

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

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

bool ns3::UanTransducerHd::m_cleared
private

Flab when we've been cleared.

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

Referenced by Clear().

EventId ns3::UanTransducerHd::m_endTxEvent
private

Event scheduled for end of transmission.

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

Referenced by Clear(), and Transmit().

Time ns3::UanTransducerHd::m_endTxTime
private

Time at which transmission will be completed.

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

Referenced by EndTx(), and Transmit().

UanPhyList ns3::UanTransducerHd::m_phyList
private

List of physical layers attached above this tranducer.

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

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

State ns3::UanTransducerHd::m_state
private

Transducer state.

Definition at line 64 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: