Ariles
Loading...
Searching...
No Matches
helpers.h
Go to the documentation of this file.
1/**
2 @file
3 @author Alexander Sherikov
4
5 @copyright 2017-2018 Alexander Sherikov, Licensed under the Apache License, Version 2.0.
6 (see @ref LICENSE or http://www.apache.org/licenses/LICENSE-2.0)
7
8 @brief
9*/
10
11#pragma once
12
13#include <string>
14#include <fstream>
15#include <stdexcept>
16#include <cmath>
17#include <cstdlib>
18#include <complex>
19#include <limits>
20
21
22#include <type_traits>
23#include <memory>
24
25#define ARILES2_IS_BASE_ENABLER(Base, Derived) \
26 const typename std::enable_if<std::is_base_of<Base, Derived>::value>::type * = nullptr
27
28#include "build_config.h"
29
30#include "exception.h"
31#include "misc.h"
32
33
34#define ARILES2_EMPTY_MACRO
35
36
37#define ARILES2_BASIC_SIGNED_INTEGER_TYPES_LIST \
38 ARILES2_BASIC_TYPE(int) \
39 ARILES2_BASIC_TYPE(short) \
40 ARILES2_BASIC_TYPE(long) \
41 ARILES2_BASIC_TYPE(long long) \
42 ARILES2_BASIC_TYPE(char)
43
44#define ARILES2_BASIC_UNSIGNED_INTEGER_TYPES_LIST_WITHOUT_BYTE \
45 ARILES2_BASIC_TYPE(unsigned int) \
46 ARILES2_BASIC_TYPE(unsigned short) \
47 ARILES2_BASIC_TYPE(unsigned long) \
48 ARILES2_BASIC_TYPE(unsigned long long)
49
50#define ARILES2_BASIC_UNSIGNED_INTEGER_TYPES_LIST \
51 ARILES2_BASIC_UNSIGNED_INTEGER_TYPES_LIST_WITHOUT_BYTE \
52 ARILES2_BASIC_TYPE(unsigned char)
53
54
55#define ARILES2_BASIC_INTEGER_TYPES_LIST \
56 ARILES2_BASIC_SIGNED_INTEGER_TYPES_LIST \
57 ARILES2_BASIC_UNSIGNED_INTEGER_TYPES_LIST
58
59#define ARILES2_BASIC_REAL_TYPES_LIST \
60 ARILES2_BASIC_TYPE(float) \
61 ARILES2_BASIC_TYPE(double)
62
63#define ARILES2_BASIC_NUMERIC_TYPES_LIST \
64 ARILES2_BASIC_INTEGER_TYPES_LIST \
65 ARILES2_BASIC_REAL_TYPES_LIST \
66 ARILES2_BASIC_TYPE(bool)
67
68#define ARILES2_COMPLEX_NUMBER_TYPES_LIST \
69 ARILES2_BASIC_TYPE(std::complex<float>) \
70 ARILES2_BASIC_TYPE(std::complex<double>)
71
72#define ARILES2_BASIC_TYPES_LIST \
73 ARILES2_BASIC_NUMERIC_TYPES_LIST \
74 ARILES2_BASIC_TYPE(std::string)
75
76
77#define CPPUT_COMPILE_SHARED_LIB // we always build shared libs
78#include "visibility.h"
79
80
81// #define CPPUT_TRACE_ENABLE
82#include "trace.h"
83
84
85namespace ariles2
86{
87 // intentionally not defined
88 template <class t_Pointer>
90
91
92 template <class t_Entry>
93 constexpr bool isMissing(const t_Entry & /*entry*/)
94 {
95 return (false);
96 }
97
98
99 class Ariles
100 {
101 protected:
103 {
104 }
106 {
107 }
108
109 public:
110 virtual const std::string &arilesDefaultID() const = 0;
111 };
112} // namespace ariles2
virtual const std::string & arilesDefaultID() const =0
Throw & assert macro.
Various one-liners.
bool isMissing(const ARILES2_POINTER_TYPE< t_Entry > &entry)
Visibility defines, e.g., https://gcc.gnu.org/wiki/Visibility.