YARP
Yet Another Robot Platform
WirePortable.h
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 #ifndef YARP_OS_IDL_WIREPORTABLE_H
10 #define YARP_OS_IDL_WIREPORTABLE_H
11 
12 #include <yarp/os/Portable.h>
13 
14 namespace yarp {
15 namespace os {
16 namespace idl {
17 
18 class WireReader;
19 class WireWriter;
20 
26 {
27 public:
30 
31  virtual bool read(yarp::os::idl::WireReader& reader);
32 
33  virtual bool write(const yarp::os::idl::WireWriter& writer) const;
34 
35  virtual bool readBare(yarp::os::ConnectionReader& reader)
36  {
37  return read(reader);
38  }
39 
40  virtual bool writeBare(yarp::os::ConnectionWriter& writer) const
41  {
42  return write(writer);
43  }
44 
45  virtual bool readBottle(yarp::os::ConnectionReader& reader)
46  {
47  return read(reader);
48  }
49 
50  virtual bool writeBottle(yarp::os::ConnectionWriter& writer) const
51  {
52  return write(writer);
53  }
54 };
55 
56 } // namespace idl
57 } // namespace os
58 } // namespace yarp
59 
60 #endif // YARP_OS_IDL_WIREPORTABLE_H
yarp::os::idl::WirePortable::writeBottle
virtual bool writeBottle(yarp::os::ConnectionWriter &writer) const
Definition: WirePortable.h:50
yarp::os::Portable
This is a base class for objects that can be both read from and be written to the YARP network.
Definition: Portable.h:29
yarp::sig::file::read
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
Definition: ImageFile.cpp:827
Portable.h
YARP_os_API
#define YARP_os_API
Definition: api.h:19
yarp::os::Portable::write
bool write(ConnectionWriter &writer) const override=0
Write this object to a network connection.
yarp::os::idl::WireWriter
IDL-friendly connection writer.
Definition: WireWriter.h:33
yarp::os::ConnectionWriter
An interface for writing to a network connection.
Definition: ConnectionWriter.h:40
yarp::os::idl::WirePortable::readBottle
virtual bool readBottle(yarp::os::ConnectionReader &reader)
Definition: WirePortable.h:45
yarp::os::idl::WirePortable::readBare
virtual bool readBare(yarp::os::ConnectionReader &reader)
Definition: WirePortable.h:35
yarp::os::idl::WirePortable
A "tamed" Portable, that promises to serialize itself in an IDL-friendly way.
Definition: WirePortable.h:26
yarp::os::idl::WireReader
IDL-friendly connection reader.
Definition: WireReader.h:33
yarp::os::ConnectionReader
An interface for reading from a network connection.
Definition: ConnectionReader.h:40
yarp::os::idl::WirePortable::writeBare
virtual bool writeBare(yarp::os::ConnectionWriter &writer) const
Definition: WirePortable.h:40
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::sig::file::write
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
Definition: ImageFile.cpp:971
yarp::os::Portable::read
bool read(ConnectionReader &reader) override=0
Read this object from a network connection.