User Manual, Developers Guide and API Documentation

wns::ldk::command::FlowControl Class Reference

Start/stop accepting incoming/outgoing compounds. More...

#include <ldk/command/FlowControl.hpp>

Inheritance diagram for wns::ldk::command::FlowControl:

Inheritance graph
[legend]
Collaboration diagram for wns::ldk::command::FlowControl:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual void calculateSizes (const CommandPool *commandPool, Bit &commandPoolSize, Bit &dataSize) const
 Default calculateSizes implementation.
virtual void close ()
virtual CommandPoolcreateReply (const CommandPool *original) const
 Default createReply implementation.
 FlowControl (fun::FUN *fuNet, const wns::pyconfig::View &config)
virtual CompoundPtr getSomethingToSend ()
 Return the PDU that is ready to be sent.
virtual bool hasCapacity () const
 Return true, if the FunctionalUnit is still accepting compounds.
virtual const CompoundPtr hasSomethingToSend () const
 Return a PDU that is ready to be sent or NULL, if none available.
virtual void onFUNCreated ()
 Resolve inter-FU dependencies.
virtual void open ()
virtual void processIncoming (const CompoundPtr &compound)
 Process compounds on uplink.
virtual void processOutgoing (const CompoundPtr &compound)
 Process compounds on downlink.

Private Member Functions

void send (FlowControlCommand::FrameType type)

Private Attributes

pyconfig::View config
struct
wns::ldk::command::FlowControl::_friends 
friends
logger::Logger logger
CompoundPtr toSend

Classes

struct  _friends


Detailed Description

Control a Gate via the GateInterface.

Definition at line 75 of file FlowControl.hpp.


Constructor & Destructor Documentation

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

Definition at line 39 of file FlowControl.cpp.


Member Function Documentation

void FlowControl::calculateSizes ( const CommandPool commandPool,
Bit commandPoolSize,
Bit dataSize 
) const [virtual]

The default implementation delegates calculation to upper functional units, modifying the result to include the size of the provided Command.

Reimplemented from wns::ldk::CommandTypeSpecifier< T >.

Definition at line 155 of file FlowControl.cpp.

void FlowControl::close (  )  [virtual]

Definition at line 68 of file FlowControl.cpp.

CommandPool * FlowControl::createReply ( const CommandPool original  )  const [virtual]

The default behaviour is to delegate creation of replies to upper functional units.

Reimplemented from wns::ldk::CommandTypeSpecifier< T >.

Definition at line 164 of file FlowControl.cpp.

CompoundPtr FlowControl::getSomethingToSend (  )  [virtual]

This method must never return NULL. This method will only be called after a call to hasSomethingToSend returned a non-null value. The FunctionalUnit must return the same PDU as returned by hasSomethingToSend.

Implements wns::ldk::DelayedInterface.

Definition at line 126 of file FlowControl.cpp.

bool FlowControl::hasCapacity (  )  const [virtual]

While hasCapacity returns false, processIncoming will never be called.

Implements wns::ldk::DelayedInterface.

Definition at line 80 of file FlowControl.cpp.

const CompoundPtr FlowControl::hasSomethingToSend (  )  const [virtual]

Implements wns::ldk::DelayedInterface.

Definition at line 119 of file FlowControl.cpp.

void FlowControl::onFUNCreated (  )  [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 147 of file FlowControl.cpp.

void FlowControl::open (  )  [virtual]

Definition at line 56 of file FlowControl.cpp.

void FlowControl::processIncoming ( const CompoundPtr compound  )  [virtual]

Override this method to handle incoming compounds.

Implements wns::ldk::DelayedInterface.

Definition at line 94 of file FlowControl.cpp.

void FlowControl::processOutgoing ( const CompoundPtr  )  [virtual]

Override this method to handle outgoing compounds.

Implements wns::ldk::DelayedInterface.

Definition at line 87 of file FlowControl.cpp.

void FlowControl::send ( FlowControlCommand::FrameType  type  )  [private]

Definition at line 135 of file FlowControl.cpp.


Member Data Documentation

Definition at line 102 of file FlowControl.hpp.

Definition at line 110 of file FlowControl.hpp.

Definition at line 104 of file FlowControl.hpp.


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

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