Commit 12e3f463 authored by Dominik Charousset's avatar Dominik Charousset

Make inspectors easier to use without CAF headers

parent 2abed714
...@@ -49,6 +49,21 @@ public: ...@@ -49,6 +49,21 @@ public:
return std::move(err_); return std::move(err_);
} }
template <class... Ts>
void field_invariant_check_failed(std::string msg) {
emplace_error(sec::field_invariant_check_failed, std::move(msg));
}
template <class... Ts>
void field_value_synchronization_failed(std::string msg) {
emplace_error(sec::field_value_synchronization_failed, std::move(msg));
}
template <class... Ts>
void invalid_field_type(std::string msg) {
emplace_error(sec::invalid_field_type, std::move(msg));
}
// -- DSL types for regular fields ------------------------------------------- // -- DSL types for regular fields -------------------------------------------
template <class T, class U, class Predicate> template <class T, class U, class Predicate>
......
...@@ -33,6 +33,11 @@ public: ...@@ -33,6 +33,11 @@ public:
return super::object_t<Subtype>{invalid_type_id, type_name, dptr()}; return super::object_t<Subtype>{invalid_type_id, type_name, dptr()};
} }
template <class T>
bool begin_object_t() {
return dref().begin_object(type_id_v<T>, caf::type_name_v<T>);
}
template <class T> template <class T>
bool list(T& xs) { bool list(T& xs) {
xs.clear(); xs.clear();
......
...@@ -49,6 +49,21 @@ public: ...@@ -49,6 +49,21 @@ public:
return std::move(err_); return std::move(err_);
} }
template <class... Ts>
void field_invariant_check_failed(std::string msg) {
emplace_error(sec::field_invariant_check_failed, std::move(msg));
}
template <class... Ts>
void field_value_synchronization_failed(std::string msg) {
emplace_error(sec::field_value_synchronization_failed, std::move(msg));
}
template <class... Ts>
void invalid_field_type(std::string msg) {
emplace_error(sec::invalid_field_type, std::move(msg));
}
// -- DSL types for regular fields ------------------------------------------- // -- DSL types for regular fields -------------------------------------------
template <class T, class U> template <class T, class U>
......
...@@ -28,6 +28,11 @@ public: ...@@ -28,6 +28,11 @@ public:
return super::object_t<Subtype>{invalid_type_id, type_name, dptr()}; return super::object_t<Subtype>{invalid_type_id, type_name, dptr()};
} }
template <class T>
bool begin_object_t() {
return dref().begin_object(type_id_v<T>, caf::type_name_v<T>);
}
template <class T> template <class T>
bool list(const T& xs) { bool list(const T& xs) {
using value_type = typename T::value_type; using value_type = typename T::value_type;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment