move the process method outside the airplane class to prove extrusive processing functionality.
This commit is contained in:
parent
61796d7c42
commit
34e6d41554
|
|
@ -16,17 +16,19 @@ struct airplane {
|
||||||
unsigned int id{};
|
unsigned int id{};
|
||||||
std::string brand;
|
std::string brand;
|
||||||
std::string model;
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
#endif //QUERY_AIRPLANE_HPP
|
#endif //QUERY_AIRPLANE_HPP
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue