59 Commits

Author SHA1 Message Date
Julian Brost
0ebcd2662d No longer allow overriding the frozen attribute of containers
The Array, Dictionary, and Namespace types provide a Freeze() method that makes
them read-only. So far, there was the possibility to call some methods with
`overrideFrozen=true` which would then bypass the corresponding check and allow
modification of the data structures nonetheless.

With 24b57f0d3a222835178e88489eabd595755ed883, this possibility was already
removed from the Namespace type. However, for interface compatibility, it kept
the parameter and just ignores it, throwing an exception on any modification on
a frozen instance.

The only place using `overrideFrozen` was processing of the `-D`/`--define`
command line flag that allows setting additional variables in the DSL. At the
time it is evaluated, there are no user-created data structures yet that could
be frozen, so the only frozen objects that could be encountered are Namespaces
(Icinga doesn't freeze other types by itself) and for these, `overrideFrozen`
already has no effect.

Hence, there is no harm in removing `overrideFrozen` altogether. This
simplifies the code and also means that frozen objects are now indeed read-only
without exceptions, allowing further optimizations regarding locking in the
future.
2025-07-08 14:16:20 +02:00
Julian Brost
500ad70b8c Implement std::hash<boost::intrusive_ptr<T>> for old Boost versions
Boost only implements it iself starting from version 1.74, but a specialization
of std::hash<> can be added trivially to allow the use of
std::unordered_set<boost::intrusive_ptr<T>> and
std::unordered_map<boost::intrusive_ptr<K>, V>.

Being unable to use such types already came up a few types in the past, often
resulting in the use of raw pointer instead which always involves an additional
"is this safe?"/"could the object go out of scope?" discussion. This commit
simply solves this for the future by simply allowing the use of intrusive_ptr
in unordered containers.
2025-03-12 11:53:30 +01:00
Alexander A. Klimov
09160ea9eb Make icinga::Empty constant to prevent accidental changes 2024-11-11 16:31:04 +01:00
Alexander A. Klimov
d8c9fdf1d4 Make Object#m_Mutex std::recursive_mutex
refs #7123
2019-04-17 18:26:29 +02:00
Alexander A. Klimov
7e6868bc99 Make Object#m_LockOwner std::atomic<std:🧵:id>
refs #7123
2019-04-17 18:26:23 +02:00
Alexander A. Klimov
cfd0d86b9b Use C++11 atomics for our intrusive pointers 2019-04-02 13:54:30 +02: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
dab53448bc icinga.com: Update *.{h,c}pp 2018-10-18 09:27:04 +02:00
Gunnar Beutner
9d513d8f05 Implement support for modifying frozen attributes 2018-08-13 13:44:31 +02:00
Alexander A. Klimov
02645c59ff ObjectLock#Unlock(): don't reset m_Object->m_LockOwner too early 2018-06-22 14:13:09 +02:00
Jean Flach
a71ab1e126 Rename macro RequireNotNull to REQUIRE_NOT_NULL 2018-02-21 13:47:46 +01:00
Noah Hilverling
6bebdf8a87 Add marco RequireNotNull
This is used to fix a number of possible nullptr dereferences
2018-02-21 13:47:46 +01:00
Gunnar Beutner
94e6be1a65 Remove unused includes 2018-01-22 09:52:29 +01:00
Gunnar Beutner
aa76ddf7f2 Build fix for ancient versions of GCC 2018-01-18 15:12:14 +01:00
Gunnar Beutner
21254fb610 Avoid accessing attributes for validators where not necessary 2018-01-11 08:20:16 +01:00
Gunnar Beutner
f05459b40c Move inline functions to their .cpp files 2018-01-04 12:24:58 +01:00
Gunnar Beutner
91c256261a Apply clang-tidy fix 'modernize-use-default-member-init' 2018-01-04 12:24:58 +01:00
Gunnar Beutner
ac155d1dda Apply clang-tidy fix 'modernize-redundant-void-arg' 2018-01-04 12:24:57 +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 Insel
158ae2188e Change copyright header for 2018 2018-01-02 12:08:55 +01:00
Gunnar Beutner
42744fde5b Remove extraneous whitespace 2017-12-14 08:50:09 +01:00
Gunnar Beutner
df8266631d Replace boost::tuple with std::tuple 2017-11-30 17:41:02 +01:00
Gunnar Beutner
fa874e659b Build fix for I2_LEAK_DEBUG 2017-05-22 11:42:47 +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
7879c09789 Avoid unnecessary dictionary lookups
refs #12555
2016-09-01 07:41:41 +02:00
Gunnar Beutner
22cf939086 Build fix for Windows
refs #11612
2016-04-19 14:48:13 +02:00
Gunnar Beutner
d2cd4b6667 Improve performance for locks and value conversions
refs #11612
2016-04-19 09:38:22 +02:00
Gunnar Beutner
3008d5ef31 Improve performance for field accesses
fixes #11612
2016-04-18 17:05:22 +02:00
Gunnar Beutner
eb0892273e Implement the DateTime class
fixes #9839
2016-03-29 13:27:20 +02:00
Gunnar Beutner
674badd3ce Build fix
fixes #11096
2016-02-09 13:56:17 +01:00
Gunnar Beutner
9e7da9837e Revert "Windows build fix"
This reverts commit f06f6d4d86bf221b83520e61833e272c0b1e694f.
2016-02-09 13:54:19 +01:00
Michael Friedrich
f06f6d4d86 Windows build fix
fixes #11096
2016-02-05 10:55:16 +01:00
Gunnar Beutner
db0c6ef187 Only build leak detection code when I2_LEAK_DEBUG is set
refs #10963
2016-01-19 16:43:46 +01:00
Gunnar Beutner
b1aa6cc98a Decrease memory usage for the Object class
refs #10963
2016-01-19 16:24:07 +01:00
Gunnar Beutner
d50c8e1085 Improve debug support for analyzing memory leaks
refs #10963
2016-01-19 15:24:17 +01:00
Gunnar Beutner
599929b0f6 Update copyright headers for 2016 2016-01-12 08:29:59 +01:00
Gunnar Beutner
e3c75faabc Implement support for recursive object locks
fixes #10596
2015-11-11 10:21:30 +01:00
Gunnar Beutner
1a6b41787a Implement joins for status queries
fixes #10060
2015-09-22 09:45:23 +02:00
Gunnar Beutner
f45f6ccd82 Implement support for tracking dependencies between config objects
refs #9096
2015-08-25 13:54:05 +02:00
Gunnar Beutner
d118b71a2a Fix compiler warnings
fixes #9929
2015-08-18 07:46:04 +02:00
Michael Friedrich
428be72bab Implement Object#clone and rename Array/Dictionary#clone to shallow_clone
fixes #9931
2015-08-17 13:59:49 +02:00
Gunnar Beutner
f405a26052 Implement validation for modified attributes 2015-08-15 20:07:11 +02:00
Michael Friedrich
d7970f5bb1 Implement modified attributes v2
refs #9081
refs #9093
2015-08-15 20:07:10 +02:00
Gunnar Beutner
111b154a6d Remove unused #includes 2015-03-29 00:03:47 +01:00
Gunnar Beutner
4b15ec7774 Remove the macro argument for IMPL_TYPE_LOOKUP
fixes #8599
2015-03-05 07:42:13 +01:00
Michael Friedrich
78bfd0204c Update copyright year 2015-01-22 12:00:23 +01:00
Gunnar Beutner
97168378e8 Rename _DEBUG to I2_DEBUG
fixes #7767
2014-12-19 12:19:28 +01:00
Gunnar Beutner
aa38dde1fc Implement prototype functions
fixes #8065
2014-12-12 15:22:37 +01:00
Gunnar Beutner
cf2b6e7ccc Improve output of ToString for type objects
fixes #8020
2014-12-08 09:12:40 +01:00