iRoCS Toolbox  1.1.0
TypeTraits.hh
Go to the documentation of this file.
1 /**************************************************************************
2  *
3  * Copyright (C) 2015 Thorsten Falk
4  *
5  * Image Analysis Lab, University of Freiburg, Germany
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  *
21  **************************************************************************/
22 
23 /*======================================================================*/
28 /*======================================================================*/
29 
30 #ifndef ATBTYPETRAITS_HH
31 #define ATBTYPETRAITS_HH
32 
33 #ifdef HAVE_CONFIG_H
34 #include <config.hh>
35 #endif
36 
37 #include <complex>
38 #include <blitz/array.h>
39 
40 #ifdef _WIN32
41  #if defined(ArrayToolbox_EXPORTS)
42  #define ARRAYTOOLBOXDLL_API __declspec(dllexport)
43  #elif defined(ArrayToolbox_USE_DLL)
44  #define ARRAYTOOLBOXDLL_API __declspec(dllimport)
45  #else
46  #define ARRAYTOOLBOXDLL_API
47  #endif
48 #else
49  #define ARRAYTOOLBOXDLL_API
50 #endif
51 
52 namespace atb
53 {
54 
56  typedef int BlitzIndexT;
57 
58 /*======================================================================*/
71 /*======================================================================*/
72  template<typename DataT>
73  struct traits
74  {
75 
76 /*======================================================================*/
85 /*======================================================================*/
86  typedef DataT HighPrecisionT;
87 
88 /*======================================================================*/
95 /*======================================================================*/
96  typedef DataT ComplexT;
97 
98 /*======================================================================*/
105 /*======================================================================*/
106  typedef DataT BasicT;
107 
108 /*======================================================================*/
112 /*======================================================================*/
113  static DataT const smallest;
114 
115 /*======================================================================*/
119 /*======================================================================*/
120  static DataT const greatest;
121 
122 /*======================================================================*/
126 /*======================================================================*/
127  static DataT const zero;
128 
129 /*======================================================================*/
133 /*======================================================================*/
134  static DataT const one;
135 
136 /*======================================================================*/
143 /*======================================================================*/
144  static DataT const saturated;
145 
146 /*======================================================================*/
150 /*======================================================================*/
151  static bool const isComplex;
152 
153  };
154 
155 }
156 
157 #include "TypeTraits.icc"
158 
159 #endif
static DataT const greatest
Get a representation of the greatest value for this data type.
Definition: TypeTraits.hh:120
static DataT const smallest
Get a representation of the smallest value for this data type.
Definition: TypeTraits.hh:113
static DataT const one
Get a representation of the One for this data type.
Definition: TypeTraits.hh:134
DataT BasicT
The corresponding basic type to the given type.
Definition: TypeTraits.hh:106
The traits class provides means to query specific information about different data types...
Definition: TypeTraits.hh:73
DataT ComplexT
The corresponding complex value type to the given type.
Definition: TypeTraits.hh:96
static DataT const zero
Get a representation of the Zero for this data type.
Definition: TypeTraits.hh:127
int BlitzIndexT
The native integer type for indexing blitz++ Arrays.
Definition: TypeTraits.hh:56
DataT HighPrecisionT
The type with highest precision of this kind.
Definition: TypeTraits.hh:86
static bool const isComplex
If this type specifies a complex number type this constant is true.
Definition: TypeTraits.hh:151
static DataT const saturated
Get the value that corresponds to the saturation of the sensor.
Definition: TypeTraits.hh:144