1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-09-20 09:15:38 +01:00

Hadrons: namespace reorganisation, now everything is in Grid::Hadrons, the 'using Grid::operator<<' statement is used to prevent a very nasty compilation error with GCC.

This commit is contained in:
Antonin Portelli 2016-05-02 19:31:21 -07:00
parent 48fcc34d72
commit 6e83b6a203
13 changed files with 26 additions and 9 deletions

View File

@ -29,6 +29,7 @@ directory.
#include <Hadrons/Environment.hpp> #include <Hadrons/Environment.hpp>
using namespace Grid; using namespace Grid;
using namespace QCD;
using namespace Hadrons; using namespace Hadrons;
/****************************************************************************** /******************************************************************************

View File

@ -29,6 +29,7 @@ directory.
#include <Hadrons/Graph.hpp> #include <Hadrons/Graph.hpp>
using namespace Grid; using namespace Grid;
using namespace QCD;
using namespace Hadrons; using namespace Hadrons;
/****************************************************************************** /******************************************************************************

View File

@ -28,6 +28,7 @@ directory.
#include <Hadrons/CMeson.hpp> #include <Hadrons/CMeson.hpp>
using namespace Grid; using namespace Grid;
using namespace QCD;
using namespace Hadrons; using namespace Hadrons;
/****************************************************************************** /******************************************************************************

View File

@ -47,7 +47,7 @@ public:
virtual ~Factory(void) = default; virtual ~Factory(void) = default;
// registration // registration
void registerBuilder(const std::string type, const Func &f); void registerBuilder(const std::string type, const Func &f);
// get module list // get builder list
std::vector<std::string> getBuilderList(void) const; std::vector<std::string> getBuilderList(void) const;
// factory // factory
std::unique_ptr<T> create(const std::string type, std::unique_ptr<T> create(const std::string type,
@ -91,7 +91,7 @@ std::unique_ptr<T> Factory<T>::create(const std::string type,
{ {
func = builder_.at(type); func = builder_.at(type);
} }
catch (std::out_of_range) catch (std::out_of_range &)
{ {
HADRON_ERROR("object of type '" + type + "' unknown"); HADRON_ERROR("object of type '" + type + "' unknown");
} }

View File

@ -28,6 +28,7 @@ directory.
#include <Hadrons/FermionAction.hpp> #include <Hadrons/FermionAction.hpp>
using namespace Grid; using namespace Grid;
using namespace QCD;
using namespace Hadrons; using namespace Hadrons;
/****************************************************************************** /******************************************************************************

View File

@ -28,6 +28,7 @@ directory.
#include <Hadrons/Global.hpp> #include <Hadrons/Global.hpp>
using namespace Grid; using namespace Grid;
using namespace QCD;
using namespace Hadrons; using namespace Hadrons;
HadronsLogger Hadrons::HadronsLogError(1,"Error"); HadronsLogger Hadrons::HadronsLogError(1,"Error");

View File

@ -28,15 +28,20 @@ directory.
#ifndef Hadrons_Global_hpp_ #ifndef Hadrons_Global_hpp_
#define Hadrons_Global_hpp_ #define Hadrons_Global_hpp_
#include <Grid.h>
#include <set> #include <set>
#include <stack> #include <stack>
#include <Grid.h>
#define BEGIN_HADRONS_NAMESPACE \ #define BEGIN_HADRONS_NAMESPACE \
namespace Grid {\
using namespace QCD;\
namespace Hadrons {\ namespace Hadrons {\
using namespace Grid;\ using Grid::operator<<;
using namespace QCD; #define END_HADRONS_NAMESPACE }}
#define END_HADRONS_NAMESPACE }
/* the 'using Grid::operator<<;' statement prevents a very nasty compilation
* error with GCC (clang compiles fine without it).
*/
BEGIN_HADRONS_NAMESPACE BEGIN_HADRONS_NAMESPACE

View File

@ -27,6 +27,8 @@ directory.
#include <Hadrons/Application.hpp> #include <Hadrons/Application.hpp>
using namespace Grid;
using namespace QCD;
using namespace Hadrons; using namespace Hadrons;
int main(int argc, char *argv[]) int main(int argc, char *argv[])

View File

@ -28,6 +28,7 @@ directory.
#include <Hadrons/MQuark.hpp> #include <Hadrons/MQuark.hpp>
using namespace Grid; using namespace Grid;
using namespace QCD;
using namespace Hadrons; using namespace Hadrons;
/****************************************************************************** /******************************************************************************

View File

@ -28,7 +28,9 @@ directory.
#include <Hadrons/MSource.hpp> #include <Hadrons/MSource.hpp>
#define ERROR_SUF " (source '" << getName() << "')" #define ERROR_SUF " (source '" << getName() << "')"
using namespace Grid; using namespace Grid;
using namespace QCD;
using namespace Hadrons; using namespace Hadrons;
/****************************************************************************** /******************************************************************************

View File

@ -28,6 +28,7 @@ directory.
#include <Hadrons/Module.hpp> #include <Hadrons/Module.hpp>
using namespace Grid; using namespace Grid;
using namespace QCD;
using namespace Hadrons; using namespace Hadrons;
/****************************************************************************** /******************************************************************************

View File

@ -28,6 +28,7 @@ directory.
#include <Hadrons/SRBPrecCG.hpp> #include <Hadrons/SRBPrecCG.hpp>
using namespace Grid; using namespace Grid;
using namespace QCD;
using namespace Hadrons; using namespace Hadrons;
/****************************************************************************** /******************************************************************************