mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-10 07:55:35 +00:00
Compiles after merging
This commit is contained in:
parent
17629b8d9e
commit
f7fbbaaca3
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
Author: Antonin Portelli <antonin.portelli@me.com>
|
Author: Antonin Portelli <antonin.portelli@me.com>
|
||||||
Author: Peter Boyle <paboyle@ph.ed.ac.uk>
|
Author: Peter Boyle <paboyle@ph.ed.ac.uk>
|
||||||
|
Author: Guido Cossu <guido.cossu@ed.ac.uk>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -182,6 +183,16 @@ namespace Grid {
|
|||||||
T *upcast;
|
T *upcast;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// What is the vtype
|
||||||
|
template<typename T> struct isReader {
|
||||||
|
static const bool value = false;
|
||||||
|
};
|
||||||
|
template<typename T> struct isWriter {
|
||||||
|
static const bool value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Generic writer interface
|
// Generic writer interface
|
||||||
// serializable base class
|
// serializable base class
|
||||||
class Serializable
|
class Serializable
|
||||||
@ -326,7 +337,6 @@ namespace Grid {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Generic writer interface //////////////////////////////////////////////////
|
// Generic writer interface //////////////////////////////////////////////////
|
||||||
>>>>>>> develop
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline void push(Writer<T> &w, const std::string &s) {
|
inline void push(Writer<T> &w, const std::string &s) {
|
||||||
w.push(s);
|
w.push(s);
|
||||||
|
@ -68,15 +68,22 @@ void JSONWriter::delete_comma()
|
|||||||
ss_.str(dlast);
|
ss_.str(dlast);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// here we are hitting a g++ bug (Bug 56480)
|
||||||
template<>
|
// compiles fine with clang
|
||||||
void JSONWriter::writeDefault(const std::string &s, const std::string &x){
|
// have to wrap in the Grid namespace
|
||||||
if (s.size())
|
// annoying, but necessary for TravisCI
|
||||||
ss_ << "\""<< s << "\" : \"" << x << "\" ," ;
|
namespace Grid
|
||||||
else
|
{
|
||||||
ss_ << "\"" << x << "\" ," ;
|
template<>
|
||||||
}
|
void JSONWriter::writeDefault(const std::string &s,
|
||||||
|
const std::string &x)
|
||||||
|
{
|
||||||
|
if (s.size())
|
||||||
|
ss_ << "\""<< s << "\" : \"" << x << "\" ," ;
|
||||||
|
else
|
||||||
|
ss_ << "\"" << x << "\" ," ;
|
||||||
|
}
|
||||||
|
}// namespace Grid
|
||||||
|
|
||||||
|
|
||||||
// Reader implementation ///////////////////////////////////////////////////////
|
// Reader implementation ///////////////////////////////////////////////////////
|
||||||
|
@ -87,6 +87,16 @@ namespace Grid
|
|||||||
json::iterator it_;
|
json::iterator it_;
|
||||||
json::iterator it_end_;
|
json::iterator it_end_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct isReader< JSONReader > {
|
||||||
|
static const bool value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct isWriter< JSONWriter > {
|
||||||
|
static const bool value = true;
|
||||||
|
};
|
||||||
|
|
||||||
// Writer template implementation ////////////////////////////////////////////
|
// Writer template implementation ////////////////////////////////////////////
|
||||||
template <typename U>
|
template <typename U>
|
||||||
|
@ -78,7 +78,7 @@ namespace Grid
|
|||||||
pugi::xml_node node_;
|
pugi::xml_node node_;
|
||||||
std::string fileName_;
|
std::string fileName_;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct isReader< XmlReader > {
|
struct isReader< XmlReader > {
|
||||||
static const bool value = true;
|
static const bool value = true;
|
||||||
@ -88,9 +88,7 @@ namespace Grid
|
|||||||
struct isWriter<XmlWriter > {
|
struct isWriter<XmlWriter > {
|
||||||
static const bool value = true;
|
static const bool value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Writer template implementation ////////////////////////////////////////////
|
// Writer template implementation ////////////////////////////////////////////
|
||||||
template <typename U>
|
template <typename U>
|
||||||
void XmlWriter::writeDefault(const std::string &s, const U &x)
|
void XmlWriter::writeDefault(const std::string &s, const U &x)
|
||||||
|
Loading…
Reference in New Issue
Block a user