IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BaseTypes.h
Go to the documentation of this file.
1 // BaseTypes.h:
3 // ------------
4 //
13 
14 #ifndef __IPSDKUTIL_BASETYPES_H__
15 #define __IPSDKUTIL_BASETYPES_H__
16 
18 #include <IPSDKUtil/Tools/Guid.h>
19 #include <boost/filesystem/path.hpp>
20 
21 #ifndef IPSDK_WINDOWS
22 #include <stdint.h>
23 #endif
24 
25 namespace ipsdk {
26 
29 
32 #ifdef IPSDK_WINDOWS
33  // Base types for Windows platform
34  typedef bool ipBool;
35  typedef signed __int8 ipInt8;
36  typedef unsigned __int8 ipUInt8;
37  typedef signed __int16 ipInt16;
38  typedef unsigned __int16 ipUInt16;
39  typedef signed __int32 ipInt32;
40  typedef unsigned __int32 ipUInt32;
41  typedef signed __int64 ipInt64;
42  typedef unsigned __int64 ipUInt64;
43  typedef float ipReal32;
44  typedef double ipReal64;
45 #else
46  // Base types for other platforms
47  typedef bool ipBool;
48  typedef int8_t ipInt8;
49  typedef uint8_t ipUInt8;
50  typedef int16_t ipInt16;
51  typedef uint16_t ipUInt16;
52  typedef int32_t ipInt32;
53  typedef uint32_t ipUInt32;
54  typedef int64_t ipInt64;
55  typedef uint64_t ipUInt64;
56  typedef float ipReal32;
57  typedef double ipReal64;
58 #endif
59 
63 #ifdef IPSDK_X64
64  typedef ipUInt64 ipUInt_t;
65  typedef ipInt64 ipInt_t;
66 #endif
67 #ifdef IPSDK_X32
68  typedef ipUInt32 ipUInt_t;
69  typedef ipInt32 ipInt_t;
70 #endif
71 
76 
78  (eDT_None)
79 
80  // standard types
82  (eDT_Int8)
84  (eDT_Int16)
86  (eDT_Int32)
88  (eDT_Int64)
90  (eDT_Real32)
92 )
93 
94 template <typename T>
100 {
102  static eDataType getEnum() {return eDataType::eDT_None;}
103 };
104 
107 #define IPSDK_DATATYPE_TO_ENUM_STRUCT(DataType, EnumValue) \
108  template<> struct DataType2Enum<DataType> { \
109  static eDataType getEnum() {return eDataType::EnumValue;} \
110  };
111 
126 
131 template <eDataType::value_type enumValue>
132 struct Enum2DataType
133 {
134 };
135 
138 #define IPSDK_ENUM_STRUCT_TO_DATATYPE(DataType, EnumValue) \
139  template<> struct Enum2DataType<eDataType::EnumValue> { \
140  typedef DataType Type; \
141  };
142 
157 
160 
161 } // end of namespace ipsdk
162 
163 #endif // __IPSDKUTIL_BASETYPES_H__
boolean data type
Definition: BaseTypes.h:81
int8_t ipInt8
Base types definition.
Definition: BaseTypes.h:48
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
unsigned 32 bits integer data type
Definition: BaseTypes.h:93
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
unsigned 64 bits integer data type
Definition: BaseTypes.h:97
unsigned 8 bits integer data type
Definition: BaseTypes.h:85
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
int32_t ipInt32
Base types definition.
Definition: BaseTypes.h:52
IPSDK_ENUM_STRUCT_TO_DATATYPE(ipBool, eDT_Bool)
int16_t ipInt16
Base types definition.
Definition: BaseTypes.h:50
uint8_t ipUInt8
Base types definition.
Definition: BaseTypes.h:49
64 bits real data type
Definition: BaseTypes.h:101
signed 8 bits integer data type
Definition: BaseTypes.h:83
structure used to retrieve enumerate value from base type
Definition: BaseTypes.h:110
IPSDK_DATATYPE_TO_ENUM_STRUCT(ipBool, eDT_Bool)
eDataType
Enumerate describing a base type.
Definition: BaseTypes.h:77
signed 32 bits integer data type
Definition: BaseTypes.h:91
bool ipBool
Base types definition.
Definition: BaseTypes.h:47
32 bits real data type
Definition: BaseTypes.h:99
signed 16 bits integer data type
Definition: BaseTypes.h:87
signed 64 bits integer data type
Definition: BaseTypes.h:95
int64_t ipInt64
Base types definition.
Definition: BaseTypes.h:54
undefined data type
Definition: BaseTypes.h:79
Predefined macros for enumerates management.
#define IPSDK_ENUM(enumTypeStr, enumSeq)
macro allowing to declare an enumerate for library
Definition: EnumMacros.h:26
unsigned 16 bits integer data type
Definition: BaseTypes.h:89
uint16_t ipUInt16
Base types definition.
Definition: BaseTypes.h:51
float ipReal32
Base types definition.
Definition: BaseTypes.h:56
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53