YARP
Yet Another Robot Platform
PortCorePackets.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef YARP_OS_IMPL_PORTCOREPACKETS_H
8 #define YARP_OS_IMPL_PORTCOREPACKETS_H
9 
11 
12 #include <yarp/os/Log.h>
13 
14 #include <list>
15 
16 namespace yarp {
17 namespace os {
18 namespace impl {
19 
26 {
27 private:
28  std::list<PortCorePacket*> inactive; // unused packets we may reuse
29  std::list<PortCorePacket*> active; // a list of packets being sent
30 public:
31  virtual ~PortCorePackets();
32 
36  size_t getCount();
37 
46 
53  void freePacket(PortCorePacket* packet, bool clear = true);
54 
61  bool completePacket(PortCorePacket* packet);
62 
69  bool checkPacket(PortCorePacket* packet);
70 };
71 
72 
73 } // namespace impl
74 } // namespace os
75 } // namespace yarp
76 
77 #endif // YARP_OS_IMPL_PORTCOREPACKETS_H
A single message, potentially being transmitted on multiple connections.
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.
The main, catch-all namespace for YARP.
Definition: dirs.h:16