From 7ae667c76779ba68d158462b1d41889be06c5758 Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Thu, 12 May 2016 18:33:08 +0100 Subject: [PATCH] Hadrons: module template update --- programs/Hadrons/Module.cc.template | 10 ++-------- programs/Hadrons/Module.hpp.template | 17 +++++++---------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/programs/Hadrons/Module.cc.template b/programs/Hadrons/Module.cc.template index f2533d80..1bcf53ca 100644 --- a/programs/Hadrons/Module.cc.template +++ b/programs/Hadrons/Module.cc.template @@ -1,4 +1,4 @@ -#include +#include using namespace Grid; using namespace Hadrons; @@ -8,15 +8,9 @@ using namespace Hadrons; ******************************************************************************/ // constructor ///////////////////////////////////////////////////////////////// ___FILEBASENAME___::___FILEBASENAME___(const std::string name) -: Module(name) +: Module<___FILEBASENAME___Par>(name) {} -// parse parameters //////////////////////////////////////////////////////////// -void ___FILEBASENAME___::parseParameters(XmlReader &reader, const std::string name) -{ - read(reader, name, par_); -} - // dependencies/products /////////////////////////////////////////////////////// std::vector ___FILEBASENAME___::getInput(void) { diff --git a/programs/Hadrons/Module.hpp.template b/programs/Hadrons/Module.hpp.template index 002d93b9..e8e6c4de 100644 --- a/programs/Hadrons/Module.hpp.template +++ b/programs/Hadrons/Module.hpp.template @@ -10,21 +10,20 @@ BEGIN_HADRONS_NAMESPACE /****************************************************************************** * ___FILEBASENAME___ * ******************************************************************************/ -class ___FILEBASENAME___: public Module +class ___FILEBASENAME___Par: Serializable { public: - class Par: Serializable - { - public: - GRID_SERIALIZABLE_CLASS_MEMBERS(Par, unsigned int, i); - }; + GRID_SERIALIZABLE_CLASS_MEMBERS(___FILEBASENAME___Par, + unsigned int, i); +}; + +class ___FILEBASENAME___: public Module<___FILEBASENAME___Par> +{ public: // constructor ___FILEBASENAME___(const std::string name); // destructor virtual ~___FILEBASENAME___(void) = default; - // parse parameters - virtual void parseParameters(XmlReader &reader, const std::string name); // dependency relation virtual std::vector getInput(void); virtual std::vector getOutput(void); @@ -32,8 +31,6 @@ public: virtual void setup(void); // execution virtual void execute(void); -private: - Par par_; }; MODULE_REGISTER(___FILEBASENAME___);