Commit Graph

129 Commits

Author SHA1 Message Date
Alexander A. Klimov 33e609d791 Type#GetLoadDependencies(): avoid malloc()
- cache result
- return it by const ref
- do Type::GetByName() for the callers
2022-11-21 15:07:39 +01:00
Yonas Habteab aa702b050c ClassCompiler: Validate field types -> Icinga Name correctly
When the classcompiler is validating/transforming field types -> Icinga type names, it is currently returning
Icinga `Number` type for field type of `bool`, which is actually wrong. This PR ensures to always transform
into the correct Icinga type names.
2022-09-05 17:16:53 +02:00
Julian Brost abe2dfa763 Replace EventuallyAtomic with AtomicOrLocked which falls back to a mutex
Apparently there was a reason for making the members of generated classes
atomic. However, this was only done for some types, others were still accessed
using non-atomic operations. For members of type T::Ptr (i.e.  intrusive_ptr<T>),
this can result in a double free when multiple threads access the same variable
and at least one of them writes to the variable.

This commit makes use of std::atomic<T> for more T (it removes the additional
constraint sizeof(T) <= sizeof(void*)) and uses a type including a mutex for
load and store operations as a fallback.
2022-05-03 12:02:46 +02:00
Yonas Habteab a64089ffc1
`ClassCompiler`: Don't allow to define an int as a group name in `groups` attr (#9057) 2021-11-22 14:02:50 +01:00
Noah Hilverling 73e0d6e61b Icinga DB: Make sure object relationships are handled correctly 2021-11-12 13:34:57 +01:00
Alexander A. Klimov bbe0f2d8c4 mkclass: make .ti class members atomic if possible
... not to have to lock the objects while setting attributes.
2020-07-07 18:24:06 +02:00
Michael Friedrich 458f997a18 Replace Copyright header with a short version, part II 2019-02-25 15:09:36 +01:00
Michael Friedrich d14a88235d Replace Copyright header with a short version, part I
CLion -> replace in path
2019-02-25 14:48:22 +01:00
Michael Friedrich 1a8a2c25f2 icinga.com: Update test and tools 2018-10-18 09:45:36 +02:00
Michael Friedrich dea5ec614e icinga.com: Update CMakeLists.txt 2018-10-18 09:35:18 +02:00
Michael Friedrich dab53448bc icinga.com: Update *.{h,c}pp 2018-10-18 09:27:04 +02:00
Michael Friedrich caefa58cf6 Mkclass: Only render setter if not declared pure virtual 2018-08-10 10:55:42 +02:00
Jean Flach c54e042942 Add activation priorities for config object types
This patch ensures that specific configuration types
are pre-activated and post-activated. In general,
logging is first, then common configuration objects
like host/service, downtimes, etc.
In the end, all features are activated after to ensure
that notifications are only sent once downtimes are applied.
A similar thing happens for starting with checks too early.
The ApiListener feature runs first to allow cluster connections
at first glance.

fixes #6057
fixes #6231
2018-05-04 11:25:47 +02:00
Jean Flach 1da6b2c883 Fix whitespaces in CMakeLists files
Uses 2 space indentation as standard
2018-01-19 09:19:40 +01:00
Gunnar Beutner 21254fb610 Avoid accessing attributes for validators where not necessary 2018-01-11 08:20:16 +01:00
Gunnar Beutner 858961b8ec
Merge pull request #5945 from Icinga/fix/mkclass-indentation
Fix incorrect indentation for code generated by mkclass
2018-01-04 12:41:52 +01:00
Gunnar Beutner 91c256261a Apply clang-tidy fix 'modernize-use-default-member-init' 2018-01-04 12:24:58 +01:00
Gunnar Beutner e0174b8f3f Apply clang-tidy fix 'modernize-return-braced-init-list' 2018-01-04 12:24:57 +01:00
Gunnar Beutner becfa85094 Apply clang-tidy fix 'modernize-use-emplace' 2018-01-04 12:24:57 +01:00
Gunnar Beutner e3ad0be769 Apply clang-tidy fix 'modernize-use-auto' 2018-01-04 12:24:57 +01:00
Gunnar Beutner d6062eefbf Apply clang-tidy fix 'modernize-raw-string-literal' 2018-01-04 12:24:57 +01:00
Gunnar Beutner 621eed3f13 Apply clang-tidy fix 'modernize-pass-by-value' 2018-01-04 12:24:57 +01:00
Gunnar Beutner 6da7d48d25 Apply clang-tidy fix 'modernize-loop-convert' 2018-01-04 12:24:57 +01:00
Gunnar Beutner 9ca682496c Apply clang-tidy fix 'modernize-use-override' 2018-01-04 12:24:57 +01:00
Gunnar Beutner ac155d1dda Apply clang-tidy fix 'modernize-redundant-void-arg' 2018-01-04 12:24:57 +01:00
Gunnar Beutner d9020f264f Fix incorrect indentation for code generated by mkclass 2018-01-04 06:06:33 +00:00
Gunnar Beutner 75e2473616 Clean up source lists in the CMakeLists.txt files 2018-01-03 11:47:46 +01:00
Gunnar Beutner fe8572d75b Remove inline methods and use explicit template instantiation to minimize the number of weak symbols 2018-01-03 11:04:58 +01:00
Gunnar Beutner 90496b5456 Build libraries as static libraries 2018-01-02 23:29:48 +01:00
Michael Friedrich 5563665b7d
Merge pull request #5929 from Icinga/feature/remove-boost-assign
Get rid of boost::assign::list_of in mkclass
2018-01-02 13:47:19 +01:00
Michael Insel 158ae2188e Change copyright header for 2018 2018-01-02 12:08:55 +01:00
Gunnar Beutner c6d8483277 Get rid of boost::assign::list_of in mkclass 2018-01-02 08:51:19 +01:00
Jean Flach 2636e6a77a Whitespace fix
What does this change?
* Remove use of spaces for formatting
These could be found by using `grep -r -l -P '^\t+ +[^*]'
* Removal of training whitespaces
* A few lines longer than 120 chars
2017-12-20 14:53:52 +01:00
Gunnar Beutner 1ad83886ac Replace a few more NULLs with nullptr 2017-12-14 15:37:20 +01:00
Gunnar Beutner bd20951acd mkclass: Fix compiler warnings in auto-generated code 2017-12-14 08:50:09 +01:00
Gunnar Beutner 4ab2a21467 Make default getters and setters non-virtual 2017-11-15 11:37:23 +01:00
Gunnar Beutner cc5bc6c872 Make the 'deprecated' keyword work for all field types 2017-10-24 15:54:16 +02:00
Gunnar Beutner f2d437e96c Implement support for migrating certificates to /var/lib/icinga2/certs
This commit includes documentation too.

Signed-off-by: Michael Friedrich <michael.friedrich@icinga.com>
2017-10-20 14:06:02 +02:00
Gunnar Beutner dd9724bc55 Fix compiler warnings on macOS 10.13 2017-10-02 09:13:37 +02:00
Michael Friedrich b7caf0820d Ensure that *.icinga.com is used everywhere
fixes #13897
fixes #13277
2017-01-10 17:19:12 +01:00
Gunnar Beutner 17029e3161 Suppress compiler warnings for auto-generated code
fixes #12635
2016-09-05 06:51:31 +02:00
Gunnar Beutner 45c1e57842 Use range-based for loops in mkclass
refs #12538
refs #12509
2016-08-27 12:17:10 +02:00
Gunnar Beutner dac0ff9343 Improve config validation for arrays of object names
fixes #12556
2016-08-26 10:36:53 +02:00
Gunnar Beutner 288413f046 Replace BOOST_FOREACH with range-based for loops
fixes #12538
2016-08-25 06:46:17 +02:00
Gunnar Beutner 429d11daa8 Fix compiler warnings
fixes #12534
2016-08-24 20:33:34 +02:00
Gunnar Beutner b7a1b58069 Improve performance for type lookups
fixes #12448
2016-08-16 11:02:33 +02:00
Gunnar Beutner 06b5f06494 Change wording for the function validation message
refs #12393
2016-08-12 07:58:24 +02:00
Gunnar Beutner 54bbaf9f7d Implement support for marking functions as deprecated
fixes #12393
2016-08-10 15:48:05 +02:00
Gunnar Beutner 9f425cdcaf Fix building Icinga with -fvisibility=hidden
fixes #12331
2016-08-09 09:00:19 +02:00
Gunnar Beutner b8e911b0e5 Make sure the dependency graph is properly updated when adding and removing objects
fixes #11686
fixes #11374
2016-05-09 14:30:12 +02:00