implemented specialization of data types via type traits and handling of embedded non-trivial types

This commit is contained in:
2023-12-10 22:40:01 +01:00
parent da423ea8bb
commit 8ad13076c8
17 changed files with 346 additions and 90 deletions
+34
View File
@@ -0,0 +1,34 @@
#ifndef QUERY_LOCATION_HPP
#define QUERY_LOCATION_HPP
#include "matador/utils/access.hpp"
#include "coordinate.hpp"
namespace matador::test {
enum class Color : uint8_t {
Green, Red, Blue, Yellow, Black, White, Brown
};
struct location
{
unsigned long id;
std::string name;
coordinate coord;
Color color;
template < class Operator >
void process(Operator &op)
{
namespace field = matador::utils::access;
field::primary_key(op, "id", id);
field::attribute(op, "name", name, 255);
field::attribute(op, "coordinate", coord);
field::attribute(op, "color", color);
}
};
}
#endif //QUERY_LOCATION_HPP