BALL  1.5.0
COMMON/global.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 
5 #ifndef BALL_COMMON_GLOBAL_H
6 #define BALL_COMMON_GLOBAL_H
7 
8 #ifndef BALL_CONFIG_CONFIG_H
9 # include <BALL/CONFIG/config.h>
10 #endif
11 
12 #include <limits>
13 #include <time.h>
14 
15 #ifdef BALL_HAS_BASETSD_H
16 # include <basetsd.h>
17 #endif
18 
19 // If possible use the ISO C99-compliant header stdint.h
20 // to define the portable integer types.
21 #ifdef BALL_HAS_STDINT_H
22 # include <stdint.h>
23 #endif
24 
25 #ifdef BALL_COMPILER_MSVC
26 # define BALL_HIDE
27 # ifdef BALL_BUILD_DLL
28 # define BALL_EXPORT __declspec(dllexport)
29 # define BALL_EXTERN_VARIABLE __declspec(dllexport) extern
30 # else
31 # define BALL_EXPORT __declspec(dllimport)
32 # define BALL_EXTERN_VARIABLE __declspec(dllimport) extern
33 # endif
34 # ifdef BALL_VIEW_BUILD_DLL
35 # define BALL_VIEW_EXPORT __declspec(dllexport)
36 # else
37 # define BALL_VIEW_EXPORT __declspec(dllimport)
38 # endif
39 #elif defined(BALL_COMPILER_GXX) && (BALL_COMPILER_VERSION_MAJOR > 4 || (BALL_COMPILER_VERSION_MAJOR == 4 && BALL_COMPILER_VERSION_MINOR >= 3))
40 # define BALL_EXPORT __attribute__((visibility ("default")))
41 # define BALL_HIDE __attribute__((visibility ("hidden")))
42 # define BALL_VIEW_EXPORT __attribute__((visibility ("default")))
43 # define BALL_EXTERN_VARIABLE extern __attribute__((visibility ("default")))
44 # elif defined(BALL_COMPILER_LLVM)
45 # define BALL_EXPORT __attribute__((visibility ("default")))
46 # define BALL_HIDE __attribute__((visibility ("hidden")))
47 # define BALL_VIEW_EXPORT __attribute__((visibility ("default")))
48 # define BALL_EXTERN_VARIABLE extern __attribute__((visibility ("default")))
49 #else
50 # define BALL_EXPORT
51 # define BALL_HIDE
52 # define BALL_VIEW_EXPORT
53 # define BALL_EXTERN_VARIABLE extern
54 #endif
55 
56 //This declares a BALL_DEPRECATED macro that can be used to mark deprecated api
57 //It is essentially copied from Qt 4.4.1 but simplified, thus there might be
58 //some cases where it does not work as expected, yet.
59 #if defined(BALL_COMPILER_MSVC) && (_MSC_VER >= 1300)
60  #define BALL_DEPRECATED __declspec(deprecated)
61 #elif defined(BALL_COMPILER_GXX) || defined(BALL_COMPILER_LLVM)
62  #define BALL_DEPRECATED __attribute__((deprecated))
63 #else
64  #define BALL_DEPRECATED
65 #endif
66 
67 namespace BALL
68 {
69 
70  typedef int (*ComparatorType)(const void *, const void *);
71 
79 
87 
97 
106 
115 
123  typedef time_t Time;
124 
132 
141 
148  typedef float Real;
149 
156  typedef double DoubleReal;
157 
166 
174 
175 
183  typedef unsigned char Byte;
184 
192  typedef BALL_ULONG64_TYPE LongSize;
193 
201  typedef BALL_LONG64_TYPE LongIndex;
202 
207  typedef BALL_POINTERSIZEUINT_TYPE PointerSizeUInt;
208 
210 
211  enum ASCII
212  {
214  ASCII__BELL = '\a',
222 
229  };
230 
232  static const Distance Distance_MIN = (std::numeric_limits<Distance>::min() + 1);
234 
236  static const Handle Handle_MIN = 0 ;
237  static const Handle Handle_MAX = std::numeric_limits<Handle>::max() - 1;
238 
239  static const Index INVALID_Index = -1;
240  static const Index Index_MIN = 0;
242 
244  static const Position Position_MIN = 0;
245  static const Position Position_MAX = std::numeric_limits<Position>::max() - 1;
246 
248  static const Size Size_MIN = 0;
249  static const Size Size_MAX = std::numeric_limits<Size>::max() - 1;
250 
251 
252 }
253 
254 #endif // BALL_COMMON_GLOBAL_H
BALL_ULONG64_TYPE LongSize
static const Handle Handle_MAX
T max(const T &a, const T &b)
Definition: MATHS/common.h:75
static const Size INVALID_Size
unsigned char Byte
BALL_SIZE_TYPE Position
BALL_INDEX_TYPE Distance
Definition: COMMON/global.h:86
BALL_LONG64_TYPE LongIndex
BALL_POINTERSIZEUINT_TYPE PointerSizeUInt
static const Size Size_MIN
float Real
static const Distance INVALID_Distance
static const Handle INVALID_Handle
static const Distance Distance_MAX
BALL_INDEX_TYPE Index
static const Handle Handle_MIN
T min(const T &a, const T &b)
Definition: MATHS/common.h:102
time_t Time
static const Position Position_MIN
static const Index INVALID_Index
static const Position Position_MAX
BALL_INDEX_TYPE ErrorCode
BALL_SIZE_TYPE Handle
Definition: COMMON/global.h:96
static const Index Index_MIN
BALL_SIZE_TYPE Size
Definition: constants.h:12
double DoubleReal
static const Size Size_MAX
static const Distance Distance_MIN
BALL_SIZE_TYPE Property
static const Position INVALID_Position
BALL_SIZE_TYPE HashIndex
int(* ComparatorType)(const void *, const void *)
Definition: COMMON/global.h:70
static const Index Index_MAX