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 }
A simple abstraction for a block of bytes.
Definition: Bytes.h:28
An interface for reading from a network connection.
virtual void setParentConnectionReader(ConnectionReader *parentConnectionReader)
Set ConnectionReader to be used for reading the envelope.
static ConnectionReader * createConnectionReader(InputStream &is)
Create an instance of YARP's standard connection reader implementation.
virtual ~ConnectionReader()
Destructor.
virtual Bytes readEnvelope()
Read a message envelope, if available.
static bool readFromStream(PortReader &portable, InputStream &is)
Simple specification of the minimum functions needed from input streams.
Definition: InputStream.h:29
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Definition: PortReader.h:28
virtual bool read(ConnectionReader &reader)=0
Read this object from a network connection.
Information about a connection between two ports.
Definition: Route.h:32
Lets Readable objects read from the underlying InputStream associated with the connection between two...
void reset(yarp::os::InputStream &in, TwoWayStream *str, const Route &route, size_t len, bool textMode, bool bareMode=false)
The components from which ports and connections are built.
An interface to the operating system, including Port based communication.
#define YARP_UNUSED(var)
Definition: api.h:159