User Manual, Developers Guide and API Documentation

dll::compoundSwitch::CompoundSwitch Class Reference

This FU switch compounds by a filter to a specified FU connection. More...

#include <compoundSwitch/CompoundSwitch.hpp>

Inheritance diagram for dll::compoundSwitch::CompoundSwitch:

Inheritance graph
[legend]
Collaboration diagram for dll::compoundSwitch::CompoundSwitch:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 CompoundSwitch (wns::ldk::fun::FUN *fuNet, const wns::pyconfig::View &config)
wns::ldk::FunctionalUnitfindFUNFriend (std::string friendName)
wns::ldk::CommandProxygetCommandProxy ()
virtual void onFUNCreated ()
 Resolve inter-FU dependencies.
 ~CompoundSwitch ()

Private Types

typedef std::list< Filter * > Filters

Private Member Functions

virtual bool doIsAccepting (const wns::ldk::CompoundPtr &compound) const
virtual void doOnData (const wns::ldk::CompoundPtr &compound)
virtual void doSendData (const wns::ldk::CompoundPtr &compound)
virtual void doWakeup ()
void printFilterAssociation ()

Private Attributes

struct
dll::compoundSwitch::CompoundSwitch::Friends 
friends_
wns::logger::Logger logger_
bool mustAccept_

Classes

struct  Friends


Detailed Description

Author:
Markus Grauer <gra@comnets.rwth-aachen.de> ------- | upper | ------- | ---------------------------------- | compoundSwitch | ---------------------------------- |filer1 |filer2 |filter3 v v v ------ ------ ------ | FU 1 | | FU 2 | ... | FU N | ------ ------ ------
The CompoundSwitch direct the compound to the first FU connection which filter matches. These functionality is implemented for compound processed by the Deliverer/onData and the Connector/sendData.

Configuring: The filter for the processed compounds are defined in the PyConfig. There are lists for onData and sendData filters. All possible filters are related to compoundSwitch::filter. The order of the FU connections must require the order of the filters in the filterlist to bind the filter to the right FU connection.

With the parameter mustAccept, two different behaviors can be selected for an outgoing compound: 1) mustAccept = true --> take the first FU whose filter matches AND which is accepting. 2) mustAccept = false --> take the first FU whose filter matches, independently if the FU is accepting.

Todo:
(gra): It should migrate to the LDK, after it is unit tested and some more detailed documentation.

Definition at line 110 of file CompoundSwitch.hpp.


Member Typedef Documentation

Definition at line 136 of file CompoundSwitch.hpp.


Constructor & Destructor Documentation

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

Definition at line 41 of file CompoundSwitch.cpp.

CompoundSwitch::~CompoundSwitch (  ) 

Definition at line 85 of file CompoundSwitch.cpp.


Member Function Documentation

bool CompoundSwitch::doIsAccepting ( const wns::ldk::CompoundPtr compound  )  const [private, virtual]

Definition at line 121 of file CompoundSwitch.cpp.

void CompoundSwitch::doOnData ( const wns::ldk::CompoundPtr compound  )  [private, virtual]

Definition at line 114 of file CompoundSwitch.cpp.

void CompoundSwitch::doSendData ( const wns::ldk::CompoundPtr compound  )  [private, virtual]

Definition at line 107 of file CompoundSwitch.cpp.

void CompoundSwitch::doWakeup (  )  [private, virtual]

Definition at line 128 of file CompoundSwitch.cpp.

wns::ldk::FunctionalUnit * CompoundSwitch::findFUNFriend ( std::string  friendName  ) 

Definition at line 100 of file CompoundSwitch.cpp.

wns::ldk::CommandProxy* dll::compoundSwitch::CompoundSwitch::getCommandProxy (  )  [inline]

Definition at line 129 of file CompoundSwitch.hpp.

void CompoundSwitch::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 91 of file CompoundSwitch.cpp.

void CompoundSwitch::printFilterAssociation (  )  [private]

Definition at line 134 of file CompoundSwitch.cpp.


Member Data Documentation

Definition at line 157 of file CompoundSwitch.hpp.

Definition at line 159 of file CompoundSwitch.hpp.


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

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