|
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.
Build an element that implements only simple_action, and which does not call pull or push. Just extend SimpleElement<T> where T is the new element itself. It also avoids the virtual call, so a vanilla element using this version even without batching will run faster.
Downside : 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.