introduced field_attributes shortcuts and added method on_base() to all processor classes
This commit is contained in:
@@ -28,7 +28,7 @@ public:
|
||||
attribute() = default;
|
||||
attribute(std::string name,
|
||||
utils::basic_type type,
|
||||
const utils::field_attributes &attr = utils::NullAttributes,
|
||||
const utils::field_attributes &attr = NullAttributes,
|
||||
null_option_type null_opt = null_option_type::NotNull);
|
||||
|
||||
[[nodiscard]] const std::string& name() const;
|
||||
@@ -39,9 +39,9 @@ public:
|
||||
[[nodiscard]] bool is_nullable() const;
|
||||
[[nodiscard]] utils::basic_type type() const;
|
||||
[[nodiscard]] std::shared_ptr<object> owner() const;
|
||||
void change_type(utils::basic_type type, const utils::field_attributes &attr = utils::NullAttributes);
|
||||
void change_type(utils::basic_type type, const utils::field_attributes &attr = NullAttributes);
|
||||
template < typename Type >
|
||||
void change_type(const utils::field_attributes &attr = utils::NullAttributes) {
|
||||
void change_type(const utils::field_attributes &attr = NullAttributes) {
|
||||
type_ = utils::data_type_traits<Type>::type(attr.size());
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,8 @@ public:
|
||||
completer.complete_node(node);
|
||||
}
|
||||
|
||||
template<typename BaseType>
|
||||
static void on_base(const BaseType&) {}
|
||||
template<class PrimaryKeyType>
|
||||
static void on_primary_key(const char * /*id*/, PrimaryKeyType &/*pk*/, const utils::primary_key_attribute & /*attr*/) {}
|
||||
static void on_revision(const char * /*id*/, uint64_t &/*rev*/) {}
|
||||
|
||||
@@ -24,6 +24,8 @@ public:
|
||||
|
||||
return join_columns_;
|
||||
}
|
||||
template<typename BaseType>
|
||||
static void on_base(const BaseType&) {}
|
||||
template < class V >
|
||||
static void on_primary_key(const char * /*id*/, V &, const utils::primary_key_attribute& /*attr*/) {}
|
||||
static void on_revision(const char * /*id*/, uint64_t &/*rev*/) {}
|
||||
|
||||
@@ -74,6 +74,8 @@ public:
|
||||
return obj;
|
||||
}
|
||||
|
||||
template<typename BaseType>
|
||||
static void on_base(const BaseType&) {}
|
||||
template < class Type >
|
||||
void on_primary_key(const char *, Type &x, const utils::primary_key_attribute& attr);
|
||||
void on_revision(const char *id, uint64_t &rev);
|
||||
|
||||
@@ -34,6 +34,8 @@ struct pk_field_locator {
|
||||
explicit pk_field_locator (Type &obj)
|
||||
: base(&obj) {}
|
||||
|
||||
template<typename BaseType>
|
||||
static void on_base(const BaseType&) {}
|
||||
template <typename PrimaryKeyType>
|
||||
void on_primary_key(const char *, PrimaryKeyType &pk, const utils::primary_key_attribute & /*attr*/) {
|
||||
// Offset bestimmen
|
||||
|
||||
@@ -43,6 +43,8 @@ public:
|
||||
return resolver.resolve(obj);
|
||||
}
|
||||
|
||||
template<typename BaseType>
|
||||
static void on_base(const BaseType&) {}
|
||||
template < class Type >
|
||||
void on_primary_key(const char *id, Type &pk, const utils::primary_key_attribute& attr) {
|
||||
primary_key_info_.pk_column_name = id;
|
||||
|
||||
@@ -28,6 +28,8 @@ public:
|
||||
return finder.found_;
|
||||
}
|
||||
|
||||
template<typename BaseType>
|
||||
static void on_base(const BaseType&) {}
|
||||
template<class PrimaryKeyType>
|
||||
static void on_primary_key(const char * /*id*/, PrimaryKeyType &/*pk*/, const utils::primary_key_attribute& /*attr*/) {}
|
||||
static void on_revision(const char * /*id*/, uint64_t &/*rev*/) {}
|
||||
@@ -102,6 +104,8 @@ public:
|
||||
completer.complete_node_relations(node);
|
||||
}
|
||||
|
||||
template<typename BaseType>
|
||||
static void on_base(const BaseType&) {}
|
||||
template<class PrimaryKeyType>
|
||||
static void on_primary_key(const char * /*id*/, PrimaryKeyType &/*pk*/, const utils::primary_key_attribute& /*attr*/) {}
|
||||
static void on_revision(const char * /*id*/, uint64_t &/*rev*/) {}
|
||||
|
||||
Reference in New Issue
Block a user