18 PortCorePackets::~PortCorePackets()
20 while (!inactive.empty()) {
21 delete inactive.back();
24 while (!active.empty()) {
37 if (inactive.empty()) {
40 yCAssert(PORTCOREPACKETS, obj !=
nullptr);
41 inactive.push_back(obj);
44 if (next ==
nullptr) {
45 yCError(PORTCOREPACKETS,
"*** YARP consistency check failed.\n");
46 yCError(PORTCOREPACKETS,
"*** There has been a low-level failure in \"PortCorePackets\".\n");
47 yCError(PORTCOREPACKETS,
"*** This typically occurs when ports are accessed in a non-threadsafe way.\n");
48 yCError(PORTCOREPACKETS,
"*** For help: https://github.com/robotology/yarp/issues/new\n");
50 yCAssert(PORTCOREPACKETS, next !=
nullptr);
51 inactive.remove(next);
52 active.push_back(next);
58 if (packet !=
nullptr) {
63 active.remove(packet);
64 inactive.push_back(packet);
70 if (packet !=
nullptr) {
81 if (packet !=
nullptr) {
A single message, potentially being transmitted on multiple connections.
bool completed
has a notification of completion been sent
void complete()
Send a completion notification if we haven't already, and there's somewhere to send it to.
void reset()
Delete anything we own and enter a clean state, as if freshly created.
A collection of messages being transmitted over connections.
bool completePacket(PortCorePacket *packet)
Send a completion notification if a packet has finished being sent on all connections.
PortCorePacket * getFreePacket()
Get a packet that we can prepare for sending.
bool checkPacket(PortCorePacket *packet)
Move a packet to the inactive state if it has finished being sent on all connections.
void freePacket(PortCorePacket *packet, bool clear=true)
Force the given packet into an inactive state.
#define yCError(component,...)
#define yCAssert(component, x)
#define YARP_OS_LOG_COMPONENT(name, name_string)