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