|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
40 #if defined(OGDF_DEBUG) && defined(NDEBUG)
41 # error "Contradicting configuration: Macros OGDF_DEBUG and NDEBUG are defined."
52 #if defined(unix) || defined(__unix__) || defined(__unix) || defined(_AIX) || defined(__APPLE__)
53 # define OGDF_SYSTEM_UNIX
56 #if defined(__WIN32__) || defined(_WIN32) || defined(__NT__)
57 # define OGDF_SYSTEM_WINDOWS
61 #if defined(__APPLE__)
62 # define OGDF_SYSTEM_OSX
67 #if __cplusplus < 201103
69 # if defined(_MSC_VER)
71 # error "Compiling OGDF requires Visual C++ 11 (Visual Studio 2012) or higher!"
74 # elif defined(__GNUC__)
75 # ifndef __GXX_EXPERIMENTAL_CXX0X__
76 # error "No C++11 support activated for g++ (compile with -std=c++0x or -std=c++11)!"
80 # error "Compiling OGDF requires a C++11 compliant compiler!"
85 #ifdef __has_cpp_attribute
86 # define OGDF_HAS_CPP_ATTRIBUTE(x) \
87 (__has_cpp_attribute(x) && __cplusplus >= __has_cpp_attribute(x))
89 # define OGDF_HAS_CPP_ATTRIBUTE(x) 0
103 #ifdef OGDF_SYSTEM_WINDOWS
107 # define OGDF_EXPORT __declspec(dllexport)
109 # define OGDF_EXPORT __declspec(dllimport)
120 #define OGDF_DEPRECATED(reason)
122 #if OGDF_HAS_CPP_ATTRIBUTE(deprecated)
123 # undef OGDF_DEPRECATED
124 # define OGDF_DEPRECATED(reason) [[deprecated(reason)]]
125 #elif defined(_MSC_VER)
126 # undef OGDF_DEPRECATED
127 # define OGDF_DEPRECATED(reason) __declspec(deprecated(reason))
128 #elif defined(__GNUC__)
129 # undef OGDF_DEPRECATED
130 # define OGDF_DEPRECATED(reason) __attribute__((deprecated(reason)))
139 #define OGDF_DISABLE_WARNING_PUSH
143 #define OGDF_DISABLE_WARNING_POP
147 #define OGDF_DISABLE_WARNING(warningNumber)
151 #define OGDF_DISABLE_WARNING_THROW_TERMINATE
155 #define OGDF_DISABLE_WARNING_UNUSED
159 #define OGDF_DISABLE_WARNING_DEPRECATED
161 #if defined(_MSC_VER)
162 # undef OGDF_DISABLE_WARNING_PUSH
163 # undef OGDF_DISABLE_WARNING_POP
164 # undef OGDF_DISABLE_WARNING
166 # define OGDF_DISABLE_WARNING_PUSH __pragma(warning(push))
167 # define OGDF_DISABLE_WARNING_POP __pragma(warning(pop))
168 # define OGDF_DISABLE_WARNING(warningNumber) __pragma(warning(disable : warningNumber))
169 #elif defined(__GNUC__) || defined(__clang__)
170 # undef OGDF_DISABLE_WARNING_PUSH
171 # undef OGDF_DISABLE_WARNING_POP
172 # undef OGDF_DISABLE_WARNING
174 # define OGDF_DO_PRAGMA(X) _Pragma(#X)
175 # define OGDF_DISABLE_WARNING_PUSH OGDF_DO_PRAGMA(GCC diagnostic push)
176 # define OGDF_DISABLE_WARNING_POP OGDF_DO_PRAGMA(GCC diagnostic pop)
177 # define OGDF_DISABLE_WARNING(warningName) OGDF_DO_PRAGMA(GCC diagnostic ignored warningName)
180 #if defined(__GNUC__)
181 # if defined(__clang__)
182 # undef OGDF_DISABLE_WARNING_THROW_TERMINATE
183 # define OGDF_DISABLE_WARNING_THROW_TERMINATE OGDF_DISABLE_WARNING("-Wexceptions")
185 # undef OGDF_DISABLE_WARNING_THROW_TERMINATE
186 # define OGDF_DISABLE_WARNING_THROW_TERMINATE OGDF_DISABLE_WARNING("-Wterminate")
188 # undef OGDF_DISABLE_WARNING_UNUSED
189 # define OGDF_DISABLE_WARNING_UNUSED OGDF_DISABLE_WARNING("-Wunused")
190 # undef OGDF_DISABLE_WARNING_DEPRECATED
191 # define OGDF_DISABLE_WARNING_DEPRECATED OGDF_DISABLE_WARNING("-Wdeprecated-declarations")
192 #elif defined(_MSC_VER)
193 # undef OGDF_DISABLE_WARNING_THROW_TERMINATE
194 # define OGDF_DISABLE_WARNING_THROW_TERMINATE OGDF_DISABLE_WARNING(4297)
203 #define OGDF_NODISCARD
205 #if OGDF_HAS_CPP_ATTRIBUTE(nodiscard)
206 # undef OGDF_NODISCARD
207 # define OGDF_NODISCARD [[nodiscard]]
208 #elif defined(__GNUC__)
209 # undef OGDF_NODISCARD
210 # define OGDF_NODISCARD __attribute__((warn_unused_result))
223 #define OGDF_LIKELY(x) (x)
230 #define OGDF_UNLIKELY(x) (x)
234 #define OGDF_DECL_ALIGN(b)
236 #ifdef _MSC_VER // Visual C++ compiler
237 # undef OGDF_DECL_ALIGN
238 # define OGDF_DECL_ALIGN(b) __declspec(align(b))
239 #elif defined(__GNUC__) // GNU gcc compiler (also Intel compiler)
241 # define OGDF_LIKELY(x) __builtin_expect((x), 1)
242 # undef OGDF_UNLIKELY
243 # define OGDF_UNLIKELY(x) __builtin_expect((x), 0)
244 # undef OGDF_DECL_ALIGN
245 # define OGDF_DECL_ALIGN(b) __attribute__((aligned(b)))
251 #define OGDF_CASE_FALLTHROUGH
252 #if OGDF_HAS_CPP_ATTRIBUTE(fallthrough)
253 # undef OGDF_CASE_FALLTHROUGH
254 # define OGDF_CASE_FALLTHROUGH [[fallthrough]]
255 #elif defined(__GNUC__) && __GNUC__ >= 7
256 # undef OGDF_CASE_FALLTHROUGH
257 # define OGDF_CASE_FALLTHROUGH __attribute__((fallthrough))
314 #ifdef OGDF_SYSTEM_WINDOWS
315 return System::Windows;
316 #elif defined(OGDF_SYSTEM_OSX)
318 #elif defined(OGDF_SYSTEM_UNIX)
321 return System::Unknown
332 static constexpr
bool haveLPSolver() {
return true; }
336 #if defined(COIN_OSI_CLP)
337 return LPSolver::Clp;
338 #elif defined(COIN_OSI_SYM)
339 return LPSolver::Symphony;
340 #elif defined(COIN_OSI_CPX)
341 return LPSolver::CPLEX;
342 #elif defined(COIN_OSI_GRB)
343 return LPSolver::Gurobi;
345 # error "OGDF is compiled without LP solver. Check your build configuration."
358 static constexpr
bool haveCoin() {
return true; }
369 static constexpr
bool haveAbacus() {
return true; }
381 #if defined(OGDF_MEMORY_POOL_TS)
382 return MemoryManager::PoolTS;
383 #elif defined(OGDF_MEMORY_POOL_NTS)
384 return MemoryManager::PoolNTS;
385 #elif defined(OGDF_MEMORY_MALLOC_TS)
386 return MemoryManager::Malloc;
388 # error "OGDF is compiled without memory manager. Check your build configuration."
399 static const string&
toString(MemoryManager mm);
The namespace for all OGDF objects.
LPSolver
Specifies the LP-solver used by OGDF.
static const string & toString(System sys)
Converts sys to a (readable) string.
#define OGDF_DEPRECATED(reason)
Mark a class / member / function as deprecated.
MemoryManager
Specifies the memory-manager used by OGDF.
System
Specifies the operating system for which OGDF has been configured/built.
static constexpr LPSolver whichLPSolver()
Returns the LP-solver used by OGDF.
Provides information about how OGDF has been configured.
#define OGDF_DISABLE_WARNING(warningNumber)
Disable the warning with the given number of MSVC or name of g++/clang.
std::ostream & operator<<(std::ostream &os, const ogdf::Array< E, INDEX > &a)
Prints array a to output stream os.
static constexpr MemoryManager whichMemoryManager()
Returns the memory manager used by OGDF.
string toString(FromClass key)
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
System specific functionality.
@ None
Two geometric objects do not intersect.
std::string to_string(const std::function< std::ostream &(std::ostream &)> &func)
static constexpr System whichSystem()
Returns the operating system for which OGDF has been configured.