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
yarp::os::impl::PortCorePackets::checkPacket
bool checkPacket(PortCorePacket *packet)
Move a packet to the inactive state if it has finished being sent on all connections.
Definition: PortCorePackets.cpp:82
yarp::os::impl::PortCorePackets::~PortCorePackets
virtual ~PortCorePackets()
Definition: PortCorePackets.cpp:21
Log.h
yarp::os::impl::PortCorePacket
A single message, potentially being transmitted on multiple connections.
Definition: PortCorePacket.h:25
yarp::os::impl::PortCorePackets::freePacket
void freePacket(PortCorePacket *packet, bool clear=true)
Force the given packet into an inactive state.
Definition: PortCorePackets.cpp:59
yarp::os::impl::PortCorePackets::getFreePacket
PortCorePacket * getFreePacket()
Get a packet that we can prepare for sending.
Definition: PortCorePackets.cpp:38
PortCorePacket.h
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::os::impl::PortCorePackets::completePacket
bool completePacket(PortCorePacket *packet)
Send a completion notification if a packet has finished being sent on all connections.
Definition: PortCorePackets.cpp:71
yarp::os::impl::PortCorePackets
A collection of messages being transmitted over connections.
Definition: PortCorePackets.h:29
yarp::os::impl::PortCorePackets::getCount
size_t getCount()
Definition: PortCorePackets.cpp:33