A collection of messages being transmitted over connections. More...
#include <yarp/os/impl/PortCorePackets.h>
Public Member Functions | |
virtual | ~PortCorePackets () |
size_t | getCount () |
PortCorePacket * | getFreePacket () |
Get a packet that we can prepare for sending. More... | |
void | freePacket (PortCorePacket *packet, bool clear=true) |
Force the given packet into an inactive state. More... | |
bool | completePacket (PortCorePacket *packet) |
Send a completion notification if a packet has finished being sent on all connections. More... | |
bool | checkPacket (PortCorePacket *packet) |
Move a packet to the inactive state if it has finished being sent on all connections. More... | |
A collection of messages being transmitted over connections.
This tracks uses of the messages for memory management purposes. We call messages "packets" for no particular reason.
Definition at line 28 of file PortCorePackets.h.
|
virtual |
Definition at line 21 of file PortCorePackets.cpp.
bool PortCorePackets::checkPacket | ( | PortCorePacket * | packet | ) |
Move a packet to the inactive state if it has finished being sent on all connections.
packet | the packet to work on |
Definition at line 82 of file PortCorePackets.cpp.
bool PortCorePackets::completePacket | ( | PortCorePacket * | packet | ) |
Send a completion notification if a packet has finished being sent on all connections.
packet | the packet to work on |
Definition at line 71 of file PortCorePackets.cpp.
void PortCorePackets::freePacket | ( | PortCorePacket * | packet, |
bool | clear = true |
||
) |
Force the given packet into an inactive state.
See checkPacket() for a less drastic way to nudge a packet onwards in its lifecycle.
packet | the packet to work on |
clear | whether to reset the contents of the packet |
Definition at line 59 of file PortCorePackets.cpp.
size_t PortCorePackets::getCount | ( | ) |
Definition at line 33 of file PortCorePackets.cpp.
PortCorePacket * PortCorePackets::getFreePacket | ( | ) |
Get a packet that we can prepare for sending.
If a previously sent packet that is not being used is available, we take that. Otherwise we create one.
Definition at line 38 of file PortCorePackets.cpp.