User Manual, Developers Guide and API Documentation

wifimac::lowerMAC::Buffer Class Reference

Discarding FIFO buffer of a fixed size. More...

#include <lowerMAC/Buffer.hpp>

Inheritance diagram for wifimac::lowerMAC::Buffer:

Inheritance graph
[legend]
Collaboration diagram for wifimac::lowerMAC::Buffer:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Buffer (const Buffer &other)
 Copy Constructor.
 Buffer (wns::ldk::fun::FUN *fuNet, const wns::pyconfig::View &config)
 Constructor.
virtual unsigned long int getMaxSize ()
 returns the maximum size of the buffer
virtual
wns::service::dll::UnicastAddress 
getNextReceiver () const
 returns receiver address of next compound (if any)
virtual wns::simulator::Time getNextTransmissionDuration ()
 returns transmission duration of next compound (if any)
virtual unsigned long int getSize ()
 returns the currently used buffer size
virtual wns::ldk::CompoundPtr getSomethingToSend ()
 returns the next waiting PDU
virtual bool hasCapacity () const
 Always true: If size is exceeded, frames are discarded.
virtual const wns::ldk::CompoundPtr hasSomethingToSend () const
 indicates a waiting PDU
virtual void processIncoming (const wns::ldk::CompoundPtr &compound)
 Incoming (received) compounds: Do nothing.
virtual void processOutgoing (const wns::ldk::CompoundPtr &compound)
 enqueues outgoing PDUs from above FUs outgoing compounds that are passed to the buffer from above FUs are stored in a FIFO fashion, as long as the overall sizs of the buffer isn't exceeded. Otherwise the compound is dropped
virtual ~Buffer ()
 Destructor.

Protected Attributes

wns::ldk::buffer::dropping::ContainerType buffer

Private Types

typedef unsigned long int PDUCounter

Private Member Functions

void checkLifetime ()
void onFUNCreated ()
 Resolve inter-FU dependencies.

Private Attributes

unsigned long int currentSize
PDUCounter droppedPDUs
std::auto_ptr
< wns::ldk::buffer::dropping::Drop
dropper
struct
wifimac::lowerMAC::Buffer::Friends 
friends
bool isActive
wns::logger::Logger logger
const std::string managerName
unsigned long int maxSize
wifimac::management::ProtocolCalculatorprotocolCalculator
const std::string protocolCalculatorName
const std::string raName
std::auto_ptr
< wns::ldk::buffer::SizeCalculator
sizeCalculator
PDUCounter totalPDUs

Classes

struct  Friends


Detailed Description

FIFO buffer, discarding some compounds, when the buffer is full.

The maximum size is given as number of compounds to store. The Buffer class also implements the TXOPTimeWindow interface in order to let the TXOP FU determine the size of the next compound waiting to be passed to the FU below the buffer and /or the corresponding receiver

Definition at line 53 of file Buffer.hpp.


Member Typedef Documentation

typedef unsigned long int wifimac::lowerMAC::Buffer::PDUCounter [private]

Reimplemented from wns::ldk::buffer::Buffer.

Definition at line 59 of file Buffer.hpp.


Constructor & Destructor Documentation

Buffer::Buffer ( wns::ldk::fun::FUN fuNet,
const wns::pyconfig::View config 
)

Reimplemented from wns::ldk::buffer::Buffer.

Definition at line 44 of file Buffer.cpp.

Buffer::Buffer ( const Buffer other  ) 

Definition at line 74 of file Buffer.cpp.

Buffer::~Buffer (  )  [virtual]

Reimplemented from wns::ldk::buffer::Buffer.

Definition at line 111 of file Buffer.cpp.


Member Function Documentation

void Buffer::checkLifetime (  )  [private]

Definition at line 188 of file Buffer.cpp.

unsigned long int Buffer::getMaxSize (  )  [virtual]

Implements wns::ldk::buffer::Buffer.

Definition at line 227 of file Buffer.cpp.

wns::service::dll::UnicastAddress Buffer::getNextReceiver (  )  const [virtual]

Implements wifimac::lowerMAC::ITXOPWindow.

Definition at line 246 of file Buffer.cpp.

wns::simulator::Time Buffer::getNextTransmissionDuration (  )  [virtual]

Implements wifimac::lowerMAC::ITXOPWindow.

Definition at line 234 of file Buffer.cpp.

unsigned long int Buffer::getSize (  )  [virtual]

Implements wns::ldk::buffer::Buffer.

Definition at line 220 of file Buffer.cpp.

wns::ldk::CompoundPtr Buffer::getSomethingToSend (  )  [virtual]

returns and removes the next compound from the buffer (see hasSomethingToSend())

Implements wns::ldk::DelayedInterface.

Definition at line 171 of file Buffer.cpp.

bool Buffer::hasCapacity (  )  const [virtual]

Implements wns::ldk::DelayedInterface.

Definition at line 127 of file Buffer.cpp.

const wns::ldk::CompoundPtr Buffer::hasSomethingToSend (  )  const [virtual]

if the buffer is not empty, the transmission duration of the next compound fits into the set time frame and the buffer is active, this method returns a pointer to that compound

Implements wns::ldk::DelayedInterface.

Definition at line 160 of file Buffer.cpp.

void Buffer::onFUNCreated (  )  [private, virtual]

Often FunctionalUnits require the collaboration with other FunctionalUnits to accomplish their task. For the collaboration between FunctionalUnits we coined the term "friendship".

The onFUNCreated method is a hook being called after the complete FUN has been set up. FunctionalUnits requiring the collaboration with other FunctionalUnits should resolve these dependencies by implementing this hook accordingly.

Finding friends is usually done calling wns::ldk::fun::FUN::findFriend.

When building reconfigurable FUNs, this method may get called multiple times (e.g., after each FUN reconfiguration). Keep that in mind when allocating resources in your onFUNCreated implementation.

Reimplemented from wns::ldk::FunctionalUnit.

Definition at line 102 of file Buffer.cpp.

void Buffer::processIncoming ( const wns::ldk::CompoundPtr compound  )  [virtual]

Implements wns::ldk::DelayedInterface.

Definition at line 120 of file Buffer.cpp.

void Buffer::processOutgoing ( const wns::ldk::CompoundPtr compound  )  [virtual]

Implements wns::ldk::DelayedInterface.

Definition at line 134 of file Buffer.cpp.


Member Data Documentation

Definition at line 136 of file Buffer.hpp.

Definition at line 143 of file Buffer.hpp.

Reimplemented from wns::ldk::buffer::Buffer.

Definition at line 149 of file Buffer.hpp.

Definition at line 146 of file Buffer.hpp.

Definition at line 144 of file Buffer.hpp.

Reimplemented from wns::ldk::buffer::Buffer.

Definition at line 162 of file Buffer.hpp.

const std::string wifimac::lowerMAC::Buffer::managerName [private]

Definition at line 153 of file Buffer.hpp.

unsigned long int wifimac::lowerMAC::Buffer::maxSize [private]

Definition at line 142 of file Buffer.hpp.

Definition at line 154 of file Buffer.hpp.

Definition at line 152 of file Buffer.hpp.

const std::string wifimac::lowerMAC::Buffer::raName [private]

Definition at line 151 of file Buffer.hpp.

Definition at line 145 of file Buffer.hpp.

Reimplemented from wns::ldk::buffer::Buffer.

Definition at line 148 of file Buffer.hpp.


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

Generated on Sat May 26 03:32:42 2012 for openWNS by  doxygen 1.5.5