YARP
Yet Another Robot Platform
PortCorePackets.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006-2010 RobotCub Consortium
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
10 #ifndef YARP_OS_IMPL_PORTCOREPACKETS_H
11 #define YARP_OS_IMPL_PORTCOREPACKETS_H
12 
14 
15 #include <yarp/os/Log.h>
16 
17 #include <list>
18 
19 namespace yarp {
20 namespace os {
21 namespace impl {
22 
29 {
30 private:
31  std::list<PortCorePacket*> inactive; // unused packets we may reuse
32  std::list<PortCorePacket*> active; // a list of packets being sent
33 public:
34  virtual ~PortCorePackets();
35 
39  size_t getCount();
40 
49 
56  void freePacket(PortCorePacket* packet, bool clear = true);
57 
64  bool completePacket(PortCorePacket* packet);
65 
72  bool checkPacket(PortCorePacket* packet);
73 };
74 
75 
76 } // namespace impl
77 } // namespace os
78 } // namespace yarp
79 
80 #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: environment.h:18