mirror of
https://github.com/paboyle/Grid.git
synced 2025-08-02 12:47:07 +01:00
Added support for input file HMC modules (missing the actions yet)
This commit is contained in:
@@ -50,6 +50,7 @@ public:
|
||||
const ProductCreator& name) const;
|
||||
private:
|
||||
std::map<std::string, Func> builder_;
|
||||
virtual std::string obj_type() const = 0;
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
@@ -79,20 +80,24 @@ std::vector<std::string> Factory<T, ProductCreator>::getBuilderList(void) const
|
||||
// factory /////////////////////////////////////////////////////////////////////
|
||||
template <typename T, typename ProductCreator>
|
||||
std::unique_ptr<T> Factory<T, ProductCreator>::create(const std::string type,
|
||||
const ProductCreator& name) const
|
||||
const ProductCreator& input) const
|
||||
{
|
||||
Func func;
|
||||
|
||||
std::cout << GridLogDebug << "Creating object of type "<< type << std::endl;
|
||||
try
|
||||
{
|
||||
func = builder_.at(type);
|
||||
}
|
||||
catch (std::out_of_range &)
|
||||
{
|
||||
//HADRON_ERROR("object of type '" + type + "' unknown");
|
||||
//HADRON_ERROR("object of type '" + type + "' unknown");
|
||||
std::cout << GridLogError << "Error" << std::endl;
|
||||
std::cout << GridLogError << obj_type() << " object of name [" << type << "] unknown" << std::endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
return func(name);
|
||||
return func(input);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user