YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
BinPortable-inl.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_INL_H
8#define YARP_OS_BINPORTABLE_INL_H
9
12
13template <class T>
15{
16 return t;
17}
18
19template <class T>
20
22{
23 // An exception will get thrown upon error.
24 // Pending: translate this in expectBlock to a return value.
25 connection.convertTextMode(); // if connection is text-mode, convert!
26 connection.expectBlock((char*)(&t), sizeof(T));
27 return true;
28}
29
30template <class T>
32{
33 connection.appendBlock((char*)(&t), sizeof(T));
34 connection.convertTextMode(); // if connection is text-mode, convert!
35 return true;
36}
37
38#endif // YARP_OS_BINPORTABLE_INL_H
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.
A mini-server for performing network communication in the background.
An interface for reading from a network connection.
An interface for writing to a network connection.