User Manual, Developers Guide and API Documentation

wns::ldk::FlowSeparator Class Reference
[FlowSeparator]

Manage FU instances for different flows. More...

#include <ldk/FlowSeparator.hpp>

Inheritance diagram for wns::ldk::FlowSeparator:

Inheritance graph
[legend]
Collaboration diagram for wns::ldk::FlowSeparator:

Collaboration graph
[legend]

List of all members.

Public Types

typedef std::list
< ConnectorReceptacleSeparator * > 
ConnectorReceptacleSeparatorList
typedef std::list
< DelivererReceptacleSeparator * > 
DelivererReceptacleSeparatorList
typedef std::map< ConstKeyPtr,
FunctionalUnit *, DerefLess
< ConstKeyPtr > > 
InstanceMap
typedef std::list
< ReceptorReceptacleSeparator * > 
ReceptorReceptacleSeparatorList
typedef std::list< std::string > StringList

Public Member Functions

void addInstance (const ConstKeyPtr &key)
 Register an instance for a given key.
void addInstance (const ConstKeyPtr &key, FunctionalUnit *functionalUnit)
 Register an instance for a given key.
 FlowSeparator (const FlowSeparator &)
 FlowSeparator (fun::FUN *fuNet, const pyconfig::View &_config)
 FunctionalUnitFactory compliant constructor for automatic FUN creation.
 FlowSeparator (fun::FUN *fuNet, const pyconfig::View &_config, std::auto_ptr< KeyBuilder > _keyBuilder, std::auto_ptr< flowseparator::NotFoundStrategy > _notFound)
 Constructor for FlowSeparator usage outside automatic FUN creation.
FunctionalUnitgetInstance (const CompoundPtr &compound, int direction) const
FunctionalUnitgetInstance (const ConstKeyPtr &key) const
 Return the instance matching a key.
ConstKeyPtr getKey (const CompoundPtr &compound, int direction) const
 Return the matching key for a given compound/direction.
virtual void onFUNCreated ()
 Resolve inter-FU dependencies.
void removeInstance (const ConstKeyPtr &key)
 Remove an instance matching a key.
virtual std::size_t size () const
 Return the number of instances currently managed by the FlowSeparator.
virtual ~FlowSeparator ()

Private Member Functions

void connectFU (FunctionalUnit *functionalUnit) const
 Integrate FU instance.
void disintegrate (const ConstKeyPtr &key)
 Disintegrate FU instance.
void init ()
void integrate (const ConstKeyPtr &key, FunctionalUnit *functionalUnit)
 Integrate FU instance.
CompoundHandlerInterface
The CompoundHandlerInterface methods (isAccepting, doSendData, doOnData, wakeup) are delegated to the matching instance.

Instance retrieval is delegated to the internal implementation _getInstance. If no matching instance is found, new instances may get instantiated on the fly. In future this may depend on the FlowSeparator configuration.

virtual bool doIsAccepting (const CompoundPtr &compound) const
virtual void doOnData (const CompoundPtr &compound)
virtual void doSendData (const CompoundPtr &compound)
virtual void doWakeup ()

Private Attributes

pyconfig::View config
ConnectorReceptacleSeparatorconnectorReceptacleSinglePort_
ConnectorReceptacleSeparatorList crsList_
DelivererReceptacleSeparatordelivererReceptacleSinglePort_
wns::distribution::StandardUniform dis
DelivererReceptacleSeparatorList drsList_
FunctionalUnitinstanceBusy
InstanceMap instances
std::auto_ptr< KeyBuilderkeyBuilder
logger::Logger logger
std::auto_ptr
< flowseparator::NotFoundStrategy
notFound
FunctionalUnitprototypeFU_
ReceptorReceptacleSeparatorreceptorReceptacleSinglePort_
ReceptorReceptacleSeparatorList rrsList_

Friends

class ConnectorReceptacleSeparator

Classes

class  ConnectorReceptacleSeparator
class  DelivererReceptacleSeparator
class  InstanceNotFound
class  ReceptacleManagement
class  ReceptorReceptacleSeparator


Detailed Description

Todo:
pab, 2007-02-12: cloning the flowseparator currently results in multiple flowseparators sharing the same notFoundStrategy Object and the same KeyBuilder Object
Static Structure of FlowSeparator:
FlowSeparator.png

Definition at line 76 of file FlowSeparator.hpp.


Member Typedef Documentation

Definition at line 290 of file FlowSeparator.hpp.

Definition at line 291 of file FlowSeparator.hpp.

Definition at line 288 of file FlowSeparator.hpp.

Definition at line 292 of file FlowSeparator.hpp.

typedef std::list<std::string> wns::ldk::FlowSeparator::StringList

Definition at line 289 of file FlowSeparator.hpp.


Constructor & Destructor Documentation

wns::ldk::FlowSeparator::FlowSeparator ( fun::FUN fuNet,
const pyconfig::View _config,
std::auto_ptr< KeyBuilder _keyBuilder,
std::auto_ptr< flowseparator::NotFoundStrategy _notFound 
)

FlowSeparator::FlowSeparator ( fun::FUN fuNet,
const pyconfig::View _config 
)

Definition at line 233 of file FlowSeparator.cpp.

FlowSeparator::FlowSeparator ( const FlowSeparator other  ) 

Definition at line 272 of file FlowSeparator.cpp.

FlowSeparator::~FlowSeparator (  )  [virtual]

Definition at line 421 of file FlowSeparator.cpp.


Member Function Documentation

void wns::ldk::FlowSeparator::addInstance ( const ConstKeyPtr key  ) 

Don't keep references to key or functionalUnit, since FlowSeparator is authorized to delete them.

void wns::ldk::FlowSeparator::addInstance ( const ConstKeyPtr key,
FunctionalUnit functionalUnit 
)

Don't keep references to key or functionalUnit, since FlowSeparator is authorized to delete them.

void FlowSeparator::connectFU ( FunctionalUnit functionalUnit  )  const [private]

Apply bookkeeping and link instance into the FUN.

Definition at line 574 of file FlowSeparator.cpp.

void wns::ldk::FlowSeparator::disintegrate ( const ConstKeyPtr key  )  [private]

Undo a previous integrateInstance.

bool FlowSeparator::doIsAccepting ( const CompoundPtr compound  )  const [private, virtual]

Definition at line 558 of file FlowSeparator.cpp.

void FlowSeparator::doOnData ( const CompoundPtr compound  )  [private, virtual]

Definition at line 480 of file FlowSeparator.cpp.

void FlowSeparator::doSendData ( const CompoundPtr compound  )  [private, virtual]

Definition at line 472 of file FlowSeparator.cpp.

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

Definition at line 566 of file FlowSeparator.cpp.

FunctionalUnit * FlowSeparator::getInstance ( const CompoundPtr compound,
int  direction 
) const

Definition at line 507 of file FlowSeparator.cpp.

FunctionalUnit* wns::ldk::FlowSeparator::getInstance ( const ConstKeyPtr key  )  const

Returns NULL if no instance matching the key is found.

ConstKeyPtr FlowSeparator::getKey ( const CompoundPtr compound,
int  direction 
) const

Definition at line 513 of file FlowSeparator.cpp.

void FlowSeparator::init (  )  [private]

Definition at line 280 of file FlowSeparator.cpp.

void wns::ldk::FlowSeparator::integrate ( const ConstKeyPtr key,
FunctionalUnit functionalUnit 
) [private]

Apply bookkeeping and link instance into the FUN.

void FlowSeparator::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 455 of file FlowSeparator.cpp.

void wns::ldk::FlowSeparator::removeInstance ( const ConstKeyPtr key  ) 

Removes the FU matching the key and frees all resources (key and FU).

std::size_t FlowSeparator::size (  )  const [virtual]

Definition at line 488 of file FlowSeparator.cpp.


Friends And Related Function Documentation

friend class ConnectorReceptacleSeparator [friend]

Definition at line 294 of file FlowSeparator.hpp.


Member Data Documentation

Definition at line 441 of file FlowSeparator.hpp.

Definition at line 436 of file FlowSeparator.hpp.

Definition at line 431 of file FlowSeparator.hpp.

Definition at line 437 of file FlowSeparator.hpp.

Definition at line 447 of file FlowSeparator.hpp.

Definition at line 432 of file FlowSeparator.hpp.

Definition at line 439 of file FlowSeparator.hpp.

Definition at line 430 of file FlowSeparator.hpp.

Definition at line 443 of file FlowSeparator.hpp.

Definition at line 449 of file FlowSeparator.hpp.

Definition at line 445 of file FlowSeparator.hpp.

Definition at line 435 of file FlowSeparator.hpp.

Definition at line 438 of file FlowSeparator.hpp.

Definition at line 433 of file FlowSeparator.hpp.


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

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