param: Add contained-params-bitset export interface to the param layers

Allows for efficient looping over the contained data
This commit is contained in:
Thomas Debrunner
2023-05-31 07:45:20 +02:00
committed by Beat Küng
parent bc872822bc
commit f0dd9fa445
7 changed files with 52 additions and 9 deletions
@@ -84,16 +84,17 @@ param_export_internal(param_filter_func filter)
/* Use realloc */
bson_encoder_init_buf(&encoder, nullptr, 0);
auto changed_params = user_config.containedAsBitset();
for (param_t param = 0; param < user_config.PARAM_COUNT; param++) {
int32_t i;
float f;
if (filter && !filter(param)) {
if (!changed_params[param] || (filter && !filter(param))) {
continue;
}
int32_t i;
float f;
/* append the appropriate BSON type object */
switch (param_type(param)) {