YARP
Yet Another Robot Platform
Unwrapped.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_UNWRAPPED_H
7 #define YARP_OS_IDL_UNWRAPPED_H
8 
10 #include <yarp/os/idl/WireReader.h>
11 #include <yarp/os/idl/WireWriter.h>
12 
13 namespace yarp {
14 namespace os {
15 namespace idl {
16 
17 template <class T>
19 {
20 public:
22 
23  bool read(yarp::os::ConnectionReader& reader) override
24  {
25  WireReader wreader(reader);
26  return content.read(wreader);
27  }
28 
29  bool write(yarp::os::ConnectionWriter& writer) const override
30  {
31  WireWriter wwriter(writer);
32  return content.write(wwriter);
33  }
34 };
35 
36 template <class T>
38 {
39 public:
40  T& content;
41 
43 
44  bool read(yarp::os::ConnectionReader& reader) override
45  {
46  WireReader wreader(reader);
47  return content.read(wreader);
48  }
49 
50  bool write(yarp::os::ConnectionWriter& writer) const override
51  {
52  WireWriter wwriter(writer);
53  return content.write(wwriter);
54  }
55 };
56 
57 } // namespace idl
58 } // namespace os
59 } // namespace yarp
60 
61 #endif // YARP_OS_IDL_UNWRAPPED_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(yarp::os::ConnectionReader &reader) override
Read this object from a network connection.
Definition: Unwrapped.h:44
bool write(yarp::os::ConnectionWriter &writer) const override
Write this object to a network connection.
Definition: Unwrapped.h:50
bool write(yarp::os::ConnectionWriter &writer) const override
Write this object to a network connection.
Definition: Unwrapped.h:29
bool read(yarp::os::ConnectionReader &reader) override
Read this object from a network connection.
Definition: Unwrapped.h:23
IDL-friendly connection reader.
Definition: WireReader.h:30
IDL-friendly connection writer.
Definition: WireWriter.h:30
The main, catch-all namespace for YARP.
Definition: dirs.h:16