YARP
Yet Another Robot Platform
ModifyingCarrier.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
10 
11 using namespace yarp::os;
12 
14 {
15  YARP_UNUSED(header);
16  return false;
17 }
18 
19 
21 {
22  if (header.length() == 8) {
23  std::string target = "ohbehave";
24  for (int i = 0; i < 8; i++) {
25  header.get()[i] = target[i];
26  }
27  }
28 }
29 
31 {
32  YARP_UNUSED(proto);
33  return false;
34 }
35 
37 {
38  return true;
39 }
40 
42 {
43  return true;
44 }
45 
47 {
48  return true;
49 }
50 
51 
53 {
54  YARP_UNUSED(params);
55 }
56 
58 {
59  YARP_UNUSED(params);
60 }
61 
63 {
64  YARP_UNUSED(prop);
65  return false;
66 }
A simple abstraction for a block of bytes.
Definition: Bytes.h:28
size_t length() const
Definition: Bytes.cpp:25
const char * get() const
Definition: Bytes.cpp:30
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:37
An interface to the operating system, including Port based communication.
#define YARP_UNUSED(var)
Definition: api.h:159