YARP
Yet Another Robot Platform
ModifyingCarrier.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 using namespace yarp::os;
9 
11 {
12  YARP_UNUSED(header);
13  return false;
14 }
15 
16 
18 {
19  if (header.length() == 8) {
20  std::string target = "ohbehave";
21  for (int i = 0; i < 8; i++) {
22  header.get()[i] = target[i];
23  }
24  }
25 }
26 
28 {
29  YARP_UNUSED(proto);
30  return false;
31 }
32 
34 {
35  return true;
36 }
37 
39 {
40  return true;
41 }
42 
44 {
45  return true;
46 }
47 
48 
50 {
51  YARP_UNUSED(params);
52 }
53 
55 {
56  YARP_UNUSED(params);
57 }
58 
60 {
61  YARP_UNUSED(prop);
62  return false;
63 }
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
The basic state of a connection - route, streams in use, etc.
bool modifiesOutgoingData() const override
Check if this carrier modifies outgoing data through the Carrier::modifyOutgoingData method.
void setCarrierParams(const yarp::os::Property &params) override
Configure carrier from port administrative commands.
bool configureFromProperty(yarp::os::Property &prop) override
bool respondToHeader(yarp::os::ConnectionState &proto) override
Respond to the header.
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 modifiesReply() const override
Check if this carrier modifies outgoing data through the Carrier::modifyReply method.
void getCarrierParams(yarp::os::Property &params) const override
Get carrier configuration and deliver it by port administrative commands.
bool modifiesIncomingData() const override
Check if this carrier modifies incoming data through the Carrier::modifyIncomingData method.
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...
A class for storing options and configuration information.
Definition: Property.h:34
An interface to the operating system, including Port based communication.
#define YARP_UNUSED(var)
Definition: api.h:162