35 lines
759 B
C++
35 lines
759 B
C++
#ifndef QUERY_AIRPLANE_HPP
|
|
#define QUERY_AIRPLANE_HPP
|
|
|
|
#include "matador/utils/access.hpp"
|
|
|
|
#include <string>
|
|
|
|
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;
|
|
};
|
|
|
|
}
|
|
|
|
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
|