fixed compilation and tests
This commit is contained in:
+31
-19
@@ -8,27 +8,39 @@
|
||||
namespace matador::test {
|
||||
|
||||
struct airplane {
|
||||
airplane() = default;
|
||||
airplane(const unsigned int id, std::string b, std::string m)
|
||||
: id(id)
|
||||
, brand(std::move(b))
|
||||
, model(std::move(m)) {}
|
||||
unsigned int id{};
|
||||
std::string brand;
|
||||
std::string model;
|
||||
airplane() = default;
|
||||
airplane(const unsigned int id, std::string b, std::string m)
|
||||
: id(id)
|
||||
, brand(std::move(b))
|
||||
, model(std::move(m)) {}
|
||||
unsigned int id{};
|
||||
std::string brand;
|
||||
std::string model;
|
||||
|
||||
template<class Operator>
|
||||
void process(Operator &op) {
|
||||
namespace field = matador::access;
|
||||
using namespace matador::utils;
|
||||
field::primary_key(op, "id", id);
|
||||
field::attribute(op, "brand", brand, 255);
|
||||
field::attribute(op, "model", model, 255);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace matador::access {
|
||||
template<class Operator>
|
||||
void process(Operator &op, test::airplane &object) {
|
||||
namespace field = matador::access;
|
||||
using namespace matador::utils;
|
||||
field::primary_key(op, "id", object.id);
|
||||
field::attribute(op, "brand", object.brand, 255);
|
||||
field::attribute(op, "model", object.model, 255);
|
||||
}
|
||||
|
||||
}
|
||||
// namespace matador::access {
|
||||
// template<class Operator>
|
||||
// void process(Operator &op, matador::test::airplane &object) {
|
||||
// namespace field = matador::access;
|
||||
// using namespace matador::utils;
|
||||
// field::primary_key(op, "id", object.id);
|
||||
// field::attribute(op, "brand", object.brand, 255);
|
||||
// field::attribute(op, "model", object.model, 255);
|
||||
// }
|
||||
// template<class Operator>
|
||||
// void process(Operator &op, const matador::test::airplane &object) {
|
||||
// process(op, const_cast<matador::test::airplane &>(object));
|
||||
// }
|
||||
// }
|
||||
#endif //QUERY_AIRPLANE_HPP
|
||||
|
||||
Reference in New Issue
Block a user