YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
NetInt64.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_NETINT64_H
8#define YARP_OS_NETINT64_H
9
10#include <yarp/conf/numeric.h>
11
12#include <yarp/os/api.h>
13
15//
16// The goal of this file is just to define a 64 bit signed little-endian
17// integer type
18//
20
21namespace yarp::os {
22
27#ifdef YARP_LITTLE_ENDIAN
28
29typedef std::int64_t NetInt64;
30
31#else // YARP_LITTLE_ENDIAN
32
33typedef std::int64_t RawNetInt64;
34union UnionNetInt64
35{
36 std::int64_t d;
37 unsigned char c[8];
38};
40{
41private:
42 std::int64_t raw_value;
43 std::int64_t swap(std::int64_t x) const;
44 RawNetInt64 get() const;
45 void set(RawNetInt64 v);
46
47public:
48 NetInt64();
49 NetInt64(RawNetInt64 val);
50 operator RawNetInt64() const;
51 RawNetInt64 operator+(RawNetInt64 v) const;
52 RawNetInt64 operator-(RawNetInt64 v) const;
53 RawNetInt64 operator*(RawNetInt64 v) const;
54 RawNetInt64 operator/(RawNetInt64 v) const;
55 void operator+=(RawNetInt64 v);
56 void operator-=(RawNetInt64 v);
57 void operator*=(RawNetInt64 v);
58 void operator/=(RawNetInt64 v);
59};
60
61#endif // YARP_LITTLE_ENDIAN
62
63} // namespace yarp::os
64
65#endif // YARP_OS_NETINT64_H
A mini-server for performing network communication in the background.
Vector operator+(const Vector &a, const double &s)
Mathematical operations.
Definition math.cpp:27
Vector operator-(const Vector &a, const double &s)
Subtraction operator between a vector and a scalar (defined in Math.h).
Definition math.cpp:82
Vector operator*(double k, const Vector &b)
Scalar-vector product operator (defined in Math.h).
Definition math.cpp:143
Vector & operator-=(Vector &a, const double &s)
Subtraction operator between a vector and a scalar (defined in Math.h).
Definition math.cpp:98
Vector & operator+=(Vector &a, const double &s)
Addition operator between a scalar and a vector (defined in Math.h).
Definition math.cpp:38
Vector & operator/=(Vector &a, const Vector &b)
Vector-vector element-wise division operator (defined in Math.h).
Definition math.cpp:266
Vector operator/(const Vector &a, const Vector &b)
Vector-vector element-wise division operator (defined in Math.h).
Definition math.cpp:260
Vector & operator*=(Vector &a, double k)
Vector-scalar product operator (defined in Math.h).
Definition math.cpp:154
An interface to the operating system, including Port based communication.
std::int64_t NetInt64
Definition of the NetInt64 type.
Definition NetInt64.h:29
#define YARP_os_API
Definition api.h:18