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 }
yarp::os::ModifyingCarrier::modifiesReply
bool modifiesReply() const override
Check if this carrier modifies outgoing data through the Carrier::modifyReply method.
Definition: ModifyingCarrier.cpp:46
yarp::os::ModifyingCarrier::modifiesOutgoingData
bool modifiesOutgoingData() const override
Check if this carrier modifies outgoing data through the Carrier::modifyOutgoingData method.
Definition: ModifyingCarrier.cpp:41
yarp::os::ModifyingCarrier::getCarrierParams
void getCarrierParams(yarp::os::Property &params) const override
Get carrier configuration and deliver it by port administrative commands.
Definition: ModifyingCarrier.cpp:57
YARP_UNUSED
#define YARP_UNUSED(var)
Definition: api.h:159
yarp::os::ModifyingCarrier::modifiesIncomingData
bool modifiesIncomingData() const override
Check if this carrier modifies incoming data through the Carrier::modifyIncomingData method.
Definition: ModifyingCarrier.cpp:36
yarp::os::Bytes::get
const char * get() const
Definition: Bytes.cpp:30
yarp::os::Bytes::length
size_t length() const
Definition: Bytes.cpp:25
yarp::os::ModifyingCarrier::getHeader
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...
Definition: ModifyingCarrier.cpp:20
ModifyingCarrier.h
yarp::os::Bytes
A simple abstraction for a block of bytes.
Definition: Bytes.h:28
yarp::os::ConnectionState
The basic state of a connection - route, streams in use, etc.
Definition: ConnectionState.h:31
yarp::os::ModifyingCarrier::checkHeader
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...
Definition: ModifyingCarrier.cpp:13
yarp::os::ModifyingCarrier::configureFromProperty
bool configureFromProperty(yarp::os::Property &prop) override
Definition: ModifyingCarrier.cpp:62
yarp::os
An interface to the operating system, including Port based communication.
Definition: AbstractCarrier.h:17
yarp::os::ModifyingCarrier::setCarrierParams
void setCarrierParams(const yarp::os::Property &params) override
Configure carrier from port administrative commands.
Definition: ModifyingCarrier.cpp:52
yarp::os::ModifyingCarrier::respondToHeader
bool respondToHeader(yarp::os::ConnectionState &proto) override
Respond to the header.
Definition: ModifyingCarrier.cpp:30
yarp::os::Property
A class for storing options and configuration information.
Definition: Property.h:37