diff --git a/extras/Hadrons/Modules/MContraction/WeakHamiltonian.hpp b/extras/Hadrons/Modules/MContraction/WeakHamiltonian.hpp index f9b0481f..23482feb 100644 --- a/extras/Hadrons/Modules/MContraction/WeakHamiltonian.hpp +++ b/extras/Hadrons/Modules/MContraction/WeakHamiltonian.hpp @@ -79,6 +79,34 @@ public: std::string, output); }; +#define MAKE_WEAK_MODULE(modname)\ +class T##modname: public Module\ +{\ +public:\ + TYPE_ALIASES(FIMPL,)\ + class Result: Serializable\ + {\ + public:\ + GRID_SERIALIZABLE_CLASS_MEMBERS(Result,\ + std::string, name,\ + std::vector, corr);\ + };\ +public:\ + /* constructor */ \ + T##modname(const std::string name);\ + /* destructor */ \ + virtual ~T##modname(void) = default;\ + /* dependency relation */ \ + virtual std::vector getInput(void);\ + virtual std::vector getOutput(void);\ + /* setup */ \ + virtual void setup(void);\ + /* execution */ \ + virtual void execute(void);\ + std::vector VA_label = {"V", "A"};\ +};\ +MODULE_REGISTER_NS(modname, T##modname, MContraction); + END_MODULE_NAMESPACE END_HADRONS_NAMESPACE diff --git a/extras/Hadrons/Modules/MContraction/WeakHamiltonianEye.hpp b/extras/Hadrons/Modules/MContraction/WeakHamiltonianEye.hpp index 2b855ce0..2ee87895 100644 --- a/extras/Hadrons/Modules/MContraction/WeakHamiltonianEye.hpp +++ b/extras/Hadrons/Modules/MContraction/WeakHamiltonianEye.hpp @@ -49,32 +49,7 @@ enum #define MAKE_SE_BODY(Q_1, Q_2, Q_3, gamma) (Q_3*g5*Q_1*adj(Q_2)*g5*gamma) #define MAKE_SE_LOOP(Q_loop, gamma) (Q_loop*gamma) -class TWeakHamiltonianEye: public Module -{ -public: - TYPE_ALIASES(FIMPL,) - class Result: Serializable - { - public: - GRID_SERIALIZABLE_CLASS_MEMBERS(Result, - std::string, name, - std::vector, corr); - }; -public: - // constructor - TWeakHamiltonianEye(const std::string name); - // destructor - virtual ~TWeakHamiltonianEye(void) = default; - // dependency relation - virtual std::vector getInput(void); - virtual std::vector getOutput(void); - // setup - virtual void setup(void); - // execution - virtual void execute(void); -}; - -MODULE_REGISTER_NS(WeakHamiltonianEye, TWeakHamiltonianEye, MContraction); +MAKE_WEAK_MODULE(WeakHamiltonianEye) END_MODULE_NAMESPACE diff --git a/extras/Hadrons/Modules/MContraction/WeakHamiltonianNonEye.hpp b/extras/Hadrons/Modules/MContraction/WeakHamiltonianNonEye.hpp index b7fbdf28..69bb8005 100644 --- a/extras/Hadrons/Modules/MContraction/WeakHamiltonianNonEye.hpp +++ b/extras/Hadrons/Modules/MContraction/WeakHamiltonianNonEye.hpp @@ -48,32 +48,7 @@ enum // Wing and Connected subdiagram contractions #define MAKE_CW_SUBDIAG(Q_1, Q_2, gamma) (Q_1*adj(Q_2)*g5*gamma) -class TWeakHamiltonianNonEye: public Module -{ -public: - TYPE_ALIASES(FIMPL,) - class Result: Serializable - { - public: - GRID_SERIALIZABLE_CLASS_MEMBERS(Result, - std::string, name, - std::vector, corr); - }; -public: - // constructor - TWeakHamiltonianNonEye(const std::string name); - // destructor - virtual ~TWeakHamiltonianNonEye(void) = default; - // dependency relation - virtual std::vector getInput(void); - virtual std::vector getOutput(void); - // setup - virtual void setup(void); - // execution - virtual void execute(void); -}; - -MODULE_REGISTER_NS(WeakHamiltonianNonEye, TWeakHamiltonianNonEye, MContraction); +MAKE_WEAK_MODULE(WeakHamiltonianNonEye) END_MODULE_NAMESPACE diff --git a/extras/Hadrons/Modules/MContraction/WeakNeutral4ptDisc.hpp b/extras/Hadrons/Modules/MContraction/WeakNeutral4ptDisc.hpp index 1c014410..c0d8f829 100644 --- a/extras/Hadrons/Modules/MContraction/WeakNeutral4ptDisc.hpp +++ b/extras/Hadrons/Modules/MContraction/WeakNeutral4ptDisc.hpp @@ -50,32 +50,7 @@ enum #define MAKE_DISC_LOOP(Q_LOOP, gamma) (Q_LOOP*gamma) #define MAKE_DISC_CURR(Q_c, gamma) (trace(Q_c*gamma)) -class TWeakNeutral4ptDisc: public Module -{ -public: - TYPE_ALIASES(FIMPL,) - class Result: Serializable - { - public: - GRID_SERIALIZABLE_CLASS_MEMBERS(Result, - std::string, name, - std::vector, corr); - }; -public: - // constructor - TWeakNeutral4ptDisc(const std::string name); - // destructor - virtual ~TWeakNeutral4ptDisc(void) = default; - // dependency relation - virtual std::vector getInput(void); - virtual std::vector getOutput(void); - // setup - virtual void setup(void); - // execution - virtual void execute(void); -}; - -MODULE_REGISTER_NS(WeakNeutral4ptDisc, TWeakNeutral4ptDisc, MContraction); +MAKE_WEAK_MODULE(WeakNeutral4ptDisc) END_MODULE_NAMESPACE