1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-12 20:27:06 +01:00

All functionalities ready.

Todo: add all the fermion action modules
This commit is contained in:
Guido Cossu
2017-01-20 12:56:20 +00:00
parent 851f2ad8ef
commit f96fac0aee
18 changed files with 504 additions and 64 deletions

View File

@ -105,7 +105,7 @@ namespace Grid {
public:
Reader(void);
virtual ~Reader(void) = default;
void push(const std::string &s);
bool push(const std::string &s);
void pop(void);
template <typename U>
typename std::enable_if<std::is_base_of<Serializable, U>::value, void>::type
@ -160,15 +160,15 @@ namespace Grid {
// Generic reader interface
template <typename T>
inline void push(Reader<T> &r, const std::string &s)
inline bool push(Reader<T> &r, const std::string &s)
{
r.push(s);
return r.push(s);
}
template <typename T>
inline void push(Reader<T> &r, const char *s)
inline bool push(Reader<T> &r, const char *s)
{
r.push(std::string(s));
return r.push(std::string(s));
}
template <typename T>
@ -236,9 +236,9 @@ namespace Grid {
}
template <typename T>
void Reader<T>::push(const std::string &s)
bool Reader<T>::push(const std::string &s)
{
upcast->push(s);
return upcast->push(s);
}
template <typename T>

View File

@ -60,7 +60,7 @@ namespace Grid {
public:
BinaryReader(const std::string &fileName);
virtual ~BinaryReader(void) = default;
void push(const std::string &s) {};
bool push(const std::string &s) {return true;}
void pop(void) {};
template <typename U>
void readDefault(const std::string &s, U &output);

View File

@ -68,9 +68,10 @@ TextReader::TextReader(const string &fileName)
}
}
void TextReader::push(const string &s)
bool TextReader::push(const string &s)
{
level_++;
return true;
};
void TextReader::pop(void)

View File

@ -63,7 +63,7 @@ namespace Grid
public:
TextReader(const std::string &fileName);
virtual ~TextReader(void) = default;
void push(const std::string &s);
bool push(const std::string &s);
void pop(void);
template <typename U>
void readDefault(const std::string &s, U &output);

View File

@ -70,10 +70,13 @@ XmlReader::XmlReader(const string &fileName)
node_ = doc_.child("grid");
}
void XmlReader::push(const string &s)
bool XmlReader::push(const string &s)
{
node_ = node_.child(s.c_str());
// add error check
if (node_ == NULL)
return false;
return true;
}
void XmlReader::pop(void)

View File

@ -66,7 +66,7 @@ namespace Grid
public:
XmlReader(const std::string &fileName);
virtual ~XmlReader(void) = default;
void push(const std::string &s);
bool push(const std::string &s);
void pop(void);
bool nextElement(const std::string &s);
template <typename U>