45 Commits

Author SHA1 Message Date
Yonas Habteab
398b5e3193 Implement LockIfRequired() method for Namespace, Dictionary & Array 2025-07-10 18:09:21 +02:00
Yonas Habteab
57726fbb66 Do not require olock on frozen Namespace, Dictionary & Array 2025-07-10 18:09:21 +02:00
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
Alexander A. Klimov
8bcae97ecc Introduce Dictionary#GetRef() 2023-12-13 16:02:50 +01:00
Julian Brost
e074e892ce
Merge pull request #9658 from Icinga/unfreeze
Dictionary#*(): remove bool overrideFrozen if unused
2023-02-10 19:42:00 +01:00
Alexander A. Klimov
cd78da13d3 Dictionary#Clear(): remove unused bool overrideFrozen 2023-02-10 11:33:46 +01:00
Alexander A. Klimov
270c6392d4 Dictionary#Remove(): remove unused bool overrideFrozen 2023-02-10 11:33:46 +01:00
Alexander A. Klimov
ca547d0292 Use a shared_mutex for read Dictionary operations
This allows multiple parallel read operations resulting
in a overall speedup on systems with many cores.
2023-02-10 11:31:51 +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
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
Gunnar Beutner
e361b3c427 Implement support for frozen arrays and dictionaries 2018-01-30 12:22:04 +01:00
Gunnar Beutner
c2fb9fe226 Use initializer lists for arrays and dictionaries 2018-01-16 12:27:44 +01:00
Gunnar Beutner
91c256261a Apply clang-tidy fix 'modernize-use-default-member-init' 2018-01-04 12:24:58 +01:00
Gunnar Beutner
621eed3f13 Apply clang-tidy fix 'modernize-pass-by-value' 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
efe99a3e5e Add the final keyword to classes 2018-01-04 05:20:20 +00: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
Jean Flach
f40f366e9e Remove unnecessary inline statements
fixes #5886
2017-12-20 13:22:38 +01:00
Gunnar Beutner
42744fde5b Remove extraneous whitespace 2017-12-14 08:50:09 +01: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
5127a193b4 Avoid unnecessary copies when using Dictionary::Pair in loops
refs #12509
2016-08-30 23:01:54 +02:00
Gunnar Beutner
56ba6089d0 Add rvalue support for the Array and Dictionary classes
refs #12555
2016-08-27 07:42:28 +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
3008d5ef31 Improve performance for field accesses
fixes #11612
2016-04-18 17:05:22 +02:00
Gunnar Beutner
599929b0f6 Update copyright headers for 2016 2016-01-12 08:29:59 +01:00
Gunnar Beutner
dd77863910 Implement Array::ToString and Dictionary::ToString
fixes #10329
2015-10-26 11:05:24 +01: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
91da55872d Avoid unnecessary dictionary lookups
fixes #8922
2015-03-31 11:45:38 +02:00
Gunnar Beutner
43f709c22a Fix complexity class for Dictionary::Get
fixes #8919
2015-03-31 10:39:02 +02:00
Gunnar Beutner
2cbc3142dc Avoid some unnecessary PLT indirections for constructor calls
refs #8890
2015-03-28 16:13:44 +01:00
Gunnar Beutner
37aa3413d8 Allow some of the Array and Dictionary methods to be inlined by the compiler
fixes #8666
2015-03-10 13:46:24 +01:00
Gunnar Beutner
9181d7ae05 Add missing service name in check results
refs #8257
2015-03-05 20:50:27 +01:00
Gunnar Beutner
fb323ee215 Evaluate apply filters in the for loop
fixes #7610
2015-01-29 12:38:25 +01:00
Michael Friedrich
78bfd0204c Update copyright year 2015-01-22 12:00:23 +01:00
Gunnar Beutner
aa38dde1fc Implement prototype functions
fixes #8065
2014-12-12 15:22:37 +01:00
Gunnar Beutner
170c5a59e4 Implement typeof() function 2014-11-03 00:45:14 +01:00
Gunnar Beutner
7559273359 Replace cJSON with YAJL
fixes #7452
2014-10-26 20:00:35 +01:00
Gunnar Beutner
634ef772c3 Build fix for Boost 1.56
fixes #7001
2014-08-25 15:12:39 +02:00
Gunnar Beutner
632026cd9f Rename C++ header files.
Fixes #6291
2014-05-25 16:27:14 +02:00