BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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) && (BALL_COMPILER_VERSION_MAJOR - 0 > 3 || (BALL_COMPILER_VERSION_MAJOR - 0 == 3 && BALL_COMPILER_VERSION_MINOR - 0 >= 2))
62  #define BALL_DEPRECATED __attribute__((deprecated))
63 #elif defined(BALL_COMPILER_LLVM)
64  #define BALL_DEPRECATED __attribute__((deprecated))
65 #else
66  #define BALL_DEPRECATED
67 #endif
68 
69 namespace BALL
70 {
71 
72  typedef int (*ComparatorType)(const void *, const void *);
73 
81 
89 
99 
108 
117 
125  typedef time_t Time;
126 
134 
143 
150  typedef float Real;
151 
158  typedef double DoubleReal;
159 
168 
176 
177 
185  typedef unsigned char Byte;
186 
194  typedef BALL_ULONG64_TYPE LongSize;
195 
203  typedef BALL_LONG64_TYPE LongIndex;
204 
209  typedef BALL_POINTERSIZEUINT_TYPE PointerSizeUInt;
210 
212 
213  enum ASCII
214  {
216  ASCII__BELL = '\a',
224 
231  };
232 
236 
238  static const Handle HANDLE_MIN = 0 ;
240 
241  static const Index INVALID_INDEX = -1;
242  static const Index INDEX_MIN = 0;
244 
246  static const Position POSITION_MIN = 0;
248 
249 # undef SIZE_MAX
251  static const Size SIZE_MIN = 0;
253 
254 
255 }
256 
257 #endif // BALL_COMMON_GLOBAL_H
static const Index INDEX_MIN
float Real
BALL_POINTERSIZEUINT_TYPE PointerSizeUInt
int(* ComparatorType)(const void *, const void *)
Definition: COMMON/global.h:72
static const Size SIZE_MIN
BALL_SIZE_TYPE Handle
Definition: COMMON/global.h:98
static const Position POSITION_MAX
static const Distance INVALID_DISTANCE
BALL_SIZE_TYPE Property
static const Size SIZE_MAX
BALL_INDEX_TYPE ErrorCode
BALL_INDEX_TYPE Distance
Definition: COMMON/global.h:88
static const Distance DISTANCE_MIN
static const Distance DISTANCE_MAX
T max(const T &a, const T &b)
Definition: MATHS/common.h:79
static const Position POSITION_MIN
BALL_ULONG64_TYPE LongSize
static const Handle HANDLE_MAX
time_t Time
static const Position INVALID_POSITION
BALL_LONG64_TYPE LongIndex
BALL_SIZE_TYPE Size
double DoubleReal
static const Index INDEX_MAX
static const Handle INVALID_HANDLE
static const Size INVALID_SIZE
unsigned char Byte
static const Handle HANDLE_MIN
BALL_INDEX_TYPE Index
BALL_SIZE_TYPE HashIndex
BALL_SIZE_TYPE Position
T min(const T &a, const T &b)
Definition: MATHS/common.h:106
static const Index INVALID_INDEX