1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-05 11:45:56 +01:00

Hadrons: module template update

This commit is contained in:
Antonin Portelli 2016-05-12 18:33:08 +01:00
parent 07f0b69784
commit 7ae667c767
2 changed files with 9 additions and 18 deletions

View File

@ -1,4 +1,4 @@
#include <Hadrons/Modules/___FILEBASENAME___.hpp>
#include <Hadrons/___FILEBASENAME___.hpp>
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<std::string> ___FILEBASENAME___::getInput(void)
{

View File

@ -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<std::string> getInput(void);
virtual std::vector<std::string> getOutput(void);
@ -32,8 +31,6 @@ public:
virtual void setup(void);
// execution
virtual void execute(void);
private:
Par par_;
};
MODULE_REGISTER(___FILEBASENAME___);