YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
NetUint64.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_NETUINT64_H
8#define YARP_OS_NETUINT64_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 unsigned little-endian
17// integer type
18//
20
21namespace yarp::os {
22
27#ifdef YARP_LITTLE_ENDIAN
28
29typedef std::uint64_t NetUint64;
30
31#else
32
33typedef std::uint64_t RawNetUint64;
35{
36 std::uint64_t d;
37 unsigned char c[8];
38};
40{
41private:
42 std::uint64_t raw_value;
43 std::uint64_t swap(std::uint64_t x) const;
44 RawNetUint64 get() const;
45 void set(RawNetUint64 v);
46
47public:
48 NetUint64();
49 NetUint64(RawNetUint64 val);
50 operator RawNetUint64() const;
51 RawNetUint64 operator+(RawNetUint64 v) const;
52 RawNetUint64 operator-(RawNetUint64 v) const;
53 RawNetUint64 operator*(RawNetUint64 v) const;
54 RawNetUint64 operator/(RawNetUint64 v) const;
55 void operator+=(RawNetUint64 v);
56 void operator-=(RawNetUint64 v);
57 void operator*=(RawNetUint64 v);
58 void operator/=(RawNetUint64 v);
59};
60
61#endif // YARP_LITTLE_ENDIAN
62
63} // namespace yarp::os
64
65#endif // YARP_OS_NETUINT64_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::uint64_t NetUint64
Definition of the NetInt64 type.
Definition NetUint64.h:29
#define YARP_os_API
Definition api.h:18