Skip to content

Commit 6e30e32

Browse files
authored
Merge a47072d into sapling-pr-archive-ktf
2 parents 486a3d3 + a47072d commit 6e30e32

File tree

9 files changed

+1091
-355
lines changed

9 files changed

+1091
-355
lines changed

Framework/Core/include/Framework/ASoA.h

Lines changed: 192 additions & 193 deletions
Large diffs are not rendered by default.

Framework/Core/include/Framework/AnalysisTask.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,11 @@ DataProcessorSpec adaptAnalysisTask(ConfigContext const& ctx, Args&&... args)
574574

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

577+
/// call the task's init() function first as it may manipulate the task's elements
578+
if constexpr (requires { task->init(ic); }) {
579+
task->init(ic);
580+
}
581+
577582
/// update configurables in filters and partitions
578583
homogeneous_apply_refs(
579584
[&ic](auto& element) -> bool { return analysis_task_parsers::updatePlaceholders(ic, element); },
@@ -584,10 +589,6 @@ DataProcessorSpec adaptAnalysisTask(ConfigContext const& ctx, Args&&... args)
584589
},
585590
*task.get());
586591

587-
if constexpr (requires { task->init(ic); }) {
588-
task->init(ic);
589-
}
590-
591592
/// parse process functions to enable requested grouping caches - note that at this state process configurables have their final values
592593
if constexpr (requires { &T::process; }) {
593594
AnalysisDataProcessorBuilder::cacheFromArgs(&T::process, true, bindingsKeys, bindingsKeysUnsorted);

Framework/Core/include/Framework/ExpressionHelpers.h

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,26 @@ struct DatumSpec {
2525
size_t hash = 0;
2626
atype::type type = atype::NA;
2727

28-
explicit DatumSpec(size_t index, atype::type type_) : datum{index}, type{type_} {}
29-
explicit DatumSpec(LiteralNode::var_t literal, atype::type type_) : datum{literal}, type{type_} {}
30-
explicit DatumSpec(std::string binding, size_t hash_, atype::type type_) : datum{binding}, hash{hash_}, type{type_} {}
28+
explicit constexpr DatumSpec(size_t index, atype::type type_) : datum{index}, type{type_} {}
29+
explicit constexpr DatumSpec(LiteralNode::var_t literal, atype::type type_) : datum{literal}, type{type_} {}
30+
explicit constexpr DatumSpec(std::string binding, size_t hash_, atype::type type_) : datum{binding}, hash{hash_}, type{type_} {}
3131
DatumSpec() = default;
3232
DatumSpec(DatumSpec const&) = default;
3333
DatumSpec(DatumSpec&&) = default;
3434
DatumSpec& operator=(DatumSpec const&) = default;
3535
DatumSpec& operator=(DatumSpec&&) = default;
36-
};
3736

38-
bool operator==(DatumSpec const& lhs, DatumSpec const& rhs);
37+
bool operator==(DatumSpec const& rhs) const
38+
{
39+
bool eqValue = this->datum == rhs.datum;
40+
bool eqHash = true;
41+
if (this->datum.index() == 3 && eqValue) {
42+
eqHash = this->hash == rhs.hash;
43+
}
44+
bool eqType = this->type == rhs.type;
45+
return eqValue && eqHash && eqType;
46+
}
47+
};
3948

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

Framework/Core/include/Framework/Expressions.h

Lines changed: 232 additions & 111 deletions
Large diffs are not rendered by default.

Framework/Core/include/Framework/StringHelpers.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ consteval uint32_t crc32(Ts... Vs)
8585
return crc;
8686
}
8787

88+
template <typename... Ts>
89+
requires(std::same_as<Ts, std::string_view> && ...)
90+
consteval uint32_t compile_time_hash(Ts... Vs)
91+
{
92+
return crc32(Vs...) ^ 0xFFFFFFFF;
93+
}
94+
8895
consteval uint32_t compile_time_hash(char const* str)
8996
{
9097
return crc32(str, static_cast<int>(__builtin_strlen(str)) - 1) ^ 0xFFFFFFFF;

0 commit comments

Comments
 (0)