Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
385 changes: 192 additions & 193 deletions Framework/Core/include/Framework/ASoA.h

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions Framework/Core/include/Framework/AnalysisTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,11 @@ DataProcessorSpec adaptAnalysisTask(ConfigContext const& ctx, Args&&... args)

callbacks.set<CallbackService::Id::EndOfStream>(eoscb);

/// call the task's init() function first as it may manipulate the task's elements
if constexpr (requires { task->init(ic); }) {
task->init(ic);
}

/// update configurables in filters and partitions
homogeneous_apply_refs(
[&ic](auto& element) -> bool { return analysis_task_parsers::updatePlaceholders(ic, element); },
Expand All @@ -584,10 +589,6 @@ DataProcessorSpec adaptAnalysisTask(ConfigContext const& ctx, Args&&... args)
},
*task.get());

if constexpr (requires { task->init(ic); }) {
task->init(ic);
}

/// parse process functions to enable requested grouping caches - note that at this state process configurables have their final values
if constexpr (requires { &T::process; }) {
AnalysisDataProcessorBuilder::cacheFromArgs(&T::process, true, bindingsKeys, bindingsKeysUnsorted);
Expand Down
19 changes: 14 additions & 5 deletions Framework/Core/include/Framework/ExpressionHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,26 @@ struct DatumSpec {
size_t hash = 0;
atype::type type = atype::NA;

explicit DatumSpec(size_t index, atype::type type_) : datum{index}, type{type_} {}
explicit DatumSpec(LiteralNode::var_t literal, atype::type type_) : datum{literal}, type{type_} {}
explicit DatumSpec(std::string binding, size_t hash_, atype::type type_) : datum{binding}, hash{hash_}, type{type_} {}
explicit constexpr DatumSpec(size_t index, atype::type type_) : datum{index}, type{type_} {}
explicit constexpr DatumSpec(LiteralNode::var_t literal, atype::type type_) : datum{literal}, type{type_} {}
explicit constexpr DatumSpec(std::string binding, size_t hash_, atype::type type_) : datum{binding}, hash{hash_}, type{type_} {}
DatumSpec() = default;
DatumSpec(DatumSpec const&) = default;
DatumSpec(DatumSpec&&) = default;
DatumSpec& operator=(DatumSpec const&) = default;
DatumSpec& operator=(DatumSpec&&) = default;
};

bool operator==(DatumSpec const& lhs, DatumSpec const& rhs);
bool operator==(DatumSpec const& rhs) const
{
bool eqValue = this->datum == rhs.datum;
bool eqHash = true;
if (this->datum.index() == 3 && eqValue) {
eqHash = this->hash == rhs.hash;
}
bool eqType = this->type == rhs.type;
return eqValue && eqHash && eqType;
}
};

std::ostream& operator<<(std::ostream& os, DatumSpec const& spec);

Expand Down
343 changes: 232 additions & 111 deletions Framework/Core/include/Framework/Expressions.h

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions Framework/Core/include/Framework/StringHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ consteval uint32_t crc32(Ts... Vs)
return crc;
}

template <typename... Ts>
requires(std::same_as<Ts, std::string_view> && ...)
consteval uint32_t compile_time_hash(Ts... Vs)
{
return crc32(Vs...) ^ 0xFFFFFFFF;
}

consteval uint32_t compile_time_hash(char const* str)
{
return crc32(str, static_cast<int>(__builtin_strlen(str)) - 1) ^ 0xFFFFFFFF;
Expand Down
Loading