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


Public Member Functions | |
| virtual void | calculateSizes (const CommandPool *commandPool, Bit &commandPoolSize, Bit &sduSize) const |
| Default calculateSizes implementation. | |
| FrameDispatcher (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. | |
Private Member Functions | |
| virtual void | doDownConnect (FunctionalUnit *that, const std::string &srcPort, const std::string &dstPort) |
| Connect functional units in the outgoing data flow only. Virtual backend. | |
| virtual void | doUpConnect (FunctionalUnit *that, const std::string &srcPort, const std::string &dstPort) |
| Connect functional units in the incoming data flow only. Virtual backend. | |
Private Attributes | |
| pyconfig::View | config |
| bool | downConnected |
| logger::Logger | logger |
| int | opcode |
| int | opcodeSize |
| FunctionalUnit * | pending |
| bool | upConnected |
------- ------- -------
| FU 1a | | FU 2a | ... | FU Na |
------- ------- -------
| | |
v v v
----------------------------------
| FrameDispatcher | <---
---------------------------------- |
| | | | incoming injection
v v v
------- ------- -------
| FU 1b | | FU 2b | ... | FU Nb |
------- ------- -------
FrameDispatcher is an OpcodeProvider. Incoming compounds get tagged according to the FU they came from. After tagging, they get delivered to the matching FU below: Compounds received from FU Ia get deliverd to FU Ib. Thus, in the outgoing direction, FrameDispatcher is completely transparent to the different flows.
Incoming compounds can be directly delivered to the FrameDispatcher. They get delivered to the FU they have been originally received from.
Use a FrameDispatcher to realize different roles in a FUN. Sub FUNs connected to a FrameDispatcher from above enrich a compound with information. FUs below the FrameDispatcher realize the interface to the PHY. E.g., FU 1a could implement the BCH, while FU 1b drives the PHY to transmit the information provided by FU 1a; FU 2a could be part of the user data plane, while FU 2b drives the PHY for user data transmission.
Definition at line 82 of file FrameDispatcher.hpp.
| FrameDispatcher::FrameDispatcher | ( | fun::FUN * | fuNet, | |
| const pyconfig::View & | _config | |||
| ) |
| void FrameDispatcher::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 126 of file FrameDispatcher.cpp.
| void FrameDispatcher::doDownConnect | ( | FunctionalUnit * | that, | |
| const std::string & | srcPort, | |||
| const std::string & | dstPort | |||
| ) | [private, virtual] |
Implement this method to modify the connect behavior in the outgoing data flow.
Reimplemented from wns::ldk::FunctionalUnit.
Definition at line 80 of file FrameDispatcher.cpp.
| void FrameDispatcher::doUpConnect | ( | FunctionalUnit * | that, | |
| const std::string & | srcPort, | |||
| const std::string & | dstPort | |||
| ) | [private, virtual] |
Implement this method to modify the connect behavior in the incoming data flow.
Reimplemented from wns::ldk::FunctionalUnit.
Definition at line 91 of file FrameDispatcher.cpp.
| int wns::ldk::multiplexer::FrameDispatcher::getOpcodeSize | ( | ) | const [inline] |
Definition at line 103 of file FrameDispatcher.hpp.
| void FrameDispatcher::processIncoming | ( | const CompoundPtr & | compound | ) | [virtual] |
Override this method to handle incoming compounds.
Implements wns::ldk::ProcessorInterface.
Definition at line 114 of file FrameDispatcher.cpp.
| void FrameDispatcher::processOutgoing | ( | const CompoundPtr & | ) | [virtual] |
Override this method to handle outgoing compounds.
Implements wns::ldk::ProcessorInterface.
Definition at line 102 of file FrameDispatcher.cpp.
| FunctionalUnit * FrameDispatcher::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 58 of file FrameDispatcher.cpp.
Definition at line 112 of file FrameDispatcher.hpp.
Definition at line 119 of file FrameDispatcher.hpp.
Definition at line 121 of file FrameDispatcher.hpp.
Definition at line 115 of file FrameDispatcher.hpp.
Definition at line 114 of file FrameDispatcher.hpp.
Definition at line 117 of file FrameDispatcher.hpp.
Definition at line 118 of file FrameDispatcher.hpp.
1.5.5