YARP
Yet Another Robot Platform
Portable.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 
9 #include <yarp/os/Portable.h>
10 
11 #include <yarp/os/DummyConnector.h>
12 #include <yarp/os/Type.h>
13 
15 {
16  return getReadType();
17 }
18 
20 {
22  if (!writer.write(con.getWriter())) {
23  return false;
24  }
25  return reader.read(con.getReader());
26 }
yarp::os::DummyConnector
A dummy connection to test yarp::os::Portable implementations.
Definition: DummyConnector.h:35
yarp::os::PortReader::read
virtual bool read(ConnectionReader &reader)=0
Read this object from a network connection.
yarp::os::Type
Definition: Type.h:24
Portable.h
yarp::os::Portable::getType
virtual Type getType() const
Definition: Portable.cpp:14
yarp::os::DummyConnector::getReader
ConnectionReader & getReader(ConnectionWriter *replyWriter=nullptr)
Get the dummy ConnectionReader loaded with whatever was written the ConnectionWriter since it was las...
Definition: DummyConnector.cpp:117
yarp::os::PortWriter
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
Definition: PortWriter.h:27
Type.h
yarp::os::PortReader
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Definition: PortReader.h:28
DummyConnector.h
yarp::os::DummyConnector::getWriter
ConnectionWriter & getWriter()
Get the dummy ConnectionWriter loaded with whatever was written the ConnectionWriter since it was las...
Definition: DummyConnector.cpp:112
yarp::os::Portable::copyPortable
static bool copyPortable(const PortWriter &writer, PortReader &reader)
Copy one portable to another, via writing and reading.
Definition: Portable.cpp:19
yarp::os::PortReader::getReadType
virtual Type getReadType() const
Definition: PortReader.cpp:15
yarp::os::PortWriter::write
virtual bool write(ConnectionWriter &writer) const =0
Write this object to a network connection.