<commit_before>#pragma once

#include <gloperate/base/collection.hpp>

#include <gloperate/base/make_unique.hpp>

#include <gloperate/pipeline/AbstractPipeline.h>
#include <gloperate/pipeline/AbstractData.h>
#include <gloperate/pipeline/Data.h>


namespace gloperate
{

template<typename... Args>
void AbstractPipeline::addStages(std::unique_ptr<AbstractStage> stage, Args... pipeline)
{
    addStage(std::move(stage));
    addStages(std::forward<Args>(pipeline)...);
}

template <typename T>
Data<T> * AbstractPipeline::addConstantParameter(const T & value)
{
    auto constant = make_unique<Data<T>>(value);

    m_constantParameters.push_back(std::move(constant));

    return constant.get();
}

template <typename T>
Data<T> * AbstractPipeline::getParameter(const std::string & name) const
{
    return dynamic_cast<Data<T> *>(findParameter(name));
}

template <typename T>
Data<T> * AbstractPipeline::getParameter() const
{
    return dynamic_cast<Data<T> *>(collection::detect(m_parameters, [](AbstractData * parameter) { return dynamic_cast<Data<T> *>(parameter) != nullptr; }, nullptr));
}

template <typename T>
Data<T> * AbstractPipeline::getOutput(const std::string & name) const
{
    for (AbstractData * output : findOutputs(name))
    {<commit_msg>Fix usage of unique_ptr<commit_after>#pragma once

#include <gloperate/base/collection.hpp>

#include <gloperate/base/make_unique.hpp>

#include <gloperate/pipeline/AbstractPipeline.h>
#include <gloperate/pipeline/AbstractData.h>
#include <gloperate/pipeline/Data.h>


namespace gloperate
{

template<typename... Args>
void AbstractPipeline::addStages(std::unique_ptr<AbstractStage> stage, Args... pipeline)
{
    addStage(std::move(stage));
    addStages(std::forward<Args>(pipeline)...);
}

template <typename T>
Data<T> * AbstractPipeline::addConstantParameter(const T & value)
{
    auto constant = make_unique<Data<T>>(value);

    auto ptr = constant.get();

    m_constantParameters.push_back(std::move(constant));

    return ptr;
}

template <typename T>
Data<T> * AbstractPipeline::getParameter(const std::string & name) const
{
    return dynamic_cast<Data<T> *>(findParameter(name));
}

template <typename T>
Data<T> * AbstractPipeline::getParameter() const
{
    return dynamic_cast<Data<T> *>(collection::detect(m_parameters, [](AbstractData * parameter) { return dynamic_cast<Data<T> *>(parameter) != nullptr; }, nullptr));
}

template <typename T>
Data<T> * AbstractPipeline::getOutput(const std::string & name) const
{
    for (AbstractData * output : findOutputs(name))
    {
{'fraction_non_alphanumeric': 0.150293542074364, 'fraction_numerical': 0.0, 'mean_word_length': 6.119777158774373, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 51, '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': '2014398', 'n_tokens_mistral': 812, 'n_tokens_neox': 814, 'n_words': 156}