13 #if !defined(KRATOS_REGISTERED_COMPONENT_LOOKUP_H_INCLUDED)
14 #define KRATOS_REGISTERED_COMPONENT_LOOKUP_H_INCLUDED
48 template <
typename ...TVariables>
51 template <
template<
typename T>
class TFunctor,
typename ...Targs>
54 template <
typename TVariable>
55 void Execute(std::string
const& rName,
bool& found, Targs&...
args)
60 TFunctor<TVariable>()(rVariable,
args...);
70 template <
template<
typename T>
class TFunctor,
typename ...Targs>
74 int dummy[
sizeof...(TVariables)] = {(FunctorWrapper<TFunctor, Targs...>().
template Execute<TVariables>(mName, found,
args...), 0)...};
75 ignore_unused_variable_warning(
dummy);
76 KRATOS_ERROR_IF(!found) <<
"Variable \"" << mName <<
"\" was not found.\n";
82 void ignore_unused_variable_warning(
int[]) {}
KratosComponents class encapsulates a lookup table for a family of classes in a generic way.
Definition: kratos_components.h:49
static const TComponentType & Get(const std::string &rName)
Retrieves a component with the specified name.
Definition: kratos_components.h:114
A class for calling a functor on a variable specified by it's registered name.
Definition: registered_component_lookup.h:50
RegisteredComponentLookup(std::string const &rName)
Definition: registered_component_lookup.h:67
void Execute(Targs &... args)
Definition: registered_component_lookup.h:71
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
args
Definition: generate_gid_list_file.py:37
dummy
Definition: script.py:194