48 std::unique_lock lock(
mutex_);
60 IndexKey key{ outer_dst_selector, { dst_columns.begin(), dst_columns.end() } };
62 std::unique_lock lock(
mutex_);
67 auto future = it->second;
74 cache_[
key] = promise->get_future().share();
80 promise->set_value(
index);
unordered_flat_map< IndexKey, std::shared_future< std::shared_ptr< DstIndex > > > cache_
const DstIndex & get_or_build(Column outer_dst_selector, std::span< const ColumnAndShifts > dst_columns, const TraceContainer &trace, std::function< DstIndex(const TraceContainer &)> build_fn)
SharedIndexCache()=default
SharedIndexCache & operator=(SharedIndexCache &&)=delete
SharedIndexCache & operator=(const SharedIndexCache &)=delete
SharedIndexCache(SharedIndexCache &&)=delete
SharedIndexCache(const SharedIndexCache &)=delete
unordered_flat_map< size_t, std::vector< uint32_t > > DstIndex
::ankerl::unordered_dense::map< Key, T > unordered_flat_map
size_t hash_as_tuple(const Ts &... ts)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
bool operator==(const IndexKey &) const =default
Column outer_dst_selector
std::vector< ColumnAndShifts > dst_columns