Basic configuration file. More...
#include <ogdf/basic/internal/config_autogen.h>
#include <ogdf/basic/internal/version.h>
#include <sstream>
#include <string>
Go to the source code of this file.
Classes | |
class | ogdf::Configuration |
Provides information about how OGDF has been configured. More... | |
Namespaces | |
ogdf | |
The namespace for all OGDF objects. | |
Macros | |
#define | OGDF_CASE_FALLTHROUGH |
An attribute to mark cases (in switch) that fall through to the next case. More... | |
#define | OGDF_HAS_CPP_ATTRIBUTE(x) 0 |
Important when compiling OGDF as DLL | |
#define | OGDF_EXPORT |
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL), and can thus be used by other code that links against the OGDF. More... | |
#define | OGDF_EXPORT_TEMPL_DECL OGDF_EXPORT |
If you declare a template in a header file, but only provide a definition for its implementation in a cpp file, you need to also explicitly instantiate this template in the cpp file for all its anticipated uses. More... | |
#define | OGDF_EXPORT_TEMPL_INST |
See OGDF_EXPORT_TEMPL_DECL for documentation. More... | |
#define | OGDF_LOCAL |
Specifies that a function or class is not exported by the OGDF dynamic library (shared object / DLL). More... | |
Deprecation | |
#define | OGDF_DEPRECATED(reason) |
Mark a class / member / function as deprecated. More... | |
Macros for locally disabling compiler warnings | |
#define | OGDF_DISABLE_WARNING(warningNumber) |
Disable the warning with the given number of MSVC or name of g++/clang. More... | |
#define | OGDF_DISABLE_WARNING_DEPRECATED |
Disable deprecation warnings. More... | |
#define | OGDF_DISABLE_WARNING_POP |
End the current warning configuration context (i.e. do pragma diagnostic/warning pop ) More... | |
#define | OGDF_DISABLE_WARNING_PUSH |
Start a new warning configuration context (i.e. do pragma diagnostic/warning push ) More... | |
#define | OGDF_DISABLE_WARNING_THROW_TERMINATE |
Disable the warning that calling throw will always terminate the program in a noexept block. More... | |
#define | OGDF_DISABLE_WARNING_UNUSED |
Disable the warning that something is unused. More... | |
Unused results | |
#define | OGDF_NODISCARD |
Indicate that the result of a function call should not be discarded. More... | |
Optimization | |
#define | OGDF_DECL_ALIGN(b) |
Specify the minimum alignment (in bytes) of a type to be b . This is used in type declarations. More... | |
#define | OGDF_LIKELY(x) (x) |
Specify the likely branch in a condition. More... | |
#define | OGDF_UNLIKELY(x) (x) |
Specify the unlikely branch in a condition. More... | |
Functions | |
std::ostream & | ogdf::operator<< (std::ostream &os, Configuration::LPSolver lps) |
Output operator for Configuration::LPSolver (uses Configuration::toString(Configuration::LPSolver)). More... | |
std::ostream & | ogdf::operator<< (std::ostream &os, Configuration::MemoryManager mm) |
Output operator for Configuration::MemoryManager (uses Configuration::toString(Configuration::MemoryManager)). More... | |
std::ostream & | ogdf::operator<< (std::ostream &os, Configuration::System sys) |
Output operator for Configuration::System (uses Configuration::toString(Configuration::System)). More... | |
Basic configuration file.
Definition in file config.h.
#define OGDF_CASE_FALLTHROUGH |
#define OGDF_EXPORT |
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL), and can thus be used by other code that links against the OGDF.
See the gcc guide on visibility for more details. Rough guidelines for usage within the OGDF:
class OGDF_EXPORT MyClass { [...] friend OGDF_EXPORT std::ostream& operator<<(std::ostream& os, const MyClass& H); }
For Windows DLL builds, this expands to dllexport
during library build, and to dllimport
when a header is used by another library. For shared object builds, this expands to __attribute__((visibility("default")))
. For static builds, this expands to nothing.
#define OGDF_EXPORT_TEMPL_DECL OGDF_EXPORT |
If you declare a template in a header file, but only provide a definition for its implementation in a cpp file, you need to also explicitly instantiate this template in the cpp file for all its anticipated uses.
Templates generally do not need to be marked OGDF_EXPORT to be visible to users of the OGDF, but their explicit instantiations need to be marked such. As this works slightly different on Windows and UNIX, this macro replaces OGDF_EXPORT (only) for template instantiations.
In the header file (usually where you declare the template), you will also need to declare its explicit instantiations, but also mark them extern
to not cause their direct instantiation. For these declarations, use OGDF_EXPORT_TEMPL_DECL. In the cpp file where you actually instantiate the template, use OGDF_EXPORT_TEMPL_INST. See CrossingMinimalPosition<CGAL::Gmpq>
in the corresponding header and cpp file or the code below for an example.
Example header file:
Example cpp implementation file:
On most systems, OGDF_EXPORT_TEMPL_DECL expands to OGDF_EXPORT and OGDF_EXPORT_TEMPL_INST expands to nothing, as e.g. for gcc the first declaration needs to have the export attribute. Only when building a DLL on Windows, the two definitions are switched as MSVC needs to have the export attribute on the actual instantiation.
#define OGDF_EXPORT_TEMPL_INST |
See OGDF_EXPORT_TEMPL_DECL for documentation.
#define OGDF_LOCAL |
Specifies that a function or class is not exported by the OGDF dynamic library (shared object / DLL).
Note that this means it cannot be used by code that dynamically links against the OGDF, which is the default configuration.