This repository has been archived by the owner on Sep 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PHsCommon.h
133 lines (98 loc) · 3.23 KB
/
PHsCommon.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/*
2016.01.20
Created by PHJ.
*/
#ifndef _PHS_COMMON_H
#define _PHS_COMMON_H
#ifdef _DEBUG
#define _CRTDBG_MAP_ALLOC
#include <crtdbg.h>
#endif
#include <cassert>
#include <intrin.h>
#include <cmath>
#include <utility>
namespace PHs
{
/*
TODO : Place your code here
*/
inline namespace PHsDef
{
using Void = void;
using Bool = bool;
using Char = char;
using Byte = unsigned char;
using wChar = wchar_t;
using Short = short;
using Int = int;
using Long = long long;
using uShort = unsigned short;
using uInt = unsigned int;
using uLong = unsigned long long;
using Float = float;
using Double = double;
using Char16Ext = __m128i;
using Byte16Ext = __m128i;
using Int4Ext = __m128i;
using Long2Ext = __m128i;
using Float4Ext = __m128;
using Double2Ext = __m128d;
//For interface
class Interface
{
protected:
Interface() = default;
Interface(Interface &&sNewInterface) = default;
Interface(const Interface &sNewInterface) = default;
virtual ~Interface() = default;
};
#define INTERFACE(CLASS) class CLASS : public PHs::PHsDef::Interface
}
#ifdef _PHS_DLL_EXPORT
#define _PHS_DLL __declspec(dllexport)
#else
#define _PHS_DLL __declspec(dllimport)
#endif
#ifdef _DEBUG
inline namespace PHsDebug
{
class __PHs_Debug
{
public:
inline __PHs_Debug();
__PHs_Debug(__PHs_Debug &&sNew__PHs_Debug) = delete;
__PHs_Debug(const __PHs_Debug &sNew__PHs_Debug) = delete;
~__PHs_Debug() = default;
};
}
#endif
inline namespace PHsUtility
{
template <class __Measure_Type> inline __Measure_Type &&Min(__Measure_Type &&tLeft, __Measure_Type &&tRight);
template <class __Measure_Type> inline const __Measure_Type &Min(const __Measure_Type &tLeft, const __Measure_Type &tRight);
template <class __Measure_Type> inline __Measure_Type &&Max(__Measure_Type &&tLeft, __Measure_Type &&tRight);
template <class __Measure_Type> inline const __Measure_Type &Max(const __Measure_Type &tLeft, const __Measure_Type &tRight);
template <class __Measure_Type, __Measure_Type __Epsilon_Value> inline Bool Same(const __Measure_Type &tLeft, const __Measure_Type &tRight);
template <class __Measure_Type, __Measure_Type __Epsilon_Value> inline Bool Diff(const __Measure_Type &tLeft, const __Measure_Type &tRight);
inline long double operator ""_Deg(long double nDegree);
template <class __Value_Type> inline __Value_Type minValue();
template <class __Value_Type> inline __Value_Type maxValue();
template <> inline Byte minValue <Byte>();
template <> inline Byte maxValue <Byte>();
template <> inline Short minValue <Short>();
template <> inline Short maxValue <Short>();
template <> inline uShort minValue <uShort>();
template <> inline uShort maxValue <uShort>();
template <> inline Int minValue <Int>();
template <> inline Int maxValue <Int>();
template <> inline uInt minValue <uInt>();
template <> inline uInt maxValue <uInt>();
template <> inline Long minValue <Long>();
template <> inline Long maxValue <Long>();
template <> inline uLong minValue <uLong>();
template <> inline uLong maxValue <uLong>();
}
}
#include "PHsCommon.hpp"
#endif