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

Hadrons: module parameters can now be accessed from outside

This commit is contained in:
2016-05-12 11:59:28 +01:00
parent 3d78ed03ef
commit 362f255100
24 changed files with 216 additions and 209 deletions

View File

@ -67,9 +67,8 @@ namespace Grid {
return os;
}
class Serializable {};
// static polymorphism implemented using CRTP idiom
class Serializable;
// Static abstract writer
template <typename T>
@ -122,6 +121,27 @@ namespace Grid {
T *upcast;
};
// serializable base class
class Serializable
{
public:
template <typename T>
static inline void write(Writer<T> &WR,const std::string &s,
const Serializable &obj)
{}
template <typename T>
static inline void read(Reader<T> &RD,const std::string &s,
Serializable &obj)
{}
friend inline std::ostream & operator<<(std::ostream &os,
const Serializable &obj)
{
return os;
}
};
// Generic writer interface
template <typename T>
inline void push(Writer<T> &w, const std::string &s)