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 }
An interface for writing to a network connection.
static ConnectionWriter * createBufferedConnectionWriter()
Create a connection writer implementation that stores to a buffer which can be read later using getBu...
static bool writeToStream(PortWriter &portable, OutputStream &os)
virtual ~ConnectionWriter()
Destructor.
virtual bool isNull() const
Simple specification of the minimum functions needed from output streams.
Definition: OutputStream.h:25
virtual bool isOk() const =0
Check if the stream is ok or in an error state.
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
Definition: PortWriter.h:27
virtual bool write(ConnectionWriter &writer) const =0
Write this object to a network connection.
A helper for creating cached object descriptions.
bool write(ConnectionWriter &connection) const override
Write this object to a network connection.
The components from which ports and connections are built.
An interface to the operating system, including Port based communication.