<commit_before>/** @file Defines the class @c TaskQueueThreadPool.
 * @author <NAME>
 */

#pragma once

#include "functors.hpp"
#include "task_queue_thread.hpp"

namespace cu
{

/// A task dispatching thread pool class.
///
/// This is like @c TaskQueueThread, but the tasks may be dispatched by
/// multiple threads concurrently.
///
/// @note The @c WorkerData will be assigned to each thread in the thread pool
/// making the data thread-local in effect (as long as the types aren't
/// references).
template <typename ...WorkerData>
class TaskQueueThreadPool
{
private:
  TaskQueueWithArgs<WorkerData&...> queue;
  std::atomic<bool> done{false};
  std::vector<
    std::unique_ptr<
      GenericTaskQueueThread<
        true,
        WorkerData...>>> workers;
<commit_msg>Fix: Added missing include to header file.<commit_after>/** @file Defines the class @c TaskQueueThreadPool.
 * @author <NAME>
 */

#pragma once

#include "functors.hpp"
#include "task_queue_thread.hpp"

#include <vector>

namespace cu
{

/// A task dispatching thread pool class.
///
/// This is like @c TaskQueueThread, but the tasks may be dispatched by
/// multiple threads concurrently.
///
/// @note The @c WorkerData will be assigned to each thread in the thread pool
/// making the data thread-local in effect (as long as the types aren't
/// references).
template <typename ...WorkerData>
class TaskQueueThreadPool
{
private:
  TaskQueueWithArgs<WorkerData&...> queue;
  std::atomic<bool> done{false};
  std::vector<
    std::unique_ptr<
      GenericTaskQueueThread<
        true,
        WorkerData...>>> workers;

{'fraction_non_alphanumeric': 0.123125, 'fraction_numerical': 0.0, 'mean_word_length': 3.484593837535014, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7290122', 'n_tokens_mistral': 476, 'n_tokens_neox': 462, 'n_words': 170}