Documentation
Tools for embedded systems
Loading...
Searching...
No Matches
qlibs_types.hpp
1
9#ifndef QLIBS_TYPES
10#define QLIBS_TYPES
11
12#if defined( ARDUINO ) || defined( ARDUINO_ARCH_AVR) || defined( ARDUINO_ARCH_SAMD ) || defined( ENERGIA_ARCH_MSP430ELF )
13 #define ARDUINO_PLATFORM
14#endif
15
16
17#if ( __cplusplus < 201103L || defined ( __AVR_ARCH__ ) || defined( ARDUINO_PLATFORM ) || defined ( STM8Sxx ) )
18 #include <stddef.h>
19 #include <stdint.h>
20 #include <stdlib.h>
21 #include <string.h>
22 #include <ctype.h>
23 #include <float.h>
24 #include <limits.h>
25#else
26 #include <cstddef>
27 #include <cstdint>
28 #include <cstdlib>
29 #include <cstring>
30 #include <cctype>
31 #include <cfloat>
32 #include <climits>
33 using namespace std;
34#endif
35
39namespace qlibs {
43 using real_t = float;
44
46 /*cstat -CERT-FLP36-C -CERT-FLP34-C*/
47 constexpr real_t operator "" _re( unsigned long long int x )
48 {
49 return static_cast<real_t>( x );
50 }
51 constexpr real_t operator "" _re( long double x )
52 {
53 return static_cast<real_t>( x );
54 }
55 /*cstat +CERT-FLP36-C +CERT-FLP34-C*/
56
57 /*cstat -MISRAC++2008-0-1-4_b*/
58 constexpr real_t REAL_MAX = FLT_MAX; // max value
59 constexpr real_t REAL_MIN = FLT_MIN; // min normalized positive value
60 /*cstat +MISRAC++2008-0-1-4_b*/
61
62 class nonCopyable {
63 protected:
64 nonCopyable() {}
65 ~nonCopyable() {}
66 private:
67 nonCopyable( const nonCopyable & );
68 nonCopyable& operator=( const nonCopyable & );
69 };
71}
72
74#define Q_UNUSED(arg) (void)(arg)
75#define Q_NONE /*EMPTY MACRO*/
80#endif /*QOS_CPP_TYPES*/
constexpr const char * std
Definition qlibs.h:68
The qLibs++ library namespace.
Definition fp16.cpp:4
float real_t
A type to instantiate a real variable double-precision of 64-bits IEEE 754.
Definition qlibs_types.hpp:43