Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
interaction_def.cpp
Go to the documentation of this file.
2
3namespace bb::avm2::tracegen {
4
6{
8 jobs.reserve(interactions.size());
9 for (const auto& key : std::ranges::views::keys(interactions)) {
10 jobs.push_back(get_job(key));
11 }
12 return jobs;
13}
14
16{
18 jobs.reserve(interactions.size());
19 for (const auto& key : std::ranges::views::keys(interactions)) {
20 jobs.push_back(get_test_job(key));
21 }
22 return jobs;
23}
24
26{
27 return get_job_internal(interaction_name)(/*strict=*/false);
28}
29
31 const std::string& interaction_name) const
32{
33 return get_job_internal(interaction_name)(/*strict=*/true);
34}
35
36const InteractionDefinition::Factory& InteractionDefinition::get_job_internal(const std::string& interaction_name) const
37{
38 auto it = interactions.find(interaction_name);
39 if (it == interactions.end()) {
40 throw std::runtime_error("Interaction not found: " + std::string(interaction_name));
41 }
42 return it->second;
43}
44
45} // namespace bb::avm2::tracegen
std::vector< std::unique_ptr< InteractionBuilderInterface > > get_all_test_jobs() const
const Factory & get_job_internal(const std::string &interaction_name) const
std::unique_ptr< InteractionBuilderInterface > get_job(const std::string &interaction_name) const
std::vector< std::unique_ptr< InteractionBuilderInterface > > get_all_jobs() const
std::unique_ptr< InteractionBuilderInterface > get_test_job() const
std::function< std::unique_ptr< InteractionBuilderInterface >(bool strict)> Factory
std::unordered_map< std::string, Factory > interactions
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13