YARP
Yet Another Robot Platform
ConnectionReader.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006-2010 RobotCub Consortium
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
12 
13 using namespace yarp::os;
14 using namespace yarp::os::impl;
15 
17 
19 {
20  return {nullptr, 0};
21 }
22 
24 {
25  YARP_UNUSED(parentConnectionReader);
26 }
27 
29 {
30  auto* reader = new StreamConnectionReader();
31  Route r;
32  reader->reset(is, nullptr, r, 0, false);
33  return reader;
34 }
35 
37 {
39  Route r;
40  reader.reset(is, nullptr, r, 0, false);
41  return portable.read(reader);
42 }
yarp::os::ConnectionReader::readEnvelope
virtual Bytes readEnvelope()
Read a message envelope, if available.
Definition: ConnectionReader.cpp:18
yarp::os::impl::StreamConnectionReader::reset
void reset(yarp::os::InputStream &in, TwoWayStream *str, const Route &route, size_t len, bool textMode, bool bareMode=false)
Definition: StreamConnectionReader.cpp:49
yarp::os::PortReader::read
virtual bool read(ConnectionReader &reader)=0
Read this object from a network connection.
yarp::os::ConnectionReader::setParentConnectionReader
virtual void setParentConnectionReader(ConnectionReader *parentConnectionReader)
Set ConnectionReader to be used for reading the envelope.
Definition: ConnectionReader.cpp:23
YARP_UNUSED
#define YARP_UNUSED(var)
Definition: api.h:159
StreamConnectionReader.h
yarp::os::impl::StreamConnectionReader
Lets Readable objects read from the underlying InputStream associated with the connection between two...
Definition: StreamConnectionReader.h:42
yarp::os::Route
Information about a connection between two ports.
Definition: Route.h:32
yarp::os::PortReader
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Definition: PortReader.h:28
yarp::os::ConnectionReader::createConnectionReader
static ConnectionReader * createConnectionReader(InputStream &is)
Create an instance of YARP's standard connection reader implementation.
Definition: ConnectionReader.cpp:28
yarp::os::Bytes
A simple abstraction for a block of bytes.
Definition: Bytes.h:28
yarp::os::ConnectionReader::~ConnectionReader
virtual ~ConnectionReader()
Destructor.
yarp::os::ConnectionReader::readFromStream
static bool readFromStream(PortReader &portable, InputStream &is)
Definition: ConnectionReader.cpp:36
yarp::os::ConnectionReader
An interface for reading from a network connection.
Definition: ConnectionReader.h:40
yarp::os
An interface to the operating system, including Port based communication.
Definition: AbstractCarrier.h:17
yarp::os::InputStream
Simple specification of the minimum functions needed from input streams.
Definition: InputStream.h:29
yarp::os::impl
The components from which ports and connections are built.
ConnectionReader.h