CHROMA
enum_coeffs_io.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Coeffs enum
4  */
5 
6 #include "enum_coeffs_io.h"
7 
8 #include <string>
9 
10 namespace Chroma {
11 
12  namespace CoeffTypeEnv {
13 
14  bool registerAll(void)
15  {
16  bool success = true;
17  success &= theCoeffTypeMap::Instance().registerPair(std::string("ZOLOTAREV"), COEFF_TYPE_ZOLOTAREV );
18  success &= theCoeffTypeMap::Instance().registerPair(std::string("TANH"), COEFF_TYPE_TANH);
19  success &= theCoeffTypeMap::Instance().registerPair(std::string("TANH_UNSCALED"), COEFF_TYPE_TANH_UNSCALED);
20  return success;
21  }
22 
24  const std::string typeIDString = "CoeffType";
25  }
26  using namespace CoeffTypeEnv;
27 
28  //! read an approximation coefficient type enum
29  void read(XMLReader& xml_in, const std::string& path, CoeffType& t) {
30  theCoeffTypeMap::Instance().read(typeIDString, xml_in, path,t);
31  }
32 
33  //! write an approximation coefficient type enum
34  void write(XMLWriter& xml_out, const std::string& path, const CoeffType& t) {
35  theCoeffTypeMap::Instance().write(typeIDString, xml_out, path, t);
36  }
37 }
static T & Instance()
Definition: singleton.h:432
Coeffs enum.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
CoeffType
Coeffs type.
@ COEFF_TYPE_ZOLOTAREV
@ COEFF_TYPE_TANH
@ COEFF_TYPE_TANH_UNSCALED
int t
Definition: meslate.cc:37
const std::string typeIDString
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
::std::string string
Definition: gtest.h:1979