Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

config.h File Reference

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...
 

Detailed Description

Basic configuration file.

Author
Carsten Gutwenger
License:
This file is part of the Open Graph Drawing Framework (OGDF).
Copyright (C)
See README.md in the OGDF root directory for details.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License Version 2 or 3 as published by the Free Software Foundation; see the file LICENSE.txt included in the packaging of this file for details.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/copyleft/gpl.html

Definition in file config.h.

Macro Definition Documentation

◆ OGDF_CASE_FALLTHROUGH

#define OGDF_CASE_FALLTHROUGH

An attribute to mark cases (in switch) that fall through to the next case.

Definition at line 337 of file config.h.

◆ OGDF_EXPORT

#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:

  • use it for all non-template classes defined in a header
  • don't use it for any class members (especially member functions)
  • don't use it for class pre-declarations (used instead of imports or needed for "cyclic" definitions)
  • use it for all non-template functions (not members, i.e. outside of classes) defined in a header
  • don't use it for template classes or template functions, except when you explicitly instantiate them (see OGDF_EXPORT_TEMPL_INST and OGDF_EXPORT_TEMPL_DECL for explicit template instantiations)
  • use it for non-member functions declared as friend if you don't declare them somewhere else, e.g. 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.

See also
OGDF_LOCAL

Definition at line 117 of file config.h.

◆ OGDF_EXPORT_TEMPL_DECL

#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:

{c++}
template<typename T>
class MyTemplate {
void call(T data);
};
extern template class OGDF_EXPORT_TEMPL_DECL MyTemplate<double>;

Example cpp implementation file:

{c++}
template<typename T>
void MyTemplate<T>::call(T data) {
// complicated implementation
}
template class OGDF_EXPORT_TEMPL_INST MyTemplate<double>;

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.

See also
OGDF_EXPORT
OGDF_EXPORT_TEMPL_INST

Definition at line 161 of file config.h.

◆ OGDF_EXPORT_TEMPL_INST

#define OGDF_EXPORT_TEMPL_INST

See OGDF_EXPORT_TEMPL_DECL for documentation.

See also
OGDF_EXPORT
OGDF_EXPORT_TEMPL_DECL

Definition at line 169 of file config.h.

◆ OGDF_HAS_CPP_ATTRIBUTE

#define OGDF_HAS_CPP_ATTRIBUTE (   x)    0

Definition at line 89 of file config.h.

◆ OGDF_LOCAL

#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.

See also
OGDF_EXPORT

Definition at line 178 of file config.h.

OGDF_EXPORT_TEMPL_DECL
#define OGDF_EXPORT_TEMPL_DECL
If you declare a template in a header file, but only provide a definition for its implementation in a...
Definition: config.h:161
OGDF_EXPORT_TEMPL_INST
#define OGDF_EXPORT_TEMPL_INST
See OGDF_EXPORT_TEMPL_DECL for documentation.
Definition: config.h:169