icinga2/lib/base/i2-base.hpp

86 lines
1.9 KiB
C++
Raw Permalink Normal View History

Replace all existing copyright headers with `SPDX` headers I've used the following command to replace the original copyright header lines in a C-style comment block: ``` $ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f -exec perl -pi -e 's{/\*[^*]*\(\s*c\s*\)\s*(\d{4})\s*Icinga\s+GmbH[^*]*\*/}{// SPDX-FileCopyrightText: \1 Icinga GmbH <https://icinga.com>\n// SPDX-License-Identifier: GPL-2.0-or-later}gi' {} + ``` For files that use shell-style comments (#) like CMakeLists.txt, I've used this command: ``` $ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f -exec perl -pi -e 's{#.*\(\s*c\s*\)\s(\d{4})\sIcinga\s+GmbH.*}{# SPDX-FileCopyrightText: \1 Icinga GmbH <https://icinga.com>\n# SPDX-License-Identifier: GPL-2.0-or-later}gi' {} + ``` And for SQL files: ``` $ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f \( -name '*.sql' \) -exec perl -pi -e 's{--.*\(c\)\s(\d{4})\sIcinga\sGmbH.*}{-- SPDX-FileCopyrightText: \1 Icinga GmbH <https://icinga.com>\n-- SPDX-License-Identifier: GPL-2.0-or-later}gi' {} + $ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f \( -name '*.sql' \) -exec perl -pi -e 's{-- Copyright \(c\)\s(\d{4})\sIcinga\s+Development\sTeam.*}{-- SPDX-FileCopyrightText: \1 Icinga GmbH <https://icinga.com>\n-- SPDX-License-Identifier: GPL-2.0-or-later}gi' {} + ```
2026-01-27 09:06:40 -05:00
// SPDX-FileCopyrightText: 2012 Icinga GmbH <https://icinga.com>
// SPDX-License-Identifier: GPL-2.0-or-later
#ifndef I2BASE_H
#define I2BASE_H
2012-03-28 07:24:49 -04:00
2012-05-18 16:21:28 -04:00
/**
2012-05-19 04:48:00 -04:00
* @mainpage Icinga Documentation
*
* Icinga implements a framework for run-time-loadable components which can
* pass messages between each other. These components can either be hosted in
* the same process or in several host processes (either on the same machine or
2012-05-19 04:48:00 -04:00
* on different machines).
*
* The framework's code critically depends on the following patterns:
*
2012-05-19 05:04:52 -04:00
* <list type="bullet">
* <item>Smart pointers
2012-05-19 04:48:00 -04:00
*
* The shared_ptr and weak_ptr template classes are used to simplify memory
* management and to avoid accidental memory leaks and use-after-free
* bugs.</item>
2012-05-19 04:48:00 -04:00
*
2012-05-19 05:04:52 -04:00
* <item>Observer pattern
2012-05-19 04:48:00 -04:00
*
* Framework classes expose events which other objects can subscribe to. This
* is used to decouple clients of a class from the class' internal
2012-05-19 05:04:52 -04:00
* implementation.</item>
* </list>
2012-05-18 16:21:28 -04:00
*/
/**
* @defgroup base Base class library
*
2012-05-19 04:48:00 -04:00
* The base class library implements commonly-used functionality like
* event handling for sockets and timers.
2012-05-18 16:21:28 -04:00
*/
#include <boost/config.hpp>
#if defined(__clang__) && __cplusplus >= 201103L
# undef BOOST_NO_CXX11_HDR_TUPLE
#endif
2012-04-03 09:47:32 -04:00
#ifdef _MSC_VER
# pragma warning(disable:4251)
2012-06-14 10:09:04 -04:00
# pragma warning(disable:4275)
2012-07-14 07:57:20 -04:00
# pragma warning(disable:4345)
#endif /* _MSC_VER */
#include "config.h"
#ifdef _WIN32
2014-05-25 10:23:35 -04:00
# include "base/win32.hpp"
#else
2014-05-25 10:23:35 -04:00
# include "base/unix.hpp"
#endif
#include <cstdlib>
#include <cstdarg>
#include <cstdio>
#include <cstring>
#include <cerrno>
2012-03-28 07:24:49 -04:00
2013-02-01 17:10:48 -05:00
#include <sys/types.h>
#include <sys/stat.h>
#include <signal.h>
2013-02-01 17:10:48 -05:00
2012-05-25 10:56:47 -04:00
#include <exception>
2012-05-26 17:12:46 -04:00
#include <stdexcept>
2012-05-25 08:40:10 -04:00
#if defined(__APPLE__) && defined(__MACH__)
2013-02-17 13:14:34 -05:00
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
#define BOOST_BIND_NO_PLACEHOLDERS
#include <functional>
#include <chrono>
namespace icinga {
using namespace std::chrono_literals;
} // namespace icinga
#endif /* I2BASE_H */