YARP
Yet Another Robot Platform
UdpCarrier.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_UDPCARRIER_H
11 #define YARP_OS_IMPL_UDPCARRIER_H
12 
15 
16 namespace yarp {
17 namespace os {
18 namespace impl {
19 
23 class UdpCarrier :
24  public AbstractCarrier
25 {
26 public:
28 
29  Carrier* create() const override;
30 
31  std::string getName() const override;
32 
33  virtual int getSpecifierCode() const;
34 
35  bool checkHeader(const Bytes& header) override;
36  void getHeader(Bytes& header) const override;
37  void setParameters(const Bytes& header) override;
38  bool requireAck() const override;
39  bool isConnectionless() const override;
40  bool respondToHeader(ConnectionState& proto) override;
41  bool expectReplyToHeader(ConnectionState& proto) override;
42 };
43 
44 } // namespace impl
45 } // namespace os
46 } // namespace yarp
47 
48 #endif // YARP_OS_IMPL_UDPCARRIER_H
yarp::os::impl::UdpCarrier::expectReplyToHeader
bool expectReplyToHeader(ConnectionState &proto) override
Process reply to header, if one is expected for this carrier.
Definition: UdpCarrier.cpp:85
yarp::os::Carrier
A base class for connection types (tcp, mcast, shmem, ...) which are called carriers in YARP.
Definition: Carrier.h:48
yarp::os::impl::UdpCarrier::UdpCarrier
UdpCarrier()
yarp::os::impl::UdpCarrier::getHeader
void getHeader(Bytes &header) const override
Provide 8 bytes describing this connection sufficiently to allow the other side of a connection to se...
Definition: UdpCarrier.cpp:42
yarp::os::impl::UdpCarrier::checkHeader
bool checkHeader(const Bytes &header) override
Given the first 8 bytes received on a connection, decide if this is the right carrier type to use for...
Definition: UdpCarrier.cpp:37
yarp::os::impl::UdpCarrier::getName
std::string getName() const override
Get the name of this connection type ("tcp", "mcast", "shmem", ...)
Definition: UdpCarrier.cpp:27
AbstractCarrier.h
yarp::os::impl::UdpCarrier::requireAck
bool requireAck() const override
Check if carrier has flow control, requiring sent messages to be acknowledged by recipient.
Definition: UdpCarrier.cpp:52
yarp::os::AbstractCarrier
A starter class for implementing simple carriers.
Definition: AbstractCarrier.h:25
yarp::os::impl::UdpCarrier
Communicating between two ports via UDP.
Definition: UdpCarrier.h:25
yarp::os::Bytes
A simple abstraction for a block of bytes.
Definition: Bytes.h:28
DgramTwoWayStream.h
yarp::os::ConnectionState
The basic state of a connection - route, streams in use, etc.
Definition: ConnectionState.h:31
yarp::os::impl::UdpCarrier::setParameters
void setParameters(const Bytes &header) override
Configure this carrier based on the first 8 bytes of the connection.
Definition: UdpCarrier.cpp:47
yarp::os::impl::UdpCarrier::create
Carrier * create() const override
Factory method.
Definition: UdpCarrier.cpp:22
yarp::os::impl::UdpCarrier::respondToHeader
bool respondToHeader(ConnectionState &proto) override
Respond to the header.
Definition: UdpCarrier.cpp:63
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::os::impl::UdpCarrier::getSpecifierCode
virtual int getSpecifierCode() const
Definition: UdpCarrier.cpp:32
yarp::os::impl::UdpCarrier::isConnectionless
bool isConnectionless() const override
Check if this carrier is connectionless (like udp, mcast) or connection based (like tcp).
Definition: UdpCarrier.cpp:57