5namespace wmtk::threading {
15 std::vector<T> m_slots;
16 std::vector<char> m_filled;
35 void set(std::size_t i,
const T& v)
50 out.reserve(m_slots.size());
51 for (std::size_t i = 0; i < m_slots.size(); ++i) {
53 out.push_back(m_slots[i]);
Definition indexed_collector.hpp:14
indexed_collector(std::size_t n)
Construct an indexed_collector with n slots.
Definition indexed_collector.hpp:23
std::vector< T > compact() const
Get a compacted vector of all filled slots. This function is not thread-safe and should only be calle...
Definition indexed_collector.hpp:47
void set(std::size_t i, const T &v)
Set the value at index i to v. This function can be called concurrently as long as callers pass disti...
Definition indexed_collector.hpp:35