25#if defined(_WIN64) || defined(__x86_64) || defined(__LP64__)
35#if defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC)
78#define stringcat strcat_s
79#define stringcpy strcpy_s
80#define strprintf sprintf_s
81#define stringtoken strtok_s
82#define stringscanf sscanf_s
84#define stringcat strcat
85#define stringcpy strcpy
86#define strprintf snprintf
87#define stringtoken strtok_r
88#define stringscanf sscanf
91#if defined(__MINGW32_MAJOR_VERSION) || defined(__MINGW64_VERSION_MAJOR)
95#if defined(MINGW) || defined(_MSC_VER)
96#define strcasecmp _stricmp
99#if defined(__clang__) && defined(__apple_build_version__)
101#if ((__clang_major__ * 100) + __clang_minor__) >= 400
102#if __has_feature(cxx_noexcept)
105#if __has_feature(cxx_override_control)
109#elif defined(__clang__)
111#if ((__clang_major__ * 100) + __clang_minor__) >= 304
112#if __has_feature(cxx_noexcept)
115#if __has_feature(cxx_override_control)
118#if __has_feature(cxx_variadic_templates)
119#define HAS_VARIADIC_TEMPLATES
122#elif defined(CPP_ICC)
124#if ((__INTEL_COMPILER >= 1400) && (__INTEL_COMPILER != 9999)) || (__ICL >= 1400)
127#define HAS_VARIADIC_TEMPLATES
129#elif defined(CPP_GCC)
131#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
134#define HAS_VARIADIC_TEMPLATES
136#elif defined(_MSC_VER)
142#define HAS_VARIADIC_TEMPLATES
151#define NOEXCEPT noexcept
153#define NOEXCEPT throw()
158#define OVERRIDE override
170#define DLL_STL_LIST(STL_API, STL_TYPE) \
171 template class STL_API std::allocator< STL_TYPE >; \
172 template class STL_API std::vector<STL_TYPE, std::allocator< STL_TYPE > >;
179#if defined(_MSC_VER) && (_MSC_VER >= 1400)
180#pragma warning(disable: 4100 4190 4251 4275 4305 4309 4819 4996)
192typedef signed __int8 vint8_t;
194typedef unsigned __int8 vuint8_t;
196typedef signed __int16 vint16_t;
198typedef unsigned __int16 vuint16_t;
200typedef signed __int32 vint32_t;
202typedef unsigned __int32 vuint32_t;
204typedef signed __int64 vint64_t;
206typedef unsigned __int64 vuint64_t;
208typedef int8_t vint8_t;
209typedef uint8_t vuint8_t;
210typedef int16_t vint16_t;
211typedef uint16_t vuint16_t;
212typedef int32_t vint32_t;
213typedef uint32_t vuint32_t;
214typedef int64_t vint64_t;
215typedef uint64_t vuint64_t;
228typedef vint64_t vint;
229typedef vint64_t vsint;
230typedef vuint64_t vuint;
232typedef vint32_t vint;
233typedef vint32_t vsint;
234typedef vuint32_t vuint;
245#define NODATA_VALUE (-9999.)
250#define MISSINGFLOAT (-1 * FLT_MAX)
255#define MAXIMUMFLOAT FLT_MAX
265#define UTIL_ZERO 1.0e-6
270#define PI 3.14159265358979323846
275#define MINI_SLOPE 0.0001
280#define isnan(x) ((x) != (x))
281#define isinf(x) (!_finite(x) && !_isnan(x))
289#define LIBPREFIX "lib"
291#define LIBSUFFIX ".dll"
295#define LIBPREFIX "lib"
298#define LIBSUFFIX ".so"
299#elif defined(MACOS) || defined(MACOSX)
300#define LIBSUFFIX ".dylib"
325#define CVT_INT(param) static_cast<int>((param))
327#define CVT_SIZET(param) static_cast<size_t>((param))
329#define CVT_FLT(param) static_cast<float>((param))
331#define CVT_DBL(param) static_cast<double>((param))
333#define CVT_TIMET(param) static_cast<time_t>((param))
335#define CVT_CHAR(param) static_cast<char>((param))
337#define CVT_STR(param) static_cast<string>((param))
340#define CVT_VINT(param) static_cast<vint>((param))
342#define CVT_VSINT(param) static_cast<vsint>((param))
344#define CVT_VUINT(param) static_cast<vuint>((param))
346#define CVT_VUINT64(param) static_cast<vuint64_t>((param))
355#define ITOA_S _i64toa_s
356#define ITOW_S _i64tow_s
357#define I64TOA_S _i64toa_s
358#define I64TOW_S _i64tow_s
359#define UITOA_S _ui64toa_s
360#define UITOW_S _ui64tow_s
361#define UI64TOA_S _ui64toa_s
362#define UI64TOW_S _ui64tow_s
364#define ITOA_S _itoa_s
365#define ITOW_S _itow_s
366#define I64TOA_S _i64toa_s
367#define I64TOW_S _i64tow_s
368#define UITOA_S _ui64toa_s
369#define UITOW_S _ui64tow_s
370#define UI64TOA_S _ui64toa_s
371#define UI64TOW_S _ui64tow_s
424 ModelException(
const string& class_name,
const string& function_name,
const string& msg);
439 std::runtime_error runtime_error_;
453void Log(
const string& msg,
const string& logpath =
"debugInfo.log");
495 usleep(millisecs * 1000);
#define NOEXCEPT
A compatible reference to noexcept or throw() if not supported by the compiler.
Definition: basic.h:153
#define OVERRIDE
A compatible reference to override or blank if not supported by the compiler.
Definition: basic.h:160
Base type of all interfaces.
Definition: basic.h:407
virtual ~Interface()
Interface.
Definition: basic.cpp:34
Print the exception message.
Definition: basic.h:416
string ToString()
Construct error information (string version)
Definition: basic.cpp:42
const char * what() const NOEXCEPT OVERRIDE
Overload function to construct error information.
Definition: basic.cpp:46
ModelException(const string &class_name, const string &function_name, const string &msg)
Constructor.
Definition: basic.cpp:37
Base class for classes that cannot be copied.
Definition: basic.h:385
NotCopyable()
NotCopyable implementation.
Definition: basic.cpp:19
Base of all classes.
Definition: basic.h:398
virtual ~Object()
DefaultClass.
Definition: basic.cpp:30
Common Cross-platform Geographic Library (CCGL)
Definition: basic.cpp:17
void Log(const string &msg, const string &logpath)
Writes an entry to the log file.
Definition: basic.cpp:78
int GetAvailableThreadNum()
Detect the available threads number.
Definition: basic.cpp:103
std::map< string, string > STRING_MAP
Map of string key and string value.
Definition: basic.h:349
void SetDefaultOpenMPThread()
Set the default omp thread number if necessary.
Definition: basic.cpp:115
vint64_t pos_t
Signed integer representing position.
Definition: basic.h:237
bool IsIpAddress(const char *ip)
Check if the IP address is valid.
Definition: basic.cpp:50
void StatusMessage(const char *msg)
Print status messages for Debug.
Definition: basic.cpp:136
std::map< string, double > STRDBL_MAP
Map of string key and double value.
Definition: basic.h:352
void SleepMs(const int millisecs)
Sleep milliseconds.
Definition: basic.h:491
void SetOpenMPThread(const int n)
Set the omp thread number by given thread number.
Definition: basic.cpp:127