21 #include "uan-transducer-hd.h"
22 #include "ns3/simulator.h"
23 #include "ns3/uan-prop-model.h"
25 #include "uan-channel.h"
27 #include "ns3/pointer.h"
34 NS_OBJECT_ENSURE_REGISTERED (UanTransducerHd);
35 UanTransducerHd::UanTransducerHd ()
43 UanTransducerHd::~UanTransducerHd ()
61 UanPhyList::iterator it = m_phyList.begin ();
62 for (; it != m_phyList.end (); it++)
70 ArrivalList::iterator ait = m_arrivalList.begin ();
71 for (; ait != m_arrivalList.end (); ait++)
73 ait->GetPacket () = 0;
76 m_arrivalList.clear ();
87 UanTransducerHd::GetTypeId ()
91 .AddConstructor<UanTransducerHd> ()
106 return m_state == RX;
112 return m_state == TX;
119 return m_arrivalList;
134 m_arrivalList.push_back (arrival);
141 UanPhyList::const_iterator it = m_phyList.begin ();
142 for (; it != m_phyList.end (); it++)
145 (*it)->StartRxPacket (packet, rxPowerDb, txMode, pdp);
161 src->NotifyTxDrop(packet);
166 src->NotifyTxBegin(packet);
172 << delay <<
" seconds for packet size "
173 << packet->
GetSize () <<
" bytes and rate = "
175 UanPhyList::const_iterator it = m_phyList.begin ();
176 for (; it != m_phyList.end (); it++)
180 (*it)->NotifyTransStartTx (packet, txPowerDb, txMode);
194 UanTransducerHd::EndTx (
void)
215 m_phyList.push_back (phy);
229 ArrivalList::iterator it = m_arrivalList.begin ();
230 for (; it != m_arrivalList.end (); it++)
232 if (it->GetPacket () == arrival.
GetPacket ())
234 m_arrivalList.erase (it);
238 UanPhyList::const_iterator ait = m_phyList.begin ();
239 for (; ait != m_phyList.end (); ait++)
241 (*ait)->NotifyIntChange ();
std::list< Ptr< UanPhy > > UanPhyList
UanPhyList is a standard template library list of UanPhy objects.
virtual const UanPhyList & GetPhyList(void) const
#define NS_ASSERT(condition)
#define NS_LOG_COMPONENT_DEFINE(name)
uint32_t GetSize(void) const
virtual bool IsTx(void) const
virtual void DoDispose(void)
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
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.
Ptr< Packet > GetPacket(void) const
virtual Ptr< UanChannel > GetChannel(void) const
uint32_t GetDataRateBps(void) const
Abstraction of packet modulation information.
std::list< UanPacketArrival > ArrivalList
Arrival list is a standard template library list of UanPacketArrivals objects.
virtual const ArrivalList & GetArrivalList(void) const
static void Remove(const EventId &id)
virtual void SetChannel(Ptr< UanChannel > chan)
virtual void AddPhy(Ptr< UanPhy >)
Time Seconds(double seconds)
create ns3::Time instances in units of seconds.
#define NS_LOG_DEBUG(msg)
virtual State GetState(void) const
State
Transducer state (receiving or transmitting)
a base class which provides memory management and object aggregation
virtual void Transmit(Ptr< UanPhy > src, Ptr< Packet > packet, double txPowerDb, UanTxMode txMode)
Transmit a packet from this transducer.
virtual bool IsRx(void) const
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
void NotifyTxEnd(Ptr< const Packet > packet)
Class consisting of packet arrival information (Time, RxPower, mode, PDP)