YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
numeric.h File Reference
#include <sys/types.h>
#include <cfloat>
#include <cinttypes>
#include <clocale>
#include <cstdint>
#include <cstddef>
#include <cstdlib>
#include <cstring>
#include <limits>
#include <sstream>
#include <string>
#include <yarp/conf/api.h>
+ Include dependency graph for numeric.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  yarp
 The main, catch-all namespace for YARP.
 
namespace  yarp::conf
 
namespace  yarp::conf::numeric
 

Macros

#define YARP_HAS_SYS_TYPES_H
 
#define YARP_LITTLE_ENDIAN
 
#define YARP_HAS_FLOAT128_T
 
#define YARP_FLOAT32_IS_IEC559   1
 
#define YARP_FLOAT64_IS_IEC559   1
 
#define YARP_FLOAT128_IS_IEC559   1
 
#define YARP_FLT_EXP_DIG   3
 
#define YARP_DBL_EXP_DIG   4
 
#define YARP_LDBL_EXP_DIG   5
 
#define YARP_DOUBLE_TO_STRING_MAX_LENGTH   (16 + DECIMAL_DIG + YARP_LDBL_EXP_DIG)
 
#define YARP_INT32_FMT   PRId32
 
#define YARP_INT64_FMT   PRId64
 

Typedefs

typedef float yarp::conf::float32_t
 
typedef double yarp::conf::float64_t
 
typedef std::int32_t yarp::conf::vocab32_t
 
typedef long double yarp::conf::float128_t
 
typedef ::ssize_t yarp::conf::ssize_t
 
typedef std::int8_t YARP_INT8
 
typedef std::int16_t YARP_INT16
 
typedef std::int32_t YARP_INT32
 
typedef std::int64_t YARP_INT64
 
typedef yarp::conf::float32_t YARP_FLOAT32
 
typedef yarp::conf::float64_t YARP_FLOAT64
 
typedef yarp::conf::ssize_t YARP_SSIZE_T
 

Functions

template<class T >
constexpr const T & yarp::conf::clamp (const T &v, const T &lo, const T &hi)
 
template<class T , class Compare >
constexpr const T & yarp::conf::clamp (const T &v, const T &lo, const T &hi, Compare comp)
 
template<typename IntegerType , std::enable_if_t< std::is_integral< IntegerType >::value &&!std::is_same< IntegerType, bool >::value, bool > = true>
std::string yarp::conf::numeric::to_string (IntegerType x)
 
template<typename BoolType , std::enable_if_t< std::is_same< BoolType, bool >::value, bool > = true>
std::string yarp::conf::numeric::to_string (BoolType x)
 
template<typename FloatingType , std::enable_if_t< std::is_floating_point< FloatingType >::value, bool > = true>
std::string yarp::conf::numeric::to_string (FloatingType x)
 
template<typename IntegerType , std::enable_if_t< std::is_integral< IntegerType >::value &&std::is_signed< IntegerType >::value &&!std::is_same< IntegerType, bool >::value, bool > = true>
IntegerType yarp::conf::numeric::from_string (const std::string &src, IntegerType defaultValue=static_cast< IntegerType >(0))
 
template<typename BoolType , std::enable_if_t< std::is_same< BoolType, bool >::value, bool > = true>
BoolType yarp::conf::numeric::from_string (const std::string &src, BoolType defaultValue=false)
 
template<typename FloatingType , std::enable_if_t< std::is_floating_point< FloatingType >::value, bool > = true>
FloatingType yarp::conf::numeric::from_string (const std::string &src, FloatingType defaultValue=static_cast< FloatingType >(0.0))
 
template<typename IntegerType , std::enable_if_t< std::is_integral< IntegerType >::value &&sizeof(IntegerType) !=1 &&!std::is_same< IntegerType, bool >::value, bool > = true>
std::string yarp::conf::numeric::to_hex_string (IntegerType i)
 

Macro Definition Documentation

◆ YARP_DBL_EXP_DIG

#define YARP_DBL_EXP_DIG   4

Definition at line 51 of file numeric.h.

◆ YARP_DOUBLE_TO_STRING_MAX_LENGTH

#define YARP_DOUBLE_TO_STRING_MAX_LENGTH   (16 + DECIMAL_DIG + YARP_LDBL_EXP_DIG)

Definition at line 68 of file numeric.h.

◆ YARP_FLOAT128_IS_IEC559

#define YARP_FLOAT128_IS_IEC559   1

Definition at line 35 of file numeric.h.

◆ YARP_FLOAT32_IS_IEC559

#define YARP_FLOAT32_IS_IEC559   1

Definition at line 33 of file numeric.h.

◆ YARP_FLOAT64_IS_IEC559

#define YARP_FLOAT64_IS_IEC559   1

Definition at line 34 of file numeric.h.

◆ YARP_FLT_EXP_DIG

#define YARP_FLT_EXP_DIG   3

Definition at line 50 of file numeric.h.

◆ YARP_HAS_FLOAT128_T

#define YARP_HAS_FLOAT128_T

Definition at line 32 of file numeric.h.

◆ YARP_HAS_SYS_TYPES_H

#define YARP_HAS_SYS_TYPES_H

Definition at line 9 of file numeric.h.

◆ YARP_INT32_FMT

#define YARP_INT32_FMT   PRId32

Definition at line 354 of file numeric.h.

◆ YARP_INT64_FMT

#define YARP_INT64_FMT   PRId64

Definition at line 355 of file numeric.h.

◆ YARP_LDBL_EXP_DIG

#define YARP_LDBL_EXP_DIG   5

Definition at line 52 of file numeric.h.

◆ YARP_LITTLE_ENDIAN

#define YARP_LITTLE_ENDIAN

Definition at line 30 of file numeric.h.

Typedef Documentation

◆ YARP_FLOAT32

Definition at line 351 of file numeric.h.

◆ YARP_FLOAT64

Definition at line 352 of file numeric.h.

◆ YARP_INT16

typedef std::int16_t YARP_INT16

Definition at line 348 of file numeric.h.

◆ YARP_INT32

typedef std::int32_t YARP_INT32

Definition at line 349 of file numeric.h.

◆ YARP_INT64

typedef std::int64_t YARP_INT64

Definition at line 350 of file numeric.h.

◆ YARP_INT8

typedef std::int8_t YARP_INT8

Definition at line 347 of file numeric.h.

◆ YARP_SSIZE_T

Definition at line 353 of file numeric.h.