Loading...
Searching...
No Matches
COMMON/global.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_COMMON_GLOBAL_H
#define BALL_COMMON_GLOBAL_H
#ifndef BALL_CONFIG_CONFIG_H
# include <BALL/CONFIG/config.h>
#endif
#include <limits>
#include <time.h>
#ifdef BALL_HAS_BASETSD_H
# include <basetsd.h>
#endif
// If possible use the ISO C99-compliant header stdint.h
// to define the portable integer types.
#ifdef BALL_HAS_STDINT_H
# include <stdint.h>
#endif
#ifdef BALL_COMPILER_MSVC
# define BALL_HIDE
# ifdef BALL_BUILD_DLL
# define BALL_EXPORT __declspec(dllexport)
# define BALL_EXTERN_VARIABLE __declspec(dllexport) extern
# else
# define BALL_EXPORT __declspec(dllimport)
# define BALL_EXTERN_VARIABLE __declspec(dllimport) extern
# endif
# ifdef BALL_VIEW_BUILD_DLL
# define BALL_VIEW_EXPORT __declspec(dllexport)
# else
# define BALL_VIEW_EXPORT __declspec(dllimport)
# endif
#elif defined(BALL_COMPILER_GXX) && (BALL_COMPILER_VERSION_MAJOR > 4 || (BALL_COMPILER_VERSION_MAJOR == 4 && BALL_COMPILER_VERSION_MINOR >= 3))
# define BALL_EXPORT __attribute__((visibility ("default")))
# define BALL_HIDE __attribute__((visibility ("hidden")))
# define BALL_VIEW_EXPORT __attribute__((visibility ("default")))
# define BALL_EXTERN_VARIABLE extern __attribute__((visibility ("default")))
# elif defined(BALL_COMPILER_LLVM)
# define BALL_EXPORT __attribute__((visibility ("default")))
# define BALL_HIDE __attribute__((visibility ("hidden")))
# define BALL_VIEW_EXPORT __attribute__((visibility ("default")))
# define BALL_EXTERN_VARIABLE extern __attribute__((visibility ("default")))
#else
# define BALL_EXPORT
# define BALL_HIDE
# define BALL_VIEW_EXPORT
# define BALL_EXTERN_VARIABLE extern
#endif
//This declares a BALL_DEPRECATED macro that can be used to mark deprecated api
//It is essentially copied from Qt 4.4.1 but simplified, thus there might be
//some cases where it does not work as expected, yet.
#if defined(BALL_COMPILER_MSVC) && (_MSC_VER >= 1300)
#define BALL_DEPRECATED __declspec(deprecated)
#elif defined(BALL_COMPILER_GXX) || defined(BALL_COMPILER_LLVM)
#define BALL_DEPRECATED __attribute__((deprecated))
#else
#define BALL_DEPRECATED
#endif
namespace BALL
{
typedef int (*ComparatorType)(const void *, const void *);
typedef BALL_INDEX_TYPE Distance;
typedef BALL_SIZE_TYPE Handle;
typedef BALL_INDEX_TYPE Index;
typedef BALL_SIZE_TYPE Size;
typedef time_t Time;
typedef BALL_SIZE_TYPE HashIndex;
typedef BALL_SIZE_TYPE Position;
typedef float Real;
typedef double DoubleReal;
typedef BALL_SIZE_TYPE Property;
typedef BALL_INDEX_TYPE ErrorCode;
typedef unsigned char Byte;
typedef BALL_ULONG64_TYPE LongSize;
typedef BALL_LONG64_TYPE LongIndex;
typedef BALL_POINTERSIZEUINT_TYPE PointerSizeUInt;
enum ASCII
{
ASCII__BACKSPACE = '\b',
ASCII__BELL = '\a',
ASCII__CARRIAGE_RETURN = '\r',
ASCII__HORIZONTAL_TAB = '\t',
ASCII__NEWLINE = '\n',
ASCII__RETURN = ASCII__NEWLINE,
ASCII__SPACE = ' ',
ASCII__TAB = ASCII__HORIZONTAL_TAB,
ASCII__VERTICAL_TAB = '\v',
ASCII__COLON = ':',
ASCII__COMMA = ',',
ASCII__EXCLAMATION_MARK = '!',
ASCII__POINT = '.',
ASCII__QUESTION_MARK = '?',
ASCII__SEMICOLON = ';'
};
static const Distance INVALID_Distance = std::numeric_limits<Distance>::max();
static const Distance Distance_MIN = (std::numeric_limits<Distance>::min() + 1);
static const Distance Distance_MAX = std::numeric_limits<Distance>::max();
static const Handle INVALID_Handle = std::numeric_limits<Handle>::max();
static const Handle Handle_MIN = 0 ;
static const Handle Handle_MAX = std::numeric_limits<Handle>::max() - 1;
static const Index INVALID_Index = -1;
static const Index Index_MIN = 0;
static const Index Index_MAX = std::numeric_limits<Index>::max();
static const Position INVALID_Position = std::numeric_limits<Position>::max();
static const Position Position_MIN = 0;
static const Position Position_MAX = std::numeric_limits<Position>::max() - 1;
static const Size INVALID_Size = std::numeric_limits<Size>::max();
static const Size Size_MIN = 0;
static const Size Size_MAX = std::numeric_limits<Size>::max() - 1;
}
#endif // BALL_COMMON_GLOBAL_H
BALL_INDEX_TYPE
BALL_SIZE_TYPE
BALL
Definition constants.h:13
BALL::Size_MAX
static const Size Size_MAX
Definition COMMON/global.h:249
BALL::Handle_MIN
static const Handle Handle_MIN
Definition COMMON/global.h:236
BALL::INVALID_Distance
static const Distance INVALID_Distance
Definition COMMON/global.h:231
BALL::HashIndex
BALL_SIZE_TYPE HashIndex
Definition COMMON/global.h:131
BALL::Position_MIN
static const Position Position_MIN
Definition COMMON/global.h:244
BALL::INVALID_Position
static const Position INVALID_Position
Definition COMMON/global.h:243
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
BALL::INVALID_Size
static const Size INVALID_Size
Definition COMMON/global.h:247
BALL::Time
time_t Time
Definition COMMON/global.h:123
BALL::PointerSizeUInt
BALL_POINTERSIZEUINT_TYPE PointerSizeUInt
Definition COMMON/global.h:207
BALL::DoubleReal
double DoubleReal
Definition COMMON/global.h:156
BALL::Property
BALL_SIZE_TYPE Property
Definition COMMON/global.h:165
BALL::LongSize
BALL_ULONG64_TYPE LongSize
Definition COMMON/global.h:192
BALL::ASCII
ASCII
Definition COMMON/global.h:212
BALL::ASCII__POINT
@ ASCII__POINT
Definition COMMON/global.h:226
BALL::ASCII__HORIZONTAL_TAB
@ ASCII__HORIZONTAL_TAB
Definition COMMON/global.h:216
BALL::ASCII__EXCLAMATION_MARK
@ ASCII__EXCLAMATION_MARK
Definition COMMON/global.h:225
BALL::ASCII__BELL
@ ASCII__BELL
Definition COMMON/global.h:214
BALL::ASCII__COMMA
@ ASCII__COMMA
Definition COMMON/global.h:224
BALL::ASCII__CARRIAGE_RETURN
@ ASCII__CARRIAGE_RETURN
Definition COMMON/global.h:215
BALL::ASCII__BACKSPACE
@ ASCII__BACKSPACE
Definition COMMON/global.h:213
BALL::ASCII__TAB
@ ASCII__TAB
Definition COMMON/global.h:220
BALL::ASCII__VERTICAL_TAB
@ ASCII__VERTICAL_TAB
Definition COMMON/global.h:221
BALL::ASCII__SPACE
@ ASCII__SPACE
Definition COMMON/global.h:219
BALL::ASCII__SEMICOLON
@ ASCII__SEMICOLON
Definition COMMON/global.h:228
BALL::ASCII__NEWLINE
@ ASCII__NEWLINE
Definition COMMON/global.h:217
BALL::ASCII__COLON
@ ASCII__COLON
Definition COMMON/global.h:223
BALL::ASCII__RETURN
@ ASCII__RETURN
Definition COMMON/global.h:218
BALL::ASCII__QUESTION_MARK
@ ASCII__QUESTION_MARK
Definition COMMON/global.h:227
BALL::INVALID_Handle
static const Handle INVALID_Handle
Definition COMMON/global.h:235
BALL::ErrorCode
BALL_INDEX_TYPE ErrorCode
Definition COMMON/global.h:173
BALL::INVALID_Index
static const Index INVALID_Index
Definition COMMON/global.h:239
BALL::ComparatorType
int(* ComparatorType)(const void *, const void *)
Definition COMMON/global.h:70
BALL::Position
BALL_SIZE_TYPE Position
Definition COMMON/global.h:140
BALL::Index_MAX
static const Index Index_MAX
Definition COMMON/global.h:241
BALL::Handle
BALL_SIZE_TYPE Handle
Definition COMMON/global.h:96
BALL::Distance_MIN
static const Distance Distance_MIN
Definition COMMON/global.h:232
BALL::Distance_MAX
static const Distance Distance_MAX
Definition COMMON/global.h:233
BALL::Size_MIN
static const Size Size_MIN
Definition COMMON/global.h:248
BALL::LongIndex
BALL_LONG64_TYPE LongIndex
Definition COMMON/global.h:201
BALL::Position_MAX
static const Position Position_MAX
Definition COMMON/global.h:245
BALL::Index_MIN
static const Index Index_MIN
Definition COMMON/global.h:240
BALL::Handle_MAX
static const Handle Handle_MAX
Definition COMMON/global.h:237
BALL::Byte
unsigned char Byte
Definition COMMON/global.h:183
BALL::Distance
BALL_INDEX_TYPE Distance
Definition COMMON/global.h:86
BALL::Index
BALL_INDEX_TYPE Index
Definition COMMON/global.h:105
BALL::Real
float Real
Definition COMMON/global.h:148