Julian Brost
fbb68dbcd0
Namespace: replace behavior classes with a bool
...
In essence, namespace behaviors acted as hooks for update operations on
namespaces. Two behaviors were implemented:
- `NamespaceBehavior`: allows the update operation unless it acts on a value
that itself was explicitly marked as constant.
- `ConstNamespaceBehavior`: initially allows insert operations but marks the
individual values as const. Additionally provides a `Freeze()` member
function. After this was called, updates are rejected unless a special
`overrideFrozen` flag is set explicitly.
This marvel of object-oriented programming can be replaced with a simple bool.
This commit basically replaces `Namespace::m_Behavior` with
`Namespace::m_ConstValues` and inlines the behavior functions where they were
called. While doing so, the code was slightly simplified by assuming that
`m_ConstValues` is true if `m_Frozen` is true. This is similar to what the API
allowed in the old code as you could only freeze a `ConstNamespaceBehavior`.
However, this PR moves the `Freeze()` member function and the related
`m_Freeze` member variable to the `Namespace` class. So now the API allows any
namespace to be frozen. The new code also makes sense with the previously
mentioned simplification: a `Namespace` with `m_ConstValues = false` can be
modified without restrictions until `Freeze()` is called. When this is done, it
becomes read-only.
The changes outside of `namespace.*` just adapt the code to the slightly
changed API.
2022-12-09 09:25:46 +01:00
..
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2021-06-29 17:52:25 +02:00
2020-02-11 17:26:15 +01:00
2019-02-25 14:48:22 +01:00
2021-03-10 16:29:40 +01:00
2019-07-12 14:36:55 +02:00
2019-07-12 14:36:55 +02:00
2022-07-28 18:00:37 +02:00
2022-07-28 18:00:37 +02:00
2022-05-03 12:02:46 +02:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2022-03-02 16:39:37 +01:00
2022-07-28 18:00:37 +02:00
2019-02-25 14:48:22 +01:00
2022-11-30 11:06:51 +01:00
2019-08-13 15:05:47 +02:00
2022-09-12 17:22:57 +02:00
2021-02-03 09:54:57 +01:00
2021-02-03 09:54:57 +01:00
2021-08-06 12:19:08 +02:00
2019-04-16 15:04:57 +02:00
2019-04-16 15:04:57 +02:00
2021-02-03 09:54:57 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2022-11-30 11:06:45 +01:00
2022-11-30 11:06:45 +01:00
2021-04-27 17:31:50 +02:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2022-03-30 09:42:22 +02:00
2021-02-03 09:54:57 +01:00
2021-02-03 09:54:57 +01:00
2019-02-25 14:48:22 +01:00
2021-11-12 13:34:57 +01:00
2019-02-25 14:48:22 +01:00
2022-07-28 17:00:57 +02:00
2022-07-28 17:00:57 +02:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2021-03-10 16:29:40 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-10-21 17:10:51 +02:00
2019-02-25 14:48:22 +01:00
2021-03-10 16:29:40 +01:00
2021-03-10 16:29:40 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2022-03-02 16:39:44 +01:00
2022-03-02 16:39:44 +01:00
2021-09-23 16:08:11 +02:00
2021-09-23 16:08:11 +02:00
2021-09-23 16:08:11 +02:00
2022-12-09 09:25:46 +01:00
2021-04-30 15:49:52 +02:00
2019-02-25 14:48:22 +01:00
2019-05-24 16:25:32 +02:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2022-10-11 13:28:08 +02:00
2022-10-11 13:28:08 +02:00
2022-10-11 13:28:08 +02:00
2022-12-09 09:25:46 +01:00
2019-02-25 14:48:22 +01:00
2022-12-09 09:25:46 +01:00
2022-12-09 09:25:46 +01:00
2022-02-22 17:51:43 +01:00
2019-10-21 16:12:35 +02:00
2019-02-25 14:48:22 +01:00
2019-05-29 14:17:36 +02:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2021-03-23 13:13:47 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2021-03-18 17:56:13 +01:00
2019-04-17 18:26:29 +02:00
2019-04-17 18:26:29 +02:00
2022-12-08 15:48:01 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2022-02-22 17:51:43 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2021-07-27 17:57:19 +02:00
2021-01-14 12:00:11 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2021-02-03 09:54:57 +01:00
2021-02-03 09:54:57 +01:00
2021-02-03 09:54:57 +01:00
2022-12-09 09:25:46 +01:00
2019-02-25 14:48:22 +01:00
2019-10-21 17:10:51 +02:00
2019-02-25 14:48:22 +01:00
2021-03-10 16:29:40 +01:00
2019-11-08 11:13:26 +01:00
2022-11-30 10:45:50 +01:00
2022-11-30 10:45:50 +01:00
2020-12-25 23:27:08 +01:00
2020-12-25 23:27:08 +01:00
2021-02-03 09:54:57 +01:00
2021-02-03 09:54:57 +01:00
2021-02-03 09:54:57 +01:00
2021-03-01 14:07:11 +01:00
2021-03-01 14:07:11 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2021-03-25 11:30:02 +01:00
2021-03-18 17:56:13 +01:00
2021-02-03 09:54:57 +01:00
2021-03-18 17:56:13 +01:00
2021-02-03 09:54:57 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2022-10-21 10:28:41 +02:00
2022-10-21 10:28:41 +02:00
2021-09-15 10:15:22 +02:00
2021-09-15 10:15:22 +02:00
2019-02-25 14:48:22 +01:00
2019-02-26 11:25:44 +01:00
2019-09-09 15:27:57 +02:00
2019-08-14 17:12:59 +02:00
2019-08-14 17:12:59 +02:00
2021-02-03 09:54:57 +01:00
2019-04-24 11:42:54 +02:00
2021-08-13 10:58:10 +02:00
2020-07-29 15:02:48 +02:00
2022-04-11 15:29:05 +02:00
2022-04-11 11:02:39 +02:00
2022-11-21 15:07:39 +01:00
2022-11-21 15:07:39 +01:00
2021-03-10 16:29:40 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-05-29 14:17:36 +02:00
2022-09-09 10:50:42 +02:00
2022-07-28 18:00:37 +02:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2021-06-21 15:15:54 +02:00
2021-06-21 15:15:54 +02:00
2021-06-21 15:15:54 +02:00
2021-06-21 15:15:54 +02:00
2021-03-18 17:56:13 +01:00
2021-07-26 11:40:43 +02:00