introduced field_attributes shortcuts and added method on_base() to all processor classes
This commit is contained in:
@@ -21,6 +21,8 @@ public:
|
||||
access::process(*this, obj);
|
||||
}
|
||||
|
||||
template<typename BaseType>
|
||||
static void on_base(const BaseType&) {}
|
||||
template<typename PrimaryKeyType>
|
||||
void on_primary_key(const char * /*id*/, PrimaryKeyType &pk, const primary_key_attribute & = DefaultPkAttributes) {
|
||||
const auto value = pk_.as<PrimaryKeyType>();
|
||||
@@ -51,6 +53,8 @@ private:
|
||||
struct pk_unset_checker {
|
||||
bool unset{true};
|
||||
|
||||
template<typename BaseType>
|
||||
static void on_base(const BaseType&) {}
|
||||
template<class PrimaryKeyType>
|
||||
void on_primary_key(const char * /*id*/, PrimaryKeyType &pk, const primary_key_attribute & = DefaultPkAttributes) {
|
||||
unset = !identifier_type_traits<PrimaryKeyType>::is_valid(pk);
|
||||
@@ -73,6 +77,8 @@ struct pk_unset_checker {
|
||||
struct primary_key_getter {
|
||||
std::uint64_t value{0};
|
||||
|
||||
template<typename BaseType>
|
||||
static void on_base(const BaseType&) {}
|
||||
template<class PrimaryKeyType>
|
||||
void on_primary_key(const char * /*id*/, PrimaryKeyType &pk, const primary_key_attribute & = DefaultPkAttributes) {
|
||||
pk_ = pk;
|
||||
|
||||
Reference in New Issue
Block a user