|
Click
|
#include <batchelement.hh>
Inherits BatchElement.
Public Member Functions | |
| void | push (int port, Packet *p) override |
| Push packet p onto push input port. | |
| Packet * | pull (int port) override |
| Pull a packet from pull output port. | |
Batch helper element.
Allows the user to simply implement simple_action and simple_action_batch but relying on CRTP instead of virtual, removing one virtual call.
The inherited element cannot be extended further because of CRTP !
|
inlineoverridevirtual |
Push packet p onto push input port.
| port | the input port number on which the packet arrives |
| p | the packet |
An upstream element transferred packet p to this element over a push connection. This element should process the packet as necessary and return. The packet arrived on input port port. push() must account for the packet either by pushing it further downstream, by freeing it, or by storing it temporarily.
The default implementation calls simple_action().
Reimplemented from Element.
|
inlineoverridevirtual |
Pull a packet from pull output port.
| port | the output port number receiving the pull request. |
A downstream element initiated a packet transfer from this element over a pull connection. This element should return a packet pointer, or null if no packet is available. The pull request arrived on output port port.
Often, pull() methods will request packets from upstream using input(i).pull(). The default implementation calls simple_action().
Reimplemented from Element.