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