1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-16 23:07:05 +01:00

Adding factories

This commit is contained in:
Guido Cossu
2017-01-16 10:18:09 +00:00
parent 0dfda4bb90
commit c6f59c2933
15 changed files with 583 additions and 171 deletions

View File

@ -69,6 +69,9 @@ namespace Grid {
class Serializable {};
// static polymorphism implemented using CRTP idiom
// Static abstract writer
@ -121,11 +124,19 @@ namespace Grid {
private:
T *upcast;
};
// type traits
// 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
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);
}