YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
ShmemCarrier.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_SHMEM_SHMEMCARRIER_H
8#define YARP_SHMEM_SHMEMCARRIER_H
9
11
12
18{
19public:
21 virtual ~ShmemCarrier();
22
23 Carrier* create() const override;
24
25 std::string getName() const override;
26
27 virtual int getSpecifierCode() const;
28 bool requireAck() const override;
29 bool isConnectionless() const override;
30 bool checkHeader(const yarp::os::Bytes& header) override;
31 void getHeader(yarp::os::Bytes& header) const override;
32 void setParameters(const yarp::os::Bytes& header) override;
33 bool respondToHeader(yarp::os::ConnectionState& proto) override;
35
36private:
37 bool becomeShmemVersionHybridStream(yarp::os::ConnectionState& proto, bool sender);
38 bool becomeShmem(yarp::os::ConnectionState& proto, bool sender);
39};
40
41#endif // YARP_SHMEM_SHMEMCARRIER_H
Communicating between two ports via shared memory.
bool respondToHeader(yarp::os::ConnectionState &proto) override
Respond to the header.
std::string getName() const override
Get the name of this connection type ("tcp", "mcast", "shmem", ...)
bool requireAck() const override
Check if carrier has flow control, requiring sent messages to be acknowledged by recipient.
bool expectReplyToHeader(yarp::os::ConnectionState &proto) override
Process reply to header, if one is expected for this carrier.
bool checkHeader(const yarp::os::Bytes &header) override
Given the first 8 bytes received on a connection, decide if this is the right carrier type to use for...
bool isConnectionless() const override
Check if this carrier is connectionless (like udp, mcast) or connection based (like tcp).
void getHeader(yarp::os::Bytes &header) const override
Provide 8 bytes describing this connection sufficiently to allow the other side of a connection to se...
Carrier * create() const override
Factory method.
virtual ~ShmemCarrier()
void setParameters(const yarp::os::Bytes &header) override
Configure this carrier based on the first 8 bytes of the connection.
virtual int getSpecifierCode() const
A starter class for implementing simple carriers.
A simple abstraction for a block of bytes.
Definition Bytes.h:24
The basic state of a connection - route, streams in use, etc.