YARP
Yet Another Robot Platform
ConnectionWriter.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 
11 #include <yarp/os/OutputStream.h>
13 
14 using namespace yarp::os;
15 using namespace yarp::os::impl;
16 
18 
20 {
21  return false;
22 }
23 
24 
26 {
27  return new BufferedConnectionWriter;
28 }
29 
31 {
33  if (!portable.write(writer)) {
34  return false;
35  }
36  writer.write(os);
37  return os.isOk();
38 }
yarp::os::ConnectionWriter::isNull
virtual bool isNull() const
Definition: ConnectionWriter.cpp:19
yarp::os::impl::BufferedConnectionWriter::write
bool write(ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: BufferedConnectionWriter.cpp:344
ConnectionWriter.h
yarp::os::OutputStream
Simple specification of the minimum functions needed from output streams.
Definition: OutputStream.h:25
OutputStream.h
yarp::os::impl::BufferedConnectionWriter
A helper for creating cached object descriptions.
Definition: BufferedConnectionWriter.h:50
yarp::os::PortWriter
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
Definition: PortWriter.h:27
yarp::os::ConnectionWriter
An interface for writing to a network connection.
Definition: ConnectionWriter.h:40
BufferedConnectionWriter.h
yarp::os::PortWriter::write
virtual bool write(ConnectionWriter &writer) const =0
Write this object to a network connection.
yarp::os::ConnectionWriter::~ConnectionWriter
virtual ~ConnectionWriter()
Destructor.
yarp::os::OutputStream::isOk
virtual bool isOk() const =0
Check if the stream is ok or in an error state.
yarp::os
An interface to the operating system, including Port based communication.
Definition: AbstractCarrier.h:17
yarp::os::ConnectionWriter::writeToStream
static bool writeToStream(PortWriter &portable, OutputStream &os)
Definition: ConnectionWriter.cpp:30
yarp::os::impl
The components from which ports and connections are built.
yarp::os::ConnectionWriter::createBufferedConnectionWriter
static ConnectionWriter * createBufferedConnectionWriter()
Create a connection writer implementation that stores to a buffer which can be read later using getBu...
Definition: ConnectionWriter.cpp:25