YARP
Yet Another Robot Platform
NullConnection.cpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
7 
8 #include <yarp/os/Bytes.h>
9 #include <yarp/os/PortReader.h>
10 #include <yarp/os/PortWriter.h>
11 
15 
16 
18 {
19  return false;
20 }
22 {
23  return true;
24 }
26 {
27  return true;
28 }
29 void NullConnection::handleEnvelope(const std::string& envelope)
30 {
31  YARP_UNUSED(envelope);
32 }
34 {
35  return false;
36 }
38 {
39  return false;
40 }
42 {
43  return false;
44 }
46 {
47  return true;
48 }
50 {
51  return false;
52 }
54 {
55  return false;
56 }
58 {
59  return false;
60 }
61 
63 {
64  return false;
65 }
66 
68 {
69  return reader;
70 }
71 
73 {
74  YARP_UNUSED(reader);
75  return true;
76 }
77 
79 {
80  return false;
81 }
82 
84 {
85  return writer;
86 }
87 
89 {
90  YARP_UNUSED(writer);
91  return true;
92 }
93 
95 {
96  return false;
97 }
98 
100 {
101  return reader;
102 }
103 
105 {
106  YARP_UNUSED(params);
107 }
108 
110 {
111  YARP_UNUSED(params);
112 }
113 
115 {
116  for (size_t i = 0; i < header.length(); i++) {
117  header.get()[i] = '\0';
118  }
119 }
120 
122 {
123 }
124 
125 std::string NullConnection::getName() const
126 {
127  return "null";
128 }
A simple abstraction for a block of bytes.
Definition: Bytes.h:25
size_t length() const
Definition: Bytes.cpp:22
const char * get() const
Definition: Bytes.cpp:27
An interface for reading from a network connection.
bool requireAck() const override
Check if carrier has flow control, requiring sent messages to be acknowledged by recipient.
void handleEnvelope(const std::string &envelope) override
Carriers that do not distinguish data from administrative headers (i.e.
bool acceptOutgoingData(const PortWriter &writer) override
Determine whether outgoing data should be accepted.
std::string getName() const override
Get the name of this connection type ("tcp", "mcast", "shmem", ...)
bool isActive() const override
Check if carrier is alive and error free.
bool isLocal() const override
Check if carrier operates within a single process.
bool acceptIncomingData(yarp::os::ConnectionReader &reader) override
Determine whether incoming data should be accepted.
bool modifiesReply() const override
Check if this carrier modifies outgoing data through the Carrier::modifyReply method.
bool canEscape() const override
Check if carrier can encode administrative messages, as opposed to just user data.
bool isPush() const override
Check if carrier is "push" or "pull" style.
const PortWriter & modifyOutgoingData(const PortWriter &writer) override
Modify outgoing payload data, if appropriate.
bool isTextMode() const override
Check if carrier is textual in nature.
void prepareDisconnect() override
Do cleanup and preparation for the coming disconnect, if necessary.
void setCarrierParams(const yarp::os::Property &params) override
Configure carrier from port administrative commands.
bool supportReply() const override
This flag is used by YARP to determine whether the connection can carry RPC traffic,...
yarp::os::ConnectionReader & modifyIncomingData(yarp::os::ConnectionReader &reader) override
Modify incoming payload data, if appropriate.
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...
void getCarrierParams(yarp::os::Property &params) const override
Get carrier configuration and deliver it by port administrative commands.
PortReader & modifyReply(PortReader &reader) override
Modify reply payload data, if appropriate.
bool isConnectionless() const override
Check if this carrier is connectionless (like udp, mcast) or connection based (like tcp).
bool modifiesOutgoingData() const override
Check if this carrier modifies outgoing data through the Carrier::modifyOutgoingData method.
bool modifiesIncomingData() const override
Check if this carrier modifies incoming data through the Carrier::modifyIncomingData method.
bool isBroadcast() const override
Check if this carrier uses a broadcast mechanism.
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Definition: PortReader.h:25
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
Definition: PortWriter.h:24
A class for storing options and configuration information.
Definition: Property.h:34
bool isValid()
Check if time is valid (non-zero).
Definition: Time.cpp:314
#define YARP_UNUSED(var)
Definition: api.h:162