A Discrete-Event Network Simulator
API
Public Member Functions | Private Attributes | List of all members
ns3::Reservation Class Reference

Stores reservation info for use in scheduling data channel by reservation channel MAC. More...

#include "uan-mac-rc.h"

Public Member Functions

 Reservation ()
 Default constructor. More...
 
 Reservation (std::list< std::pair< Ptr< Packet >, Mac8Address > > &list, uint8_t frameNo, uint32_t maxPkts=0)
 Create Reservation object with given packet list, frame number and max packets. More...
 
 ~Reservation ()
 Destructor. More...
 
void AddTimestamp (Time t)
 Set the time of the latest RTS sent. More...
 
uint8_t GetFrameNo () const
 Get the frame number. More...
 
uint32_t GetLength () const
 Get the total length of the Reservation. More...
 
uint32_t GetNoFrames () const
 Get the number of frames in this Reservation. More...
 
const std::list< std::pair< Ptr< Packet >, Mac8Address > > & GetPktList (void) const
 Get the list of packets. More...
 
uint8_t GetRetryNo () const
 Get the retry number. More...
 
Time GetTimestamp (uint8_t n) const
 Get the timestamp for the n'th RTS. More...
 
void IncrementRetry ()
 Increment the retry count. More...
 
bool IsTransmitted () const
 
void SetFrameNo (uint8_t fn)
 Set the frame number. More...
 
void SetTransmitted (bool t=true)
 Set the reservation transmitted state. More...
 

Private Attributes

uint8_t m_frameNo
 Frame number. More...
 
uint32_t m_length
 Total length of queued packets. More...
 
std::list< std::pair< Ptr< Packet >, Mac8Address > > m_pktList
 Queued packets for each address. More...
 
uint8_t m_retryNo
 Number of retries. More...
 
std::vector< Timem_timestamp
 Timestamps for each retry. More...
 
bool m_transmitted
 Has this reservation been transmitted. More...
 

Detailed Description

Stores reservation info for use in scheduling data channel by reservation channel MAC.

Definition at line 52 of file uan-mac-rc.h.

Constructor & Destructor Documentation

◆ Reservation() [1/2]

ns3::Reservation::Reservation ( )

Default constructor.

Definition at line 46 of file uan-mac-rc.cc.

◆ Reservation() [2/2]

ns3::Reservation::Reservation ( std::list< std::pair< Ptr< Packet >, Mac8Address > > &  list,
uint8_t  frameNo,
uint32_t  maxPkts = 0 
)

Create Reservation object with given packet list, frame number and max packets.

Parameters
listList of packets for assigned to reservation.
frameNoFrame number of reservation transmission.
maxPktsMaximum number of packets to assign to reservation from packet list (0 = no maximum).

Definition at line 55 of file uan-mac-rc.cc.

References ns3::UanHeaderRcData::GetSerializedSize(), ns3::UanHeaderCommon::GetSerializedSize(), list, m_length, and m_pktList.

◆ ~Reservation()

ns3::Reservation::~Reservation ( )

Destructor.

Definition at line 76 of file uan-mac-rc.cc.

References m_pktList, and m_timestamp.

Member Function Documentation

◆ AddTimestamp()

void ns3::Reservation::AddTimestamp ( Time  t)

Set the time of the latest RTS sent.

Parameters
tRTS timestamp.

Definition at line 135 of file uan-mac-rc.cc.

References m_timestamp.

Referenced by ns3::UanMacRc::Associate().

◆ GetFrameNo()

uint8_t ns3::Reservation::GetFrameNo ( void  ) const

Get the frame number.

Returns
The frame number.

Definition at line 105 of file uan-mac-rc.cc.

References m_frameNo.

Referenced by ns3::UanMacRc::CreateRtsHeader().

◆ GetLength()

uint32_t ns3::Reservation::GetLength ( void  ) const

Get the total length of the Reservation.

This is the sum of packets with headers.

Returns
Total length, in bytes.

Definition at line 93 of file uan-mac-rc.cc.

References m_length.

Referenced by ns3::UanMacRc::CreateRtsHeader().

◆ GetNoFrames()

uint32_t ns3::Reservation::GetNoFrames ( void  ) const

Get the number of frames in this Reservation.

Returns
Number of frames.

Definition at line 87 of file uan-mac-rc.cc.

References m_pktList.

Referenced by ns3::UanMacRc::CreateRtsHeader().

◆ GetPktList()

const std::list< std::pair< Ptr< Packet >, Mac8Address > > & ns3::Reservation::GetPktList ( void  ) const

Get the list of packets.

Returns
The list of packets.

Definition at line 99 of file uan-mac-rc.cc.

References m_pktList.

◆ GetRetryNo()

uint8_t ns3::Reservation::GetRetryNo ( void  ) const

Get the retry number.

Returns
The retry number.

Definition at line 111 of file uan-mac-rc.cc.

References m_retryNo.

Referenced by ns3::UanMacRc::CreateRtsHeader().

◆ GetTimestamp()

Time ns3::Reservation::GetTimestamp ( uint8_t  n) const

Get the timestamp for the n'th RTS.

Parameters
nWhich retry number.
Returns
N'th timestamp.

Definition at line 117 of file uan-mac-rc.cc.

References m_timestamp, and sample-rng-plot::n.

Referenced by ns3::UanMacRc::CreateRtsHeader().

◆ IncrementRetry()

void ns3::Reservation::IncrementRetry ( )

Increment the retry count.

Definition at line 141 of file uan-mac-rc.cc.

References m_retryNo.

◆ IsTransmitted()

bool ns3::Reservation::IsTransmitted ( ) const
Returns
True if reservation packets have been transmitted.

Definition at line 123 of file uan-mac-rc.cc.

References m_transmitted.

◆ SetFrameNo()

void ns3::Reservation::SetFrameNo ( uint8_t  fn)

Set the frame number.

Parameters
fnThe frame number.

Definition at line 129 of file uan-mac-rc.cc.

References m_frameNo.

◆ SetTransmitted()

void ns3::Reservation::SetTransmitted ( bool  t = true)

Set the reservation transmitted state.

Parameters
tTrue if resevation has been transmitted.

Definition at line 147 of file uan-mac-rc.cc.

References m_transmitted, and NS_UNUSED.

Member Data Documentation

◆ m_frameNo

uint8_t ns3::Reservation::m_frameNo
private

Frame number.

Definition at line 138 of file uan-mac-rc.h.

Referenced by GetFrameNo(), and SetFrameNo().

◆ m_length

uint32_t ns3::Reservation::m_length
private

Total length of queued packets.

Definition at line 136 of file uan-mac-rc.h.

Referenced by GetLength(), and Reservation().

◆ m_pktList

std::list<std::pair <Ptr<Packet>, Mac8Address > > ns3::Reservation::m_pktList
private

Queued packets for each address.

Definition at line 134 of file uan-mac-rc.h.

Referenced by GetNoFrames(), GetPktList(), Reservation(), and ~Reservation().

◆ m_retryNo

uint8_t ns3::Reservation::m_retryNo
private

Number of retries.

Definition at line 142 of file uan-mac-rc.h.

Referenced by GetRetryNo(), and IncrementRetry().

◆ m_timestamp

std::vector<Time> ns3::Reservation::m_timestamp
private

Timestamps for each retry.

Definition at line 140 of file uan-mac-rc.h.

Referenced by AddTimestamp(), GetTimestamp(), and ~Reservation().

◆ m_transmitted

bool ns3::Reservation::m_transmitted
private

Has this reservation been transmitted.

Definition at line 144 of file uan-mac-rc.h.

Referenced by IsTransmitted(), and SetTransmitted().


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