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

👷 Added all pseudofermion actions to the serialiser

This commit is contained in:
Guido Cossu
2017-01-24 13:57:32 +00:00
parent 244f8fb6dc
commit 7f456b4173
10 changed files with 257 additions and 33 deletions

View File

@ -106,15 +106,15 @@ bool JSONReader::push(const string &s)
std::cout << "out of range: " << e.what() << '\n';
return false;
}
cout << "JSONReader::push : " << s << " : "<< jcur_ << endl;
return true;
}
else
{
do_pop.push_back(false);
return true;
}
return true;
}
void JSONReader::pop(void)
@ -134,19 +134,17 @@ bool JSONReader::nextElement(const std::string &s)
{
// JSON dictionaries do not support multiple names
// Same name objects must be packed in vectors
cout << "JSONReader::nextElement(string) : " << s << " : "<< jcur_ << endl;
/*
if (node_.next_sibling(s.c_str()))
{
node_ = node_.next_sibling(s.c_str());
return true;
}
else
{
return false;
}
*/
++it_;
//if (it_ == it_end_){
// return false;
//}
jcur_ = *it_;
//cout << "JSONReader::nextElement(string) : " << s << " : "<< jcur_ << endl;
//return true;
return false;
}
template <>

View File

@ -84,6 +84,8 @@ namespace Grid
std::vector<json> jold_; // previous json object
std::string fileName_;
std::vector<bool> do_pop;
json::iterator it_;
json::iterator it_end_;
};
// Writer template implementation ////////////////////////////////////////////
@ -125,12 +127,7 @@ namespace Grid
template <typename U>
void JSONReader::readDefault(const std::string &s, U &output)
{
//std::string buf;
std::cout << "JSONReader::readDefault(U) : " << s << " : "<< jcur_ << std::endl;
//readDefault(s, output);
//std::cout << s << " " << buf << std::endl;
//fromString(output, buf);
if (s.size()){
std::cout << "String: "<< jcur_[s] << std::endl;
@ -164,6 +161,7 @@ namespace Grid
output.resize(i + 1);
read("", output[i++]);
}
jcur_ = j;
if (s.size())