User Manual, Developers Guide and API Documentation

wns::ldk::tools::UpUnconnectable Class Reference

Disables the connection mechanism from upside. More...

#include <ldk/tools/UpUnconnectable.hpp>

Inheritance diagram for wns::ldk::tools::UpUnconnectable:

Inheritance graph
[legend]
Collaboration diagram for wns::ldk::tools::UpUnconnectable:

Collaboration graph
[legend]

List of all members.

Private Member Functions

virtual bool doIsAccepting (const CompoundPtr &) const
virtual void doSendData (const CompoundPtr &)
virtual DeliverergetDeliverer () const
virtual FunctionalUnitwhenConnecting ()
 Return the FunctionalUnit holding the connector set for this FunctionalUnit.


Detailed Description

Derive from this class if you want to disable the connection mechanism from upside. An Exception ist thrown if the Functional Unit is getting connected from upside.

Definition at line 43 of file UpUnconnectable.hpp.


Member Function Documentation

virtual bool wns::ldk::tools::UpUnconnectable::doIsAccepting ( const CompoundPtr  )  const [inline, private, virtual]

Definition at line 65 of file UpUnconnectable.hpp.

virtual void wns::ldk::tools::UpUnconnectable::doSendData ( const CompoundPtr  )  [inline, private, virtual]

Definition at line 71 of file UpUnconnectable.hpp.

virtual Deliverer* wns::ldk::tools::UpUnconnectable::getDeliverer (  )  const [inline, private, virtual]

Implements wns::ldk::HasDelivererInterface.

Definition at line 49 of file UpUnconnectable.hpp.

virtual FunctionalUnit* wns::ldk::tools::UpUnconnectable::whenConnecting (  )  [inline, private, virtual]

whenConnecting is used during fun::FUN setup as part of the connect mechanism. The default implementation provided here are perfectly fine for most cases.

Some units need to react differently on requests of other units depending on the identity of that other unit. The only solution without extending the interfaces and without borrowing the COMEFROM statement from another popular high level programming language... is to create different contacts.

A motivating example (actually the reason for all this):

Dispatcher

The dispatcher is a functional unit having multiple other units in its receptor/deliverer sets (they must be equal), but only one unit in its connector set. It promises to deliver every compound to the same unit that it received it from.

Unfortunately, there is no way to tell the caller from a doSendData method call. The dispatcher needs to store an opcode in its command to remember to whom the command has to be delivered to.

The idea is to create an additional FU for every FU connecting from above (remember that we only allow full connects from above). When connecting from above, during connection setup a new FU has to be created, that gets connected and activates the dispatcher command with the right opcode.

Details

To allow the connectee to insert a newly created FU in between, the connect methods (connect, downConnect, upConnect) do not operate on the FUs involved in the connect method calls directly. Instead they let the connectee specify a FU to connect to using the whenConnecting method.

See also:
connect for a description of FU interconnections.

Reimplemented from wns::ldk::FunctionalUnit.

Definition at line 55 of file UpUnconnectable.hpp.


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

Generated on Sun May 27 03:33:00 2012 for openWNS by  doxygen 1.5.5