Files
comaps/libs/indexer/feature_processor.hpp
Alexander Borsuk 76ffc99abd New cpp folder structure
Signed-off-by: Alexander Borsuk <me@alex.bio>
2025-08-14 20:52:04 +07:00

32 lines
655 B
C++

#pragma once
#include "indexer/features_vector.hpp"
#include "coding/file_reader.hpp"
#include "coding/files_container.hpp"
#include <memory>
#include <string>
namespace feature
{
template <class ToDo>
void ForEachFeature(FilesContainerR const & cont, ToDo && toDo)
{
FeaturesVectorTest features(cont);
features.GetVector().ForEach(toDo);
}
template <class ToDo>
void ForEachFeature(ModelReaderPtr reader, ToDo && toDo)
{
ForEachFeature(FilesContainerR(reader), toDo);
}
template <class ToDo>
void ForEachFeature(std::string const & fPath, ToDo && toDo)
{
ForEachFeature(std::make_unique<FileReader>(fPath), toDo);
}
} // namespace feature