YARP
Yet Another Robot Platform
BinPortable.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_BINPORTABLE_H
8 #define YARP_OS_BINPORTABLE_H
9 
10 #include <yarp/os/Portable.h>
11 
12 namespace yarp {
13 namespace os {
14 
25 template <class T>
26 class BinPortable : public Portable
27 {
28 private:
29  T t;
30 
31 public:
37  T& content();
38 
39  // Documented in Portable
40  bool read(ConnectionReader& connection) override;
41 
42  // Documented in Portable
43  bool write(ConnectionWriter& connection) const override;
44 };
45 
46 } // namespace os
47 } // namespace yarp
48 
50 
51 #endif // YARP_OS_BINPORTABLE_H
Class for writing and reading simple binary structures.
Definition: BinPortable.h:27
bool read(ConnectionReader &connection) override
Read this object from a network connection.
bool write(ConnectionWriter &connection) const override
Write this object to a network connection.
T & content()
Get the internal structure that will be read or written.
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
The main, catch-all namespace for YARP.
Definition: dirs.h:16