YARP
Yet Another Robot Platform
Portable.h
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 
10 #ifndef YARP_OS_PORTABLE_H
11 #define YARP_OS_PORTABLE_H
12 
13 #include <yarp/os/api.h>
14 
15 #include <yarp/os/PortReader.h>
16 #include <yarp/os/PortWriter.h>
17 
18 namespace yarp {
19 namespace os {
20 
28 class YARP_os_API Portable : public PortReader, public PortWriter
29 {
30 public:
31  // reiterate the key inherited virtual methods, just as a reminder
32 
33  bool read(ConnectionReader& reader) override = 0;
34  bool write(ConnectionWriter& writer) const override = 0;
35 
36  virtual Type getType() const;
37 
43  static bool copyPortable(const PortWriter& writer, PortReader& reader);
44 };
45 
46 } // namespace os
47 } // namespace yarp
48 
49 #endif // YARP_OS_PORTABLE_H
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::os::Type
Definition: Type.h:24
api.h
YARP_os_API
#define YARP_os_API
Definition: api.h:19
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::Portable::write
bool write(ConnectionWriter &writer) const override=0
Write this object to a network connection.
PortWriter.h
yarp::os::PortReader
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Definition: PortReader.h:28
yarp::os::ConnectionWriter
An interface for writing to a network connection.
Definition: ConnectionWriter.h:40
yarp::os::ConnectionReader
An interface for reading from a network connection.
Definition: ConnectionReader.h:40
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
PortReader.h
yarp::os::Portable::read
bool read(ConnectionReader &reader) override=0
Read this object from a network connection.