10 #include "core/baby.hpp" 18 template<
typename BabyType>
19 static std::shared_ptr<Process>
MakeShared(
const std::string &name,
22 const std::set<std::string> &files,
24 return std::shared_ptr<Process>(
new Process(static_cast<BabyType*>(
nullptr),
25 name, type, color, files, cut));
32 std::set<Baby*>
Babies()
const;
37 template<
typename BabyType>
39 const std::string &name,
42 const std::set<std::string> &files,
55 template<
typename BabyType>
57 const std::string &name,
60 const std::set<std::string> &files,
72 std::lock_guard<std::mutex> lock(
mutex_);
73 for(
const auto &file: files){
74 const auto &full_files =
Glob(file);
75 for(
const auto &full_file: full_files){
79 if(
typeid(baby) !=
typeid(BabyType))
continue;
80 const auto &baby_files = baby.FileNames();
81 if(baby_files.find(full_file) != baby_files.end()){
82 baby.processes_.insert(
this);
88 baby_pool_.emplace(static_cast<Baby*>(
new BabyType(std::set<std::string>{full_file},
89 std::set<const Process*>{
this})));
Combines a callable function taking a Baby and returning a scalar or vector with its string represent...
Process & operator=(const Process &)=delete
static std::set< std::unique_ptr< Baby > > baby_pool_
static std::shared_ptr< Process > MakeShared(const std::string &name, Type type, int color, const std::set< std::string > &files, const NamedFunc &cut=true)
std::set< std::string > Glob(const std::string &pattern)
std::set< Baby * > Babies() const