![]() |
User Manual, Developers Guide and API Documentation |
![]() |
A Layer may consist of serveral functional units. Each of these functional units may need some additional elements within the PCI. Since the composition of functional units into a Layer is done at runtime, there is no easy way to build a PCI in advance. More...
#include <ldk/CommandPool.hpp>


Public Member Functions | |
| virtual size_t | calcObjSize () const |
| void | calculateSizes (Bit &commandPoolSize, Bit &dataSize, const FunctionalUnit *questioner=NULL) const |
| Size calculation. | |
| CommandPool (const CommandPool &that) | |
| Copy constructor - call copy constructors of all Commands. | |
| virtual std::string | dumpCommandTypes () const |
| Dumps the types of the CommandPool for debugging purposes. | |
| const fun::FUN * | getOrigin () const |
| get the FUN where this CommandPool was created | |
| const fun::FUN * | getReceiver () const |
| bool | knowsSameCommandsAs (const CommandPool &other) const |
| void | setReceiver (const fun::FUN *rec) |
| virtual void | setSDUPtr (wns::osi::PDUPtr &sdu) |
| Introduce the SDU to describe. | |
| ~CommandPool () | |
| Destructor - call destructor of all Commands. | |
Protected Member Functions | |
| CommandPool (const CommandProxy *proxy, const fun::FUN *orig) | |
| Low-level constructor. | |
Protected Attributes | |
| PathContainer | path |
| Stores the path of the commandPool through the functional units. | |
Private Types | |
| typedef std::vector< Command * > | CommandContainer |
| typedef std::vector < CommandProxy::CommandIDType > | PathContainer |
Private Member Functions | |
| Command * | find (const CommandProxy::CommandIDType &id) const |
| find a Command in the CommandPool | |
| void | insert (const CommandProxy::CommandIDType &id, Command *command) |
| Insert a Command into the CommandPool. | |
| bool | knows (const CommandProxy::CommandIDType &id) const |
| Returns true if a Command is part of a CommandPool. | |
Private Attributes | |
| CommandContainer | commands |
| Commands are stored here. | |
| const wns::ldk::fun::FUN * | origin |
| Origin where this commandPool was created. | |
| const CommandProxy * | proxy |
| This is my creator, he knows my layout and internals. | |
| const wns::ldk::fun::FUN * | receiver |
| Receiver where this commandPool is consumed (can be set and read externally). | |
Friends | |
| class | CommandProxy |
There are two problems concerning the first approach. The first is what we call the 'onion phenomenon'. Different functional units may have the need to access control information generated by other functional units, but there is no simple way to tell how many levels of compounds have to be unpacked to get the desired PCI (given that the stacking of functional units is determined at runtime). The second problem is the runtime overhead introduced by a lot of additional new/delete calls for wrapping compounds several times.
This is why we chose the second approach. CommandPool is a PCI built from a set of Commands. A CommandPool will never be accessed directly. Use a CommandProxy instead.
Definition at line 75 of file CommandPool.hpp.
typedef std::vector<Command*> wns::ldk::CommandPool::CommandContainer [private] |
Definition at line 83 of file CommandPool.hpp.
typedef std::vector<CommandProxy::CommandIDType> wns::ldk::CommandPool::PathContainer [private] |
Definition at line 82 of file CommandPool.hpp.
| CommandPool::CommandPool | ( | const CommandPool & | that | ) |
Availability of a copy constructor is essential for the concept of CommandPools in case of segmentation and reassembly.
Whenever a PDU gets segmented, its PCI is copied for every new PDU.
The first mutated Command within each copy will usually be the SAR PCI.
The corresponding SAR Entity (FunctionalUnit) will combine the incoming SDUs, discarding all received segments and creates a fresh PCI as result of the reassembly.
It is not allowed to change any Command that has been activated before segmentation between segmentation and reassembly. The reassembler may assert that.
Definition at line 52 of file CommandPool.cpp.
| CommandPool::~CommandPool | ( | ) |
Definition at line 64 of file CommandPool.cpp.
| CommandPool::CommandPool | ( | const CommandProxy * | proxy, | |
| const fun::FUN * | orig | |||
| ) | [protected] |
The created CommandPool will stay completely uninitialized. Don't call this if you aren't the CommandProxy proxy.
Definition at line 40 of file CommandPool.cpp.
| size_t CommandPool::calcObjSize | ( | ) | const [virtual] |
| void CommandPool::calculateSizes | ( | Bit & | commandPoolSize, | |
| Bit & | dataSize, | |||
| const FunctionalUnit * | questioner = NULL | |||
| ) | const |
Delegates size calculation to the CommandProxy. See CommandProxy::calculateSizes for an explanation.
Definition at line 81 of file CommandPool.cpp.
| std::string CommandPool::dumpCommandTypes | ( | ) | const [virtual] |
Definition at line 103 of file CommandPool.cpp.
| wns::ldk::Command * CommandPool::find | ( | const CommandProxy::CommandIDType & | id | ) | const [private] |
Definition at line 164 of file CommandPool.cpp.
| const fun::FUN* wns::ldk::CommandPool::getOrigin | ( | ) | const [inline] |
Definition at line 148 of file CommandPool.hpp.
| const fun::FUN* wns::ldk::CommandPool::getReceiver | ( | ) | const [inline] |
Definition at line 154 of file CommandPool.hpp.
| void CommandPool::insert | ( | const CommandProxy::CommandIDType & | id, | |
| Command * | command | |||
| ) | [private] |
Definition at line 141 of file CommandPool.cpp.
| bool CommandPool::knows | ( | const CommandProxy::CommandIDType & | id | ) | const [private] |
Definition at line 170 of file CommandPool.cpp.
| bool CommandPool::knowsSameCommandsAs | ( | const CommandPool & | other | ) | const |
Definition at line 126 of file CommandPool.cpp.
| void wns::ldk::CommandPool::setReceiver | ( | const fun::FUN * | rec | ) | [inline] |
Definition at line 151 of file CommandPool.hpp.
| void CommandPool::setSDUPtr | ( | wns::osi::PDUPtr & | sdu | ) | [virtual] |
Definition at line 91 of file CommandPool.cpp.
friend class CommandProxy [friend] |
Definition at line 80 of file CommandPool.hpp.
Definition at line 212 of file CommandPool.hpp.
const wns::ldk::fun::FUN* wns::ldk::CommandPool::origin [private] |
Definition at line 217 of file CommandPool.hpp.
PathContainer wns::ldk::CommandPool::path [protected] |
Functional units are stored in the order they activated their Commands. Because of that, each FunctionalUnit of a Layer may only occour once within the path. path is mutated and accessed directly by the CommandProxy. It is used to perform partial copying (CommandProxy::partialCopy).
Definition at line 180 of file CommandPool.hpp.
const CommandProxy* wns::ldk::CommandPool::proxy [private] |
Definition at line 207 of file CommandPool.hpp.
const wns::ldk::fun::FUN* wns::ldk::CommandPool::receiver [private] |
Definition at line 223 of file CommandPool.hpp.
1.5.5