/* Copyright 2015, 2016, Michele Santullo * This file is part of "dindexer". * * "dindexer" is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * "dindexer" is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with "dindexer". If not, see . */ #ifndef id904376BAD85D4782B83CAAEC2EF344D9 #define id904376BAD85D4782B83CAAEC2EF344D9 #include "dindexer-machinery/scantask/leanbase.hpp" #include #include #include #include namespace mchlib { namespace scantask { template class GeneralFiller : public LeanBase { public: using FillingTaskPtr = std::shared_ptr>; template GeneralFiller ( std::shared_ptr

parFill, std::shared_ptr... parFillList ); virtual ~GeneralFiller ( void ) noexcept; private: virtual void on_data_fill ( void ) override; virtual T& on_data_get ( void ) override; std::vector m_to_fill; }; template template GeneralFiller::GeneralFiller (std::shared_ptr

parFill, std::shared_ptr... parFillList) : m_to_fill { std::move(parFill), std::move(parFillList)... } { } template GeneralFiller::~GeneralFiller() noexcept { m_to_fill.clear(); } template void GeneralFiller::on_data_fill() { for (auto& itm : m_to_fill) { itm->get_or_create(); } } template T& GeneralFiller::on_data_get() { assert(not m_to_fill.empty()); return m_to_fill.front()->get_or_create(); } } //namespace scantask } //namespace mchlib #endif