YARP
Yet Another Robot Platform
Portable.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef YARP_OS_PORTABLE_H
8 #define YARP_OS_PORTABLE_H
9 
10 #include <yarp/os/api.h>
11 
12 #include <yarp/os/PortReader.h>
13 #include <yarp/os/PortWriter.h>
14 
15 namespace yarp {
16 namespace os {
17 
25 class YARP_os_API Portable : public PortReader, public PortWriter
26 {
27 public:
28  // reiterate the key inherited virtual methods, just as a reminder
29 
30  bool read(ConnectionReader& reader) override = 0;
31  bool write(ConnectionWriter& writer) const override = 0;
32 
33  virtual Type getType() const;
34 
40  static bool copyPortable(const PortWriter& writer, PortReader& reader);
41 };
42 
43 } // namespace os
44 } // namespace yarp
45 
46 #endif // YARP_OS_PORTABLE_H
An interface for reading from a network connection.
An interface for writing to a network connection.
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Definition: PortReader.h:25
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
Definition: PortWriter.h:24
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.
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_os_API
Definition: api.h:18