Base.h
1 //##################################################################################################
2 //
3 // Ceetron Desktop Components
4 // Component: Core
5 //
6 // --------------------------------------------------------------------------------------------
7 // Copyright (C) 2011, Ceetron AS
8 // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Ceetron AS. The contents of this file may
9 // not be disclosed to third parties, copied or duplicated in any form, in whole or in part,
10 // without the prior written permission of Ceetron AS.
11 //##################################################################################################
12 
13 #pragma once
14 
15 
16 // Disable some annoying warnings so we can compile with warning level Wall
17 #ifdef WIN32
18 // 4512 'class' : assignment operator could not be generated : Due to problems with classes with reference member variables (e.g. VertexCompactor)
19 // 4514 unreferenced inline/local function has been removed
20 // 4625 copy constructor could not be generated because a base class copy constructor is inaccessible
21 // 4626 assignment operator could not be generated because a base class assignment operator is inaccessible
22 // 4640 'staticInstance' : construction of local static object is not thread-safe -> used by singletons. To be revisited.
23 // 4710 function 'func_name' not inlined
24 // 4711 function 'func_name' selected for automatic inline expansion
25 // 4738 storing 32-bit float result in memory, possible loss of performance
26 // 4820 'bytes' bytes padding added after construct 'member_name'
27 // 4986 'operator new[]': exception specification does not match previous declaration
28 #pragma warning (disable: 4512 4514 4625 4626 4640 4710 4711 4738 4820 4986)
29 #endif
30 
31 
32 // Brings in size_t and definition of NULL
33 #include <cstddef>
34 
35 
36 // The default configuration is for consuming CDC as a dynamic library (DLL).
37 // To build DLL version of CDC, CEE_XXXX_BUILD_DLL_EXPORT must be defined and CEE_STATIC_LIBS must NOT be defined.
38 // To build or use CDC as static libraries, make sure CEE_STATIC_LIBS is defined.
39 #ifdef CEE_STATIC_LIBS
40  #define CEE_CORE_EXPORT
41 #else
42  #if defined(WIN32)
43  #ifdef CEE_CORE_BUILD_DLL_EXPORT
44  #define CEE_CORE_EXPORT __declspec(dllexport)
45  #else
46  #define CEE_CORE_EXPORT __declspec(dllimport)
47  #endif
48  #elif defined(__GNUC__)
49  #ifdef CEE_CORE_BUILD_DLL_EXPORT
50  #define CEE_CORE_EXPORT __attribute__ ((visibility ("default")))
51  #else
52  #define CEE_CORE_EXPORT
53  #endif
54  #else
55  #define CEE_CORE_EXPORT
56  #endif
57 #endif
58 
59 
60 // Get rid of the the macros MIN and MAX which are specified in the windows headers
61 #if defined WIN32 && !defined NOMINMAX
62 #define NOMINMAX
63 #endif
64 
65 
66 // Macro to disallow copy constructor and assignment operator functions
67 // Should be placed in the class' private: section
68 #define CEE_DISALLOW_COPY_AND_ASSIGN(Class) \
69  Class(const Class&); \
70  void operator=(const Class&)
71 
72 // Macro for avoiding "unused parameter" warnings
73 // The bottom one is the best alternative, but unfortunately doesn't work on VS2010
74 #ifdef WIN32
75 #define CEE_UNUSED(EXPR) (void)(EXPR);
76 #else
77 #define CEE_UNUSED(EXPR) (void)sizeof(EXPR);
78 #endif
79 
80 // Makes it easier to check on the current GCC version
81 #ifdef __GNUC__
82 // 40302 means version 4.3.2.
83  # define CEE_GCC_VER (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
84 #endif
85 
86 // Introduce types and constants in the Ceetron Desktop Components cee namespace
87 namespace cee {
88 
90 const int UNDEFINED_INT = 2147483647;
92 const size_t UNDEFINED_SIZE_T = static_cast<size_t>(-1); // 18446744073709551615u
94 const double UNDEFINED_DOUBLE = 1.7976931348623158e+308;
96 const double UNDEFINED_DOUBLE_THRESHOLD = 1.00e+308;
98 const float UNDEFINED_FLOAT = 3.402823466e+38f;
100 const double UNDEFINED_FLOAT_THRESHOLD = 2.99e+38f;
101 
102 } // namespace cee
103 
104 // Check if the compiler supports the 'override' keyword
105 #if (defined(_MSC_VER) && (_MSC_VER > 1600)) || (!defined(_MSC_VER) && __cplusplus >= 201103L)
106 #define CEE_SUPPORTS_OVERRIDE_KEYWORD
107 #endif
108 
109 #include "CeeCore/Pimpl.h"
110 
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppComponent.cpp:26
const float UNDEFINED_FLOAT
Undefined value for float.
Definition: Base.h:98
const double UNDEFINED_FLOAT_THRESHOLD
Undefined threshold for float.
Definition: Base.h:100
const double UNDEFINED_DOUBLE_THRESHOLD
Undefined threshold for double.
Definition: Base.h:96
const size_t UNDEFINED_SIZE_T
Undefined value for size_t.
Definition: Base.h:92
const double UNDEFINED_DOUBLE
Undefined value for double.
Definition: Base.h:94
const int UNDEFINED_INT
Undefined value for int.
Definition: Base.h:90