Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
interaction_builder.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <vector>
4
5
#include "
barretenberg/vm2/tracegen/trace_container.hpp
"
6
7
namespace
bb::avm2::tracegen
{
8
9
class
InteractionBuilderInterface
{
10
public
:
11
virtual
~InteractionBuilderInterface
() =
default
;
12
virtual
void
process
(
TraceContainer
&
trace
) = 0;
13
};
14
15
// A concatenate that works with movable objects.
16
template
<
typename
T>
std::vector<T>
concatenate_jobs
(
std::vector<T>
&& first,
auto
&&... rest)
17
{
18
std::vector<T>
result =
std::move
(first);
19
result.reserve(first.size() + (rest.size() + ...));
20
(
std::move
(rest.begin(), rest.end(),
std::back_inserter
(result)), ...);
21
return
result;
22
}
23
24
}
// namespace bb::avm2::tracegen
25
26
// Define a hash function for std::array so that it can be used as a key in a std::unordered_map.
27
template
<
typename
T,
size_t
SIZE>
struct
std::hash<
std
::array<T, SIZE>> {
28
inline
std::size_t
operator()
(
const
std::array<T, SIZE>
& arr)
const
noexcept
29
{
30
return
[&arr]<
size_t
... Is>(
std::index_sequence
<Is...>) {
31
return
bb::utils::hash_as_tuple
(arr[Is]...);
32
}(
std::make_index_sequence<SIZE>
{});
33
}
34
};
bb::avm2::tracegen::InteractionBuilderInterface
Definition
interaction_builder.hpp:9
bb::avm2::tracegen::InteractionBuilderInterface::~InteractionBuilderInterface
virtual ~InteractionBuilderInterface()=default
bb::avm2::tracegen::InteractionBuilderInterface::process
virtual void process(TraceContainer &trace)=0
bb::avm2::tracegen::TraceContainer
Definition
trace_container.hpp:22
trace
TestTraceContainer trace
Definition
data_copy.test.cpp:62
bb::avm2::tracegen
Definition
full_row.hpp:9
bb::avm2::tracegen::concatenate_jobs
std::vector< T > concatenate_jobs(std::vector< T > &&first, auto &&... rest)
Definition
interaction_builder.hpp:16
bb::utils::hash_as_tuple
size_t hash_as_tuple(const Ts &... ts)
Definition
utils.hpp:22
std
STL namespace.
std::get
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition
tuple.hpp:13
std::hash< std::array< T, SIZE > >::operator()
std::size_t operator()(const std::array< T, SIZE > &arr) const noexcept
Definition
interaction_builder.hpp:28
trace_container.hpp
src
barretenberg
vm2
tracegen
lib
interaction_builder.hpp
Generated by
1.9.8