![]() |
User Manual, Developers Guide and API Documentation |
![]() |
#include <ldk/multiplexer/Dispatcher.hpp>


Public Member Functions | |
| virtual void | calculateSizes (const CommandPool *commandPool, Bit &commandPoolSize, Bit &sduSize) const |
| Default calculateSizes implementation. | |
| Dispatcher (fun::FUN *fuNet, const pyconfig::View &_config) | |
| int | getOpcodeSize () const |
| virtual void | processIncoming (const CompoundPtr &compound) |
| Process compounds on uplink. | |
| virtual void | processOutgoing (const CompoundPtr &compound) |
| Process compounds on downlink. | |
| virtual FunctionalUnit * | whenConnecting () |
| Return the FunctionalUnit holding the connector set for this FunctionalUnit. | |
| virtual | ~Dispatcher () |
Private Attributes | |
| pyconfig::View | config |
| logger::Logger | logger |
| int | opcode |
| std::list< OpcodeSetter * > | opcodeSetters |
| int | opcodeSize |
------ ------ ------
| FU 1 | | FU 2 | ... | FU N |
------ ------ ------
| | |
v v v
----------------------------------
| Dispatcher |
----------------------------------
|
v
-------
| lower |
-------
Dispatcher is an OpcodeProvider. Incoming compounds get tagged according to the FU they came from. After tagging, they get delivered to the lower FU.
Incoming compounds can be directly delivered to the FrameDispatcher. They get delivered to the FU they have been originally received from.
Definition at line 73 of file Dispatcher.hpp.
| Dispatcher::Dispatcher | ( | fun::FUN * | fuNet, | |
| const pyconfig::View & | _config | |||
| ) |
Definition at line 38 of file Dispatcher.cpp.
| Dispatcher::~Dispatcher | ( | ) | [virtual] |
Definition at line 55 of file Dispatcher.cpp.
| void Dispatcher::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 117 of file Dispatcher.cpp.
| int wns::ldk::multiplexer::Dispatcher::getOpcodeSize | ( | ) | const [inline] |
Definition at line 95 of file Dispatcher.hpp.
| void Dispatcher::processIncoming | ( | const CompoundPtr & | compound | ) | [virtual] |
Override this method to handle incoming compounds.
Implements wns::ldk::ProcessorInterface.
Definition at line 105 of file Dispatcher.cpp.
| void Dispatcher::processOutgoing | ( | const CompoundPtr & | ) | [virtual] |
Override this method to handle outgoing compounds.
Implements wns::ldk::ProcessorInterface.
Definition at line 93 of file Dispatcher.cpp.
| FunctionalUnit * Dispatcher::whenConnecting | ( | ) | [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):
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.
Reimplemented from wns::ldk::FunctionalUnit.
Definition at line 72 of file Dispatcher.cpp.
Definition at line 97 of file Dispatcher.hpp.
int wns::ldk::multiplexer::Dispatcher::opcode [private] |
Definition at line 102 of file Dispatcher.hpp.
std::list<OpcodeSetter*> wns::ldk::multiplexer::Dispatcher::opcodeSetters [private] |
Definition at line 99 of file Dispatcher.hpp.
Definition at line 101 of file Dispatcher.hpp.
1.5.5