YARP
Yet Another Robot Platform
WirePortable.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef YARP_OS_IDL_WIREPORTABLE_H
7 #define YARP_OS_IDL_WIREPORTABLE_H
8 
9 #include <yarp/os/Portable.h>
10 
11 namespace yarp {
12 namespace os {
13 namespace idl {
14 
15 class WireReader;
16 class WireWriter;
17 
23 {
24 public:
27 
28  virtual bool read(yarp::os::idl::WireReader& reader);
29 
30  virtual bool write(const yarp::os::idl::WireWriter& writer) const;
31 
32  virtual bool readBare(yarp::os::ConnectionReader& reader)
33  {
34  return read(reader);
35  }
36 
37  virtual bool writeBare(yarp::os::ConnectionWriter& writer) const
38  {
39  return write(writer);
40  }
41 
42  virtual bool readBottle(yarp::os::ConnectionReader& reader)
43  {
44  return read(reader);
45  }
46 
47  virtual bool writeBottle(yarp::os::ConnectionWriter& writer) const
48  {
49  return write(writer);
50  }
51 };
52 
53 } // namespace idl
54 } // namespace os
55 } // namespace yarp
56 
57 #endif // YARP_OS_IDL_WIREPORTABLE_H
An interface for reading from a network connection.
An interface for writing to a network connection.
This is a base class for objects that can be both read from and be written to the YARP network.
Definition: Portable.h:26
bool read(ConnectionReader &reader) override=0
Read this object from a network connection.
bool write(ConnectionWriter &writer) const override=0
Write this object to a network connection.
A "tamed" Portable, that promises to serialize itself in an IDL-friendly way.
Definition: WirePortable.h:23
virtual bool readBare(yarp::os::ConnectionReader &reader)
Definition: WirePortable.h:32
virtual bool writeBare(yarp::os::ConnectionWriter &writer) const
Definition: WirePortable.h:37
virtual bool readBottle(yarp::os::ConnectionReader &reader)
Definition: WirePortable.h:42
virtual bool writeBottle(yarp::os::ConnectionWriter &writer) const
Definition: WirePortable.h:47
IDL-friendly connection reader.
Definition: WireReader.h:30
IDL-friendly connection writer.
Definition: WireWriter.h:30
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
Definition: ImageFile.cpp:923
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
Definition: ImageFile.cpp:1099
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_os_API
Definition: api.h:18