YARP
Yet Another Robot Platform
BinPortable.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_BINPORTABLE_H
11 #define YARP_OS_BINPORTABLE_H
12 
13 #include <yarp/os/Portable.h>
14 
15 namespace yarp {
16 namespace os {
17 
28 template <class T>
29 class BinPortable : public Portable
30 {
31 private:
32  T t;
33 
34 public:
40  T& content();
41 
42  // Documented in Portable
43  bool read(ConnectionReader& connection) override;
44 
45  // Documented in Portable
46  bool write(ConnectionWriter& connection) const override;
47 };
48 
49 } // namespace os
50 } // namespace yarp
51 
53 
54 #endif // YARP_OS_BINPORTABLE_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::BinPortable::content
T & content()
Get the internal structure that will be read or written.
Definition: BinPortable-inl.h:17
Portable.h
yarp::os::BinPortable
Class for writing and reading simple binary structures.
Definition: BinPortable.h:30
yarp::os::BinPortable::read
bool read(ConnectionReader &connection) override
Read this object from a network connection.
Definition: BinPortable-inl.h:24
yarp::os::ConnectionWriter
An interface for writing to a network connection.
Definition: ConnectionWriter.h:40
BinPortable-inl.h
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
yarp::os::BinPortable::write
bool write(ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: BinPortable-inl.h:34