YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
NetUint64.cpp
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#include <yarp/os/NetUint64.h>
8
9#ifndef YARP_LITTLE_ENDIAN
10
11using namespace yarp;
12using namespace yarp::os;
13
14
15std::uint64_t NetUint64::swap(std::uint64_t x) const
16{
17 UnionNetUint64 in, out;
18 in.d = x;
19 for (int i = 0; i < 8; i++) {
20 out.c[i] = in.c[7 - i];
21 }
22 return out.d;
23}
24RawNetUint64 NetUint64::get() const
25{
26 return (RawNetUint64)swap((RawNetUint64)raw_value);
27}
28void NetUint64::set(RawNetUint64 v)
29{
31}
32NetUint64::NetUint64()
33{
34}
35NetUint64::NetUint64(RawNetUint64 val)
36{
37 set(val);
38}
39NetUint64::operator RawNetUint64() const
40{
41 return get();
42}
43RawNetUint64 NetUint64::operator+(RawNetUint64 v) const
44{
45 return get() + v;
46}
47RawNetUint64 NetUint64::operator-(RawNetUint64 v) const
48{
49 return get() - v;
50}
51RawNetUint64 NetUint64::operator*(RawNetUint64 v) const
52{
53 return get() * v;
54}
55RawNetUint64 NetUint64::operator/(RawNetUint64 v) const
56{
57 return get() / v;
58}
59void NetUint64::operator+=(RawNetUint64 v)
60{
61 set(get() + v);
62}
63void NetUint64::operator-=(RawNetUint64 v)
64{
65 set(get() - v);
66}
67void NetUint64::operator*=(RawNetUint64 v)
68{
69 set(get() * v);
70}
71void NetUint64::operator/=(RawNetUint64 v)
72{
73 set(get() / v);
74}
75#endif // YARP_LITTLE_ENDIAN
A mini-server for performing network communication in the background.
An interface to the operating system, including Port based communication.
The main, catch-all namespace for YARP.
Definition dirs.h:16