YARP
Yet Another Robot Platform
NetUint32.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_NETUINT32_H
11 #define YARP_OS_NETUINT32_H
12 
13 #include <yarp/conf/numeric.h>
14 
15 #include <yarp/os/api.h>
16 
18 //
19 // The goal of this file is just to define a 32 bit unsigned little-endian
20 // integer type.
21 //
23 
24 namespace yarp {
25 namespace os {
26 
31 #ifdef YARP_LITTLE_ENDIAN
32 
33 typedef std::uint32_t NetUint32;
34 
35 #else // YARP_LITTLE_ENDIAN
36 
38 {
39 private:
40  std::uint32_t raw_value;
41  std::uint32_t swap(std::uint32_t x) const;
42  std::uint32_t get() const;
43  void set(std::uint32_t v);
44 
45 public:
46  NetUint32();
47  NetUint32(std::uint32_t val);
48  operator std::uint32_t() const;
49  std::uint32_t operator+(std::uint32_t v) const;
50  std::uint32_t operator-(std::uint32_t v) const;
51  std::uint32_t operator*(std::uint32_t v) const;
52  std::uint32_t operator/(std::uint32_t v) const;
53  void operator+=(std::uint32_t v);
54  void operator-=(std::uint32_t v);
55  void operator*=(std::uint32_t v);
56  void operator/=(std::uint32_t v);
57  void operator++(int);
58  void operator--(int);
59 };
60 
61 #endif // YARP_LITTLE_ENDIAN
62 
63 } // namespace os
64 } // namespace yarp
65 
66 #endif // YARP_OS_NETUINT32_H
numeric.h
api.h
YARP_os_API
#define YARP_os_API
Definition: api.h:19
operator*=
Vector & operator*=(Vector &a, double k)
Vector-scalar product operator (defined in Math.h).
Definition: math.cpp:148
operator+=
Vector & operator+=(Vector &a, const double &s)
Addition operator between a scalar and a vector (defined in Math.h).
Definition: math.cpp:41
yarp::os::NetUint32
std::uint32_t NetUint32
Definition of the NetUint32 type.
Definition: NetUint32.h:33
operator/
Vector operator/(const Vector &a, const Vector &b)
Vector-vector element-wise division operator (defined in Math.h).
Definition: math.cpp:250
operator+
Vector operator+(const Vector &a, const double &s)
Mathematical operations.
Definition: math.cpp:30
operator/=
Vector & operator/=(Vector &a, const Vector &b)
Vector-vector element-wise division operator (defined in Math.h).
Definition: math.cpp:256
operator*
Vector operator*(double k, const Vector &b)
Scalar-vector product operator (defined in Math.h).
Definition: math.cpp:137
operator-=
Vector & operator-=(Vector &a, const double &s)
Subtraction operator between a vector and a scalar (defined in Math.h).
Definition: math.cpp:96
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
operator-
Vector operator-(const Vector &a, const double &s)
Subtraction operator between a vector and a scalar (defined in Math.h).
Definition: math.cpp:81