diff --git a/build-config/glaze/meson.build b/build-config/glaze/meson.build deleted file mode 100644 index 789314a..0000000 --- a/build-config/glaze/meson.build +++ /dev/null @@ -1,17 +0,0 @@ -glaze_cmake_options = cmake.subproject_options() - -glaze_cmake_options.add_cmake_defines({ - 'BUILD_SHARED_LIBS': 'OFF', - 'BUILD_STATIC_LIBS': 'ON', - 'CMAKE_INSTALL_LIBDIR': get_option('libdir'), - 'CMAKE_INSTALL_INCLUDEDIR': get_option('includedir'), - 'CMAKE_POSITION_INDEPENDENT_CODE': 'ON', - 'galze_BUILD_EXAMPLES': 'OFF', - 'glaze_DEVELOPER_MODE': 'OFF', - }) - -glaze_sp = cmake.subproject( - 'glaze', - options: glaze_cmake_options, -) -glaze_dep = glaze_sp.dependency('glaze_glaze') diff --git a/build-config/meson.build b/build-config/meson.build index 9f408ea..cee4b25 100644 --- a/build-config/meson.build +++ b/build-config/meson.build @@ -1,2 +1,2 @@ cmake = import('cmake') -subdir('glaze') +subdir('reflect-cpp') diff --git a/build-config/reflect-cpp/LICENSE b/build-config/reflect-cpp/LICENSE new file mode 100644 index 0000000..5671e3f --- /dev/null +++ b/build-config/reflect-cpp/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023-2025 Code17 GmbH + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/build-config/reflect-cpp/include/rfl.hpp b/build-config/reflect-cpp/include/rfl.hpp new file mode 100644 index 0000000..8aaa0cb --- /dev/null +++ b/build-config/reflect-cpp/include/rfl.hpp @@ -0,0 +1,87 @@ +#ifndef RFL_RFL_HPP_ +#define RFL_RFL_HPP_ + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4244) +#pragma warning(disable : 4101) +#endif + +#include "rfl/AddStructName.hpp" +#include "rfl/AddTagsToVariants.hpp" +#include "rfl/AllOf.hpp" +#include "rfl/AllowRawPtrs.hpp" +#include "rfl/AnyOf.hpp" +#include "rfl/Attribute.hpp" +#include "rfl/Binary.hpp" +#include "rfl/Box.hpp" +#include "rfl/Bytestring.hpp" +#include "rfl/DefaultIfMissing.hpp" +#include "rfl/DefaultVal.hpp" +#include "rfl/Description.hpp" +#include "rfl/ExtraFields.hpp" +#include "rfl/Field.hpp" +#include "rfl/Flatten.hpp" +#include "rfl/Generic.hpp" +#include "rfl/Hex.hpp" +#include "rfl/Literal.hpp" +#include "rfl/NamedTuple.hpp" +#include "rfl/NoExtraFields.hpp" +#include "rfl/NoFieldNames.hpp" +#include "rfl/NoOptionals.hpp" +#include "rfl/Object.hpp" +#include "rfl/Oct.hpp" +#include "rfl/OneOf.hpp" +#include "rfl/Pattern.hpp" +#include "rfl/PatternValidator.hpp" +#include "rfl/Processors.hpp" +#include "rfl/Ref.hpp" +#include "rfl/Rename.hpp" +#include "rfl/Size.hpp" +#include "rfl/Skip.hpp" +#include "rfl/SnakeCaseToCamelCase.hpp" +#include "rfl/SnakeCaseToPascalCase.hpp" +#include "rfl/TaggedUnion.hpp" +#include "rfl/Timestamp.hpp" +#include "rfl/UnderlyingEnums.hpp" +#include "rfl/Validator.hpp" +#include "rfl/Variant.hpp" +#include "rfl/Vectorstring.hpp" +#include "rfl/always_false.hpp" +#include "rfl/apply.hpp" +#include "rfl/as.hpp" +#include "rfl/comparisons.hpp" +#include "rfl/concepts.hpp" +#include "rfl/default.hpp" +#include "rfl/define_literal.hpp" +#include "rfl/define_named_tuple.hpp" +#include "rfl/define_tagged_union.hpp" +#include "rfl/define_variant.hpp" +#include "rfl/enums.hpp" +#include "rfl/extract_discriminators.hpp" +#include "rfl/field_type.hpp" +#include "rfl/fields.hpp" +#include "rfl/from_generic.hpp" +#include "rfl/from_named_tuple.hpp" +#include "rfl/get.hpp" +#include "rfl/make_from_tuple.hpp" +#include "rfl/make_named_tuple.hpp" +#include "rfl/name_t.hpp" +#include "rfl/named_tuple_t.hpp" +#include "rfl/parsing/CustomParser.hpp" +#include "rfl/patterns.hpp" +#include "rfl/remove_fields.hpp" +#include "rfl/replace.hpp" +#include "rfl/to_generic.hpp" +#include "rfl/to_named_tuple.hpp" +#include "rfl/to_view.hpp" +#include "rfl/tuple_cat.hpp" +#include "rfl/type_name_t.hpp" +#include "rfl/view_t.hpp" +#include "rfl/visit.hpp" + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +#endif diff --git a/build-config/reflect-cpp/include/rfl/AddStructName.hpp b/build-config/reflect-cpp/include/rfl/AddStructName.hpp new file mode 100644 index 0000000..6f6cd5d --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/AddStructName.hpp @@ -0,0 +1,33 @@ +#ifndef RFL_ADDSTRUCTNAME_HPP_ +#define RFL_ADDSTRUCTNAME_HPP_ + +#include + +#include "Field.hpp" +#include "Literal.hpp" +#include "apply.hpp" +#include "internal/StringLiteral.hpp" +#include "internal/get_type_name.hpp" +#include "internal/remove_namespaces.hpp" +#include "make_named_tuple.hpp" + +namespace rfl { + +template +struct AddStructName { + /// Adds the name of the struct as a new field. + template + static auto process(const auto& _view) { + using LiteralType = Literal< + internal::remove_namespaces()>()>; + using FieldType = Field; + const auto add_new_field = [](const auto&... _fields) { + return make_named_tuple(FieldType(LiteralType()), _fields...); + }; + return rfl::apply(add_new_field, _view.fields()); + } +}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/AddTagsToVariants.hpp b/build-config/reflect-cpp/include/rfl/AddTagsToVariants.hpp new file mode 100644 index 0000000..1a68130 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/AddTagsToVariants.hpp @@ -0,0 +1,30 @@ +#ifndef RFL_ADDTAGSTOVARIANTS_HPP_ +#define RFL_ADDTAGSTOVARIANTS_HPP_ + +namespace rfl { + +/// This is a "fake" processor - it doesn't do much in itself, but its +/// inclusion instructs the parsers to automatically add tags to the variants +/// they might encounter. +struct AddTagsToVariants { + public: + template + static auto process(auto&& _named_tuple) { + return _named_tuple; + } +}; + +/// This is a "fake" processor - it doesn't do much in itself, but its +/// inclusion instructs the parsers to automatically add tags to the variants +/// they might encounter. +struct AddNamespacedTagsToVariants { + public: + template + static auto process(auto&& _named_tuple) { + return _named_tuple; + } +}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/AllOf.hpp b/build-config/reflect-cpp/include/rfl/AllOf.hpp new file mode 100644 index 0000000..9cd2ec0 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/AllOf.hpp @@ -0,0 +1,40 @@ +#ifndef RFL_ALLOF_HPP_ +#define RFL_ALLOF_HPP_ + +#include + +#include "Result.hpp" +#include "parsing/schema/ValidationType.hpp" + +namespace rfl { + +/// Requires that all of the contraints C and Cs be true. +template +struct AllOf { + template + static rfl::Result validate(T _value) noexcept { + return validate_impl(_value); + } + + template + static parsing::schema::ValidationType to_schema() { + using ValidationType = parsing::schema::ValidationType; + const auto types = std::vector( + {C::template to_schema(), Cs::template to_schema()...}); + return ValidationType{ValidationType::AllOf{.types_ = types}}; + } + + private: + template + static rfl::Result validate_impl(T _value) noexcept { + if constexpr (sizeof...(Tail) == 0) { + return Head::validate(_value); + } else { + return Head::validate(_value).and_then(validate_impl); + } + } +}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/AllowRawPtrs.hpp b/build-config/reflect-cpp/include/rfl/AllowRawPtrs.hpp new file mode 100644 index 0000000..ed9576a --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/AllowRawPtrs.hpp @@ -0,0 +1,18 @@ +#ifndef RFL_ALLOWRAWPTRS_HPP_ +#define RFL_ALLOWRAWPTRS_HPP_ + +namespace rfl { + +/// This is a "fake" processor - it doesn't do much in itself, but its +/// inclusion instructs the parsers to allow raw pointers. +struct AllowRawPtrs { + public: + template + static auto process(auto&& _named_tuple) { + return _named_tuple; + } +}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/AnyOf.hpp b/build-config/reflect-cpp/include/rfl/AnyOf.hpp new file mode 100644 index 0000000..2d74fcc --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/AnyOf.hpp @@ -0,0 +1,59 @@ +#ifndef RFL_ANYOF_HPP_ +#define RFL_ANYOF_HPP_ + +#include +#include +#include +#include + +#include "Result.hpp" +#include "parsing/schema/ValidationType.hpp" + +namespace rfl { + +/// Requires that all of the contraints C and Cs be true. +template +struct AnyOf { + template + static rfl::Result validate(const T& _value) noexcept { + return validate_impl(_value, {}); + } + + template + static parsing::schema::ValidationType to_schema() { + using ValidationType = parsing::schema::ValidationType; + const auto types = std::vector( + {C::template to_schema(), Cs::template to_schema()...}); + return ValidationType{ValidationType::AnyOf{.types_ = types}}; + } + + private: + static std::string make_error_message(const std::vector& _errors) { + std::stringstream stream; + stream << "Expected at least one of the following validations to pass, but " + "none of them did:"; + for (size_t i = 0; i < _errors.size(); ++i) { + stream << "\n" << i + 1 << ") " << _errors.at(i).what(); + } + return stream.str(); + } + + template + static rfl::Result validate_impl(const T& _value, + std::vector _errors) { + const auto handle_err = [&](Error&& _err) -> rfl::Result { + _errors.push_back(std::forward(_err)); + if constexpr (sizeof...(Tail) == 0) { + return error(make_error_message(_errors)); + } else { + return validate_impl( + _value, std::forward>(_errors)); + } + }; + return Head::validate(_value).or_else(handle_err); + } +}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/Attribute.hpp b/build-config/reflect-cpp/include/rfl/Attribute.hpp new file mode 100644 index 0000000..4d8a39a --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/Attribute.hpp @@ -0,0 +1,136 @@ +#ifndef RFL_ATTRIBUTE_HPP_ +#define RFL_ATTRIBUTE_HPP_ + +#include +#include +#include +#include +#include + +#include "Literal.hpp" +#include "default.hpp" + +namespace rfl { + +template +struct Attribute { + using Type = T; + using ReflectionType = T; + + Attribute() : value_(Type()) {} + + Attribute(const Type& _value) : value_(_value) {} + + Attribute(Type&& _value) noexcept : value_(std::move(_value)) {} + + Attribute(Attribute&& _attr) noexcept = default; + + Attribute(const Attribute& _attr) = default; + + template + Attribute(const Attribute& _attr) : value_(_attr.get()) {} + + template + Attribute(Attribute&& _attr) : value_(_attr.get()) {} + + template , + bool>::type = true> + Attribute(const U& _value) : value_(_value) {} + + template , + bool>::type = true> + Attribute(U&& _value) noexcept : value_(std::forward(_value)) {} + + template , + bool>::type = true> + Attribute(const Attribute& _attr) : value_(_attr.value()) {} + + /// Assigns the underlying object to its default value. + template , + bool>::type = true> + Attribute(const Default&) : value_(Type()) {} + + ~Attribute() = default; + + /// Returns the underlying object. + const Type& get() const { return value_; } + + /// Returns the underlying object. + Type& operator()() { return value_; } + + /// Returns the underlying object. + const Type& operator()() const { return value_; } + + /// Assigns the underlying object. + auto& operator=(const Type& _value) { + value_ = _value; + return *this; + } + + /// Assigns the underlying object. + auto& operator=(Type&& _value) noexcept { + value_ = std::move(_value); + return *this; + } + + /// Assigns the underlying object. + template , + bool>::type = true> + auto& operator=(const U& _value) { + value_ = _value; + return *this; + } + + /// Assigns the underlying object to its default value. + template , + bool>::type = true> + auto& operator=(const Default&) { + value_ = Type(); + return *this; + } + + /// Assigns the underlying object. + Attribute& operator=(const Attribute& _attr) = default; + + /// Assigns the underlying object. + Attribute& operator=(Attribute&& _attr) = default; + + /// Assigns the underlying object. + template + auto& operator=(const Attribute& _attr) { + value_ = _attr.get(); + return *this; + } + + /// Assigns the underlying object. + template + auto& operator=(Attribute&& _attr) { + value_ = std::forward(_attr.value_); + return *this; + } + + /// We want all parsers other than the XML parser to treat attributes like + /// normal fields, so we just implement the reflection interface. + const ReflectionType& reflection() const { return value_; } + + /// Assigns the underlying object. + void set(const Type& _value) { value_ = _value; } + + /// Assigns the underlying object. + void set(Type&& _value) { value_ = std::move(_value); } + + /// Returns the underlying object. + Type& value() { return value_; } + + /// Returns the underlying object. + const Type& value() const { return value_; } + + /// The underlying value. + Type value_; +}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/Binary.hpp b/build-config/reflect-cpp/include/rfl/Binary.hpp new file mode 100644 index 0000000..02aa047 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/Binary.hpp @@ -0,0 +1,127 @@ +#ifndef RFL_BINARY_HPP_ +#define RFL_BINARY_HPP_ + +#include +#include +#include +#include +#include +#include +#include + +namespace rfl { + +/// Used to define a field in the NamedTuple. +template +requires std::is_unsigned_v +struct Binary { + /// The underlying type. + using Type = T; + + using ReflectionType = std::string; + + using Bitset = std::bitset; + + Binary() : value_(0) {} + + Binary(const Type& _value) : value_(_value) {} + + Binary(Binary&& _other) noexcept = default; + + Binary(const Binary& _other) = default; + + template + Binary(const Binary& _other) : value_(_other.get()) {} + + template + Binary(Binary&& _other) : value_(_other.get()) {} + + template , + bool>::type = true> + Binary(const U& _value) : value_(_value) {} + + template , + bool>::type = true> + Binary(U&& _value) noexcept : value_(std::forward(_value)) {} + + template , + bool>::type = true> + Binary(const Binary& _other) : value_(_other.value()) {} + + Binary(const std::string& _str) + : value_(static_cast(Bitset{_str}.to_ullong())) {} + + ~Binary() = default; + + /// Returns the underlying object. + const Type& get() const { return value_; } + + /// Returns the underlying object. + Type& operator()() { return value_; } + + /// Returns the underlying object. + const Type& operator()() const { return value_; } + + /// Assigns the underlying object. + auto& operator=(const Type& _value) { + value_ = _value; + return *this; + } + + /// Assigns the underlying object. + template , + bool>::type = true> + auto& operator=(const U& _value) { + value_ = _value; + return *this; + } + + /// Assigns the underlying object. + Binary& operator=(const Binary& _other) = default; + + /// Assigns the underlying object. + Binary& operator=(Binary&& _other) = default; + + /// Assigns the underlying object. + template + auto& operator=(const Binary& _other) { + value_ = _other.get(); + return *this; + } + + /// Assigns the underlying object. + template + auto& operator=(const std::string& _str) { + value_ = static_cast(Bitset{_str}.to_ullong()); + return *this; + } + + /// Assigns the underlying object. + template + auto& operator=(Binary&& _other) { + value_ = std::forward(_other.value_); + return *this; + } + + /// Necessary for the automated parsing to work. + std::string reflection() const { return Bitset{value_}.to_string(); } + + /// Assigns the underlying object. + void set(const Type& _value) { value_ = _value; } + + /// Returns the underlying value as a string, alias for .reflection(). + std::string str() const { return reflection(); } + + /// Returns the underlying object. + Type& value() { return value_; } + + /// Returns the underlying object. + const Type& value() const { return value_; } + + /// The underlying value. + Type value_; +}; + +} // namespace rfl + +#endif // RFL_FIELD_HPP_ diff --git a/build-config/reflect-cpp/include/rfl/Box.hpp b/build-config/reflect-cpp/include/rfl/Box.hpp new file mode 100644 index 0000000..e2fb2b9 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/Box.hpp @@ -0,0 +1,159 @@ +#ifndef RFL_BOX_HPP_ +#define RFL_BOX_HPP_ + +#include + +#include "Result.hpp" + +namespace rfl { + + +enum class Copyability { + COPYABLE, + NON_COPYABLE +}; + +/// The Box class behaves very similarly to the unique_ptr, but unlike the +/// unique_ptr, it is 100% guaranteed to be filled at all times (unless the user +/// tries to access it after calling std::move does something else that is +/// clearly bad practice). +/// +/// By default Box behaves like a unique_ptr in relation to copying, but it can be +/// configured to add copy constructor and assignment operators that call the +/// same function of the contained type T. + +template +class Box { + public: + /// The only way of creating new boxes is + /// Box::make(...). + template + static Box make(Args&&... _args) { + return Box(std::make_unique(std::forward(_args)...)); + } + + /// You can generate them from unique_ptrs as well, in which case it will + /// return an Error, if the unique_ptr is not set. + static Result make(std::unique_ptr&& _ptr) { + if (!_ptr) { + return error("std::unique_ptr was a nullptr."); + } + return Box(std::move(_ptr)); + } + + Box() : ptr_(std::make_unique()) {} + + /// Copy constructor if copyable + Box(const Box& _other) requires (C == Copyability::COPYABLE) + { + ptr_ = std::make_unique(*_other); + } + + /// Copy constructor if not copyable + Box(const Box& _other) requires (C == Copyability::NON_COPYABLE) = delete; + + Box(Box&& _other) = default; + + template + Box(Box&& _other) noexcept + : ptr_(std::forward>(_other.ptr())) {} + + ~Box() = default; + + /// Returns a pointer to the underlying object + T* get() const { return ptr_.get(); } + + /// Copy assignment operator if copyable + Box& operator=(const Box& other) requires (C == Copyability::COPYABLE) { + if(this != &other) { + ptr_ = std::make_unique(*other); + } + return *this; + } + + /// Copy assignment operator if not copyable + Box& operator=(const Box& _other) requires (C == Copyability::NON_COPYABLE) = delete; + + /// Move assignment operator + Box& operator=(Box&& _other) noexcept = default; + + /// Move assignment operator + template + Box& operator=(Box&& _other) noexcept { + ptr_ = std::forward>(_other.ptr()); + return *this; + } + + /// Returns the underlying object. + T& operator*() { return *ptr_; } + + /// Returns the underlying object. + T& operator*() const { return *ptr_; } + + /// Returns the underlying object. + T* operator->() { return ptr_.get(); } + + /// Returns the underlying object. + T* operator->() const { return ptr_.get(); } + + /// Returns the underlying unique_ptr + std::unique_ptr& ptr() { return ptr_; } + + /// Returns the underlying unique_ptr + const std::unique_ptr& ptr() const { return ptr_; } + + private: + /// Only make is allowed to use this constructor. + explicit Box(std::unique_ptr&& _ptr) : ptr_(std::move(_ptr)) {} + + private: + /// The underlying unique_ptr_ + std::unique_ptr ptr_; +}; + +/// Generates a new Ref. +template +auto make_box(Args&&... _args) { + return Box::make(std::forward(_args)...); +} + +/// Template specialization for a box that is copyable. +template +using CopyableBox = Box; + +template +auto make_copyable_box(Args&&... _args) { + return CopyableBox::make(std::forward(_args)...); +} + +template +inline auto operator<=>(const Box& _b1, const Box& _b2) { + return _b1.ptr() <=> _b2.ptr(); +} + +template +inline std::basic_ostream& operator<<( + std::basic_ostream& _os, const Box& _b) { + _os << _b.get(); + return _os; +} + +} // namespace rfl + +namespace std { + +template +struct hash> { + size_t operator()(const rfl::Box& _b) const { + return std::hash>{}(_b.ptr()); + } +}; + +template +inline void swap(rfl::Box& _b1, rfl::Box& _b2) { + return swap(_b1.ptr(), _b2.ptr()); +} + +} // namespace std + +#endif diff --git a/build-config/reflect-cpp/include/rfl/Bytestring.hpp b/build-config/reflect-cpp/include/rfl/Bytestring.hpp new file mode 100644 index 0000000..197531e --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/Bytestring.hpp @@ -0,0 +1,13 @@ +#ifndef RFL_BYTESTRING_HPP_ +#define RFL_BYTESTRING_HPP_ + +#include +#include + +namespace rfl { + +using Bytestring = std::vector; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/DefaultIfMissing.hpp b/build-config/reflect-cpp/include/rfl/DefaultIfMissing.hpp new file mode 100644 index 0000000..010d626 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/DefaultIfMissing.hpp @@ -0,0 +1,19 @@ +#ifndef RFL_DEFAULTIFMISSING_HPP_ +#define RFL_DEFAULTIFMISSING_HPP_ + +namespace rfl { + +/// This is a "fake" processor - it doesn't do much in itself, but its +/// inclusion instructs the parsers to use the default values for missing +/// fields. +struct DefaultIfMissing { + public: + template + static auto process(auto&& _named_tuple) { + return _named_tuple; + } +}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/DefaultVal.hpp b/build-config/reflect-cpp/include/rfl/DefaultVal.hpp new file mode 100644 index 0000000..be6a681 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/DefaultVal.hpp @@ -0,0 +1,129 @@ +#ifndef RFL_DEFAULTVAL_HPP_ +#define RFL_DEFAULTVAL_HPP_ + +#include +#include + +#include "default.hpp" + +namespace rfl { + +template +struct DefaultVal { + public: + using Type = std::remove_cvref_t; + + DefaultVal() : value_(Type()) {} + + DefaultVal(const Type& _value) : value_(_value) {} + + DefaultVal(Type&& _value) noexcept : value_(std::move(_value)) {} + + DefaultVal(DefaultVal&& _field) noexcept = default; + + DefaultVal(const DefaultVal& _field) = default; + + template + DefaultVal(const DefaultVal& _field) : value_(_field.get()) {} + + template + DefaultVal(DefaultVal&& _field) noexcept( + noexcept(Type(std::move(_field.value())))) + : value_(std::move(_field.value())) {} + + template + requires(std::is_convertible_v) + DefaultVal(const U& _value) : value_(_value) {} + + template + requires(std::is_convertible_v) + DefaultVal(U&& _value) noexcept : value_(std::forward(_value)) {} + + template + requires(std::is_convertible_v) + DefaultVal(const DefaultVal& _field) : value_(_field.value()) {} + + /// Assigns the underlying object to its default value. + template + requires(std::is_default_constructible_v) + DefaultVal(const Default&) : value_(Type()) {} + + ~DefaultVal() = default; + + /// Returns the underlying object. + const Type& get() const { return value_; } + + /// Returns the underlying object. + Type& operator()() { return value_; } + + /// Returns the underlying object. + const Type& operator()() const { return value_; } + + /// Assigns the underlying object. + auto& operator=(const Type& _value) { + value_ = _value; + return *this; + } + + /// Assigns the underlying object. + auto& operator=(Type&& _value) noexcept { + value_ = std::move(_value); + return *this; + } + + /// Assigns the underlying object. + template , + bool>::type = true> + auto& operator=(const U& _value) { + value_ = _value; + return *this; + } + + /// Assigns the underlying object to its default value. + template , + bool>::type = true> + auto& operator=(const Default&) { + value_ = Type(); + return *this; + } + + /// Assigns the underlying object. + DefaultVal& operator=(const DefaultVal& _field) = default; + + /// Assigns the underlying object. + DefaultVal& operator=(DefaultVal&& _field) = default; + + /// Assigns the underlying object. + template + auto& operator=(const DefaultVal& _field) { + value_ = _field.get(); + return *this; + } + + /// Assigns the underlying object. + template + auto& operator=(DefaultVal&& _field) { + value_ = std::forward(_field.value_); + return *this; + } + + /// Assigns the underlying object. + void set(const Type& _value) { value_ = _value; } + + /// Assigns the underlying object. + void set(Type&& _value) { value_ = std::move(_value); } + + /// Returns the underlying object. + Type& value() { return value_; } + + /// Returns the underlying object. + const Type& value() const { return value_; } + + /// The underlying value. + Type value_; +}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/Description.hpp b/build-config/reflect-cpp/include/rfl/Description.hpp new file mode 100644 index 0000000..46692b7 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/Description.hpp @@ -0,0 +1,150 @@ +#ifndef RFL_DESCRIPTION_HPP_ +#define RFL_DESCRIPTION_HPP_ + +#include +#include +#include +#include +#include + +#include "Literal.hpp" +#include "default.hpp" +#include "internal/StringLiteral.hpp" + +namespace rfl { + +/// Used to add a description to the field - this is only relevant for the JSON +/// schema and will be ignored by the normal serialization routines. +template +struct Description { + /// The underlying type. + using Type = T; + + /// The description of the field. + using Content = rfl::Literal<_description>; + + using ReflectionType = Type; + + Description() : value_(Type()) {} + + Description(const Type& _value) : value_(_value) {} + + Description(Type&& _value) noexcept : value_(std::move(_value)) {} + + Description(Description&& _field) noexcept = default; + + Description(const Description& _field) = default; + + template + Description(const Description<_description, U>& _field) + : value_(_field.get()) {} + + template + Description(Description<_description, U>&& _field) : value_(_field.get()) {} + + template , + bool>::type = true> + Description(const U& _value) : value_(_value) {} + + template , + bool>::type = true> + Description(U&& _value) noexcept : value_(std::forward(_value)) {} + + template , + bool>::type = true> + Description(const Description<_description, U>& _field) + : value_(_field.value()) {} + + /// Assigns the underlying object to its default value. + template , + bool>::type = true> + Description(const Default&) : value_(Type()) {} + + ~Description() = default; + + /// The description of the field, for internal use. + constexpr static const internal::StringLiteral description_ = _description; + + /// Returns the underlying object. + const Type& get() const { return value_; } + + /// Returns the underlying object. + Type& operator()() { return value_; } + + /// Returns the underlying object. + const Type& operator()() const { return value_; } + + /// Assigns the underlying object. + auto& operator=(const Type& _value) { + value_ = _value; + return *this; + } + + /// Assigns the underlying object. + auto& operator=(Type&& _value) noexcept { + value_ = std::move(_value); + return *this; + } + + /// Assigns the underlying object. + template , + bool>::type = true> + auto& operator=(const U& _value) { + value_ = _value; + return *this; + } + + /// Assigns the underlying object to its default value. + template , + bool>::type = true> + auto& operator=(const Default&) { + value_ = Type(); + return *this; + } + + /// Assigns the underlying object. + Description& operator=( + const Description& _field) = default; + + /// Assigns the underlying object. + Description& operator=( + Description&& _field) = default; + + /// Assigns the underlying object. + template + auto& operator=(const Description<_description, U>& _field) { + value_ = _field.get(); + return *this; + } + + /// Assigns the underlying object. + template + auto& operator=(Description<_description, U>&& _field) { + value_ = std::forward(_field.value_); + return *this; + } + + /// Returns the underlying object - necessary for the reflection to work. + const Type& reflection() const { return value_; } + + /// Assigns the underlying object. + void set(const Type& _value) { value_ = _value; } + + /// Assigns the underlying object. + void set(Type&& _value) { value_ = std::move(_value); } + + /// Returns the underlying object. + Type& value() { return value_; } + + /// Returns the underlying object. + const Type& value() const { return value_; } + + /// The underlying value. + Type value_; +}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/ExtraFields.hpp b/build-config/reflect-cpp/include/rfl/ExtraFields.hpp new file mode 100644 index 0000000..dc77983 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/ExtraFields.hpp @@ -0,0 +1,15 @@ +#ifndef RFL_EXTRAFIELDS_HPP_ +#define RFL_EXTRAFIELDS_HPP_ + +#include "Object.hpp" + +namespace rfl { + +/// Used to embed additional fields for which the names cannot be known in +/// advance and can therefore not be encoded in the struct. +template +class ExtraFields : public Object {}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/Field.hpp b/build-config/reflect-cpp/include/rfl/Field.hpp new file mode 100644 index 0000000..e33fab2 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/Field.hpp @@ -0,0 +1,151 @@ +#ifndef RFL_FIELD_HPP_ +#define RFL_FIELD_HPP_ + +#include +#include +#include + +#include "Literal.hpp" +#include "default.hpp" +#include "internal/Array.hpp" +#include "internal/StringLiteral.hpp" +#include "internal/wrap_in_rfl_array_t.hpp" + +namespace rfl { + +/// Used to define a field in the NamedTuple. +template +struct Field { + /// The underlying type. + using Type = internal::wrap_in_rfl_array_t; + + /// The name of the field. + using Name = rfl::Literal<_name>; + + Field(const Type& _value) : value_(_value) {} + + Field(Type&& _value) noexcept : value_(std::move(_value)) {} + + Field(Field&& _field) noexcept = default; + + Field(const Field& _field) = default; + + template + Field(const Field<_name, U>& _field) : value_(_field.get()) {} + + template + Field(Field<_name, U>&& _field) : value_(_field.get()) {} + + template , + bool>::type = true> + Field(const U& _value) : value_(_value) {} + + template , + bool>::type = true> + Field(U&& _value) noexcept : value_(std::forward(_value)) {} + + template , + bool>::type = true> + Field(const Field<_name, U>& _field) : value_(_field.value()) {} + + /// Assigns the underlying object to its default value. + template , + bool>::type = true> + Field(const Default&) : value_(Type()) {} + + ~Field() = default; + + /// The name of the field, for internal use. + constexpr static const internal::StringLiteral name_ = _name; + + /// Returns the underlying object. + const Type& get() const { return value_; } + + /// The name of the field. + constexpr static std::string_view name() { return name_.string_view(); } + + /// Returns the underlying object. + Type& operator()() { return value_; } + + /// Returns the underlying object. + const Type& operator()() const { return value_; } + + /// Assigns the underlying object. + auto& operator=(const Type& _value) { + value_ = _value; + return *this; + } + + /// Assigns the underlying object. + auto& operator=(Type&& _value) noexcept { + value_ = std::move(_value); + return *this; + } + + /// Assigns the underlying object. + template , + bool>::type = true> + auto& operator=(const U& _value) { + value_ = _value; + return *this; + } + + /// Assigns the underlying object to its default value. + template , + bool>::type = true> + auto& operator=(const Default&) { + value_ = Type(); + return *this; + } + + /// Assigns the underlying object. + Field& operator=(const Field& _field) = default; + + /// Assigns the underlying object. + Field& operator=(Field&& _field) = default; + + /// Assigns the underlying object. + template + auto& operator=(const Field<_name, U>& _field) { + value_ = _field.get(); + return *this; + } + + /// Assigns the underlying object. + template + auto& operator=(Field<_name, U>&& _field) { + value_ = std::forward(_field.value_); + return *this; + } + + /// Assigns the underlying object. + void set(const Type& _value) { value_ = _value; } + + /// Assigns the underlying object. + void set(Type&& _value) { value_ = std::move(_value); } + + /// Returns the underlying object. + Type& value() { return value_; } + + /// Returns the underlying object. + const Type& value() const { return value_; } + + /// The underlying value. + Type value_; +}; + +template +inline auto make_field(T&& _value) { + using T0 = std::remove_cvref_t; + if constexpr (std::is_array_v) { + return Field<_name, T0>(internal::Array(std::forward(_value))); + } else { + return Field<_name, T0>(std::forward(_value)); + } +} + +} // namespace rfl + +#endif // RFL_FIELD_HPP_ diff --git a/build-config/reflect-cpp/include/rfl/Flatten.hpp b/build-config/reflect-cpp/include/rfl/Flatten.hpp new file mode 100644 index 0000000..b7a7726 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/Flatten.hpp @@ -0,0 +1,120 @@ +#ifndef RFL_FLATTEN_HPP_ +#define RFL_FLATTEN_HPP_ + +#include +#include +#include +#include +#include + +namespace rfl { + +/// Used to embed another struct into the generated output. +template +struct Flatten { + /// The underlying type. + using Type = std::remove_cvref_t; + + Flatten() = default; + + Flatten(const Type& _value) : value_(_value) {} + + Flatten(Type&& _value) noexcept : value_(std::forward(_value)) {} + + Flatten(const Flatten& _f) = default; + + Flatten(Flatten&& _f) noexcept = default; + + template + Flatten(const Flatten& _f) : value_(_f.get()) {} + + template + Flatten(Flatten&& _f) : value_(_f.get()) {} + + template , + bool>::type = true> + Flatten(const U& _value) : value_(_value) {} + + template , + bool>::type = true> + Flatten(U&& _value) : value_(_value) {} + + ~Flatten() = default; + + /// Returns the underlying object. + Type& get() { return value_; } + + /// Returns the underlying object. + const Type& get() const { return value_; } + + /// Returns the underlying object. + Type& operator()() { return value_; } + + /// Returns the underlying object. + const Type& operator()() const { return value_; } + + /// Assigns the underlying object. + Flatten& operator=(const T& _value) { + value_ = _value; + return *this; + } + + /// Assigns the underlying object. + Flatten& operator=(T&& _value) { + value_ = std::forward(_value); + return *this; + } + + /// Assigns the underlying object. + template , + bool>::type = true> + Flatten& operator=(const U& _value) { + value_ = _value; + return *this; + } + + /// Assigns the underlying object. + Flatten& operator=(const Flatten& _f) = default; + + /// Assigns the underlying object. + Flatten& operator=(Flatten&& _f) = default; + + /// Assigns the underlying object. + template + Flatten& operator=(const Flatten& _f) { + value_ = _f.get(); + return *this; + } + + /// Assigns the underlying object. + template + Flatten& operator=(Flatten&& _f) { + value_ = std::forward(_f); + return *this; + } + + /// Three-way comparison operator + template + auto operator<=>(const Flatten& _f) const { + return value_ <=> _f.value_; + } + + /// Equality comparison operator. + template + bool operator==(const Flatten& _f) const { + return value_ == _f.get(); + } + + /// Assigns the underlying object. + void set(const Type& _value) { value_ = _value; } + + /// Assigns the underlying object. + void set(Type&& _value) { value_ = std::forward(_value); } + + /// The underlying value. + Type value_; +}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/Generic.hpp b/build-config/reflect-cpp/include/rfl/Generic.hpp new file mode 100644 index 0000000..32a2357 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/Generic.hpp @@ -0,0 +1,299 @@ +#ifndef RFL_GENERIC_HPP_ +#define RFL_GENERIC_HPP_ + +#include +#include +#include +#include +#include +#include + +#include "Object.hpp" +#include "Result.hpp" +#include "Variant.hpp" +#include "common.hpp" + +namespace rfl { + +class RFL_API Generic { + public: + constexpr static std::nullopt_t Null = std::nullopt; + + using Array = std::vector; + using Object = rfl::Object; + using VariantType = std::variant; + using ReflectionType = std::optional< + std::variant>; + + Generic(); + + Generic(Generic&& _other) noexcept; + + Generic(const Generic& _other); + + Generic(const VariantType& _value); + + Generic(VariantType&& _value) noexcept; + + Generic(const ReflectionType& _value); + + template , + bool>::type = true> + Generic(const T& _value) { + value_ = _value; + } + + template , + bool>::type = true> + Generic(T&& _value) noexcept : value_(std::forward(_value)) {} + + ~Generic(); + + /// Returns the underlying object. + const VariantType& get() const { return value_; } + + /// Whether the object contains the null value. + bool is_null() const noexcept; + + /// Assigns the underlying object. + Generic& operator=(const VariantType& _value); + + /// Assigns the underlying object. + Generic& operator=(VariantType&& _value) noexcept; + + /// Assigns the underlying object. + template , + bool>::type = true> + auto& operator=(const T& _value) { + using Type = std::remove_cvref_t; + if constexpr (std::is_same_v) { + value_.emplace<0>(_value); + } else if constexpr (std::is_integral_v) { + value_.emplace<1>(static_cast(_value)); + } else if constexpr (std::is_floating_point_v) { + value_.emplace<2>(static_cast(_value)); + } else { + value_ = _value; + } + return *this; + } + + /// Assigns the underlying object. + Generic& operator=(const Generic& _other); + + /// Assigns the underlying object. + Generic& operator=(Generic&& _other); + + /// Returns the underlying object, necessary for the serialization to work. + ReflectionType reflection() const noexcept; + + /// Casts the underlying value to an rfl::Generic::Array or returns an + /// rfl::Error, if the underlying value is not an rfl::Generic::Array. + Result to_array() const noexcept { + return std::visit( + [](auto _v) -> Result { + using V = std::remove_cvref_t; + if constexpr (std::is_same_v) { + return _v; + } else { + return error( + "rfl::Generic: Could not cast the underlying value to an " + "rfl::Generic::Array."); + } + }, + value_); + } + + /// Casts the underlying value to a boolean or returns an rfl::Error, if the + /// underlying value is not a boolean. + Result to_bool() const noexcept { + return std::visit( + [](auto _v) -> Result { + using V = std::remove_cvref_t; + if constexpr (std::is_same_v) { + return _v; + } else { + return error( + "rfl::Generic: Could not cast the underlying value to a " + "boolean."); + } + }, + value_); + } + + /// Casts the underlying value to a double or returns an rfl::Error, if the + /// underlying value is not a number or the conversion would result in loss of + /// precision. + Result to_double() const noexcept { + return std::visit( + [](auto _v) -> Result { + using V = std::remove_cvref_t; + if constexpr (std::is_same_v) { + return _v; + } else if constexpr (std::is_same_v) { + auto _d = static_cast(_v); + if (static_cast(_d) == _v) { + return _d; + } else { + return error( + "rfl::Generic: Could not cast the underlying value to a " + "double without loss of precision."); + } + } else { + return error( + "rfl::Generic: Could not cast the underlying value to a " + "double."); + } + }, + value_); + } + + /// Casts the underlying value to an integer or returns an rfl::Error, if the + /// underlying value is not an integer. + Result to_int() const noexcept { + return std::visit( + [](auto _v) -> Result { + using V = std::remove_cvref_t; + if constexpr (std::is_same_v) { + return static_cast(_v); + } else { + return error( + "rfl::Generic: Could not cast the underlying value to an " + "integer."); + } + }, + value_); + } + + /// Casts the underlying value to an int64 or returns an rfl::Error, if the + /// underlying value is not an integer. + Result to_int64() const noexcept { + return std::visit( + [](auto _v) -> Result { + using V = std::remove_cvref_t; + if constexpr (std::is_same_v) { + return _v; + } else { + return error( + "rfl::Generic: Could not cast the underlying value to an " + "int64."); + } + }, + value_); + } + + /// Casts the underlying value to an rfl::Generic::Object or returns an + /// rfl::Error, if the underlying value is not an rfl::Generic::Object. + Result to_object() const noexcept { + return std::visit( + [](auto _v) -> Result { + using V = std::remove_cvref_t; + if constexpr (std::is_same_v) { + return _v; + } else { + return error( + "rfl::Generic: Could not cast the underlying value to an " + "rfl::Generic::Object."); + } + }, + value_); + } + + /// Casts the underlying value to rfl::Generic::Null or returns an + /// rfl::Error, if the underlying value is not rfl::Generic::Null. + Result to_null() const noexcept { + return std::visit( + [](auto _v) -> Result { + using V = std::remove_cvref_t; + if constexpr (std::is_same_v) { + return _v; + } else { + return error( + "rfl::Generic: Could not cast the underlying value to " + "rfl::Generic::Null."); + } + }, + value_); + } + + /// Casts the underlying value to a string or returns an rfl::Error, if the + /// underlying value is not a string. + Result to_string() const noexcept { + return std::visit( + [](auto _v) -> Result { + using V = std::remove_cvref_t; + if constexpr (std::is_same_v) { + return _v; + } else { + return error( + "rfl::Generic: Could not cast the underlying value to a " + "string."); + } + }, + value_); + } + + /// Returns the underlying variant. + VariantType& variant() noexcept { return value_; }; + + /// Returns the underlying variant. + const VariantType& variant() const noexcept { return value_; }; + + private: + static VariantType from_reflection_type(const ReflectionType& _r) noexcept; + + private: + VariantType value_; +}; + +/// Casts the underlying value to an rfl::Generic::Array or returns an +/// rfl::Error, if the underlying value is not an rfl::Generic::Array. +inline Result to_array(const Generic& _g) noexcept { + return _g.to_array(); +} + +/// Casts the underlying value to a boolean or returns an rfl::Error, if the +/// underlying value is not a boolean. +inline Result to_bool(const Generic& _g) noexcept { return _g.to_bool(); } + +/// Casts the underlying value to a double or returns an rfl::Error, if the +/// underlying value is not a double. +inline Result to_double(const Generic& _g) noexcept { + return _g.to_double(); +} + +/// Casts the underlying value to an integer or returns an rfl::Error, if the +/// underlying value is not an integer. +inline Result to_int(const Generic& _g) noexcept { return _g.to_int(); } + +/// Casts the underlying value to an int64 or returns an rfl::Error, if the +/// underlying value is not an integer. +inline Result to_int64(const Generic& _g) noexcept { + return _g.to_int64(); +} + +/// Casts the underlying value to an rfl::Generic::Object or returns an +/// rfl::Error, if the underlying value is not an rfl::Generic::Object. +inline Result to_object(const Generic& _g) noexcept { + return _g.to_object(); +} + +/// Casts the underlying value to a double or returns an rfl::Error, if the +/// underlying value is not a double. +inline Result to_null(const Generic& _g) noexcept { + return _g.to_null(); +} + +/// Casts the underlying value to a string or returns an rfl::Error, if the +/// underlying value is not a string. +inline Result to_string(const Generic& _g) noexcept { + return _g.to_string(); +} + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/Hex.hpp b/build-config/reflect-cpp/include/rfl/Hex.hpp new file mode 100644 index 0000000..42811e1 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/Hex.hpp @@ -0,0 +1,129 @@ +#ifndef RFL_HEX_HPP_ +#define RFL_HEX_HPP_ + +#include +#include +#include +#include +#include +#include + +namespace rfl { + +/// Used to define a field in the NamedTuple. +template +requires std::is_integral_v +struct Hex { + /// The underlying type. + using Type = T; + + using ReflectionType = std::string; + + Hex() : value_(0) {} + + Hex(const Type& _value) : value_(_value) {} + + Hex(Hex&& _other) noexcept = default; + + Hex(const Hex& _other) = default; + + template + Hex(const Hex& _other) : value_(_other.get()) {} + + template + Hex(Hex&& _other) : value_(_other.get()) {} + + template , + bool>::type = true> + Hex(const U& _value) : value_(_value) {} + + template , + bool>::type = true> + Hex(U&& _value) noexcept : value_(std::forward(_value)) {} + + template , + bool>::type = true> + Hex(const Hex& _other) : value_(_other.value()) {} + + Hex(const std::string& _str) { + std::istringstream(_str) >> std::hex >> value_; + } + + ~Hex() = default; + + /// Returns the underlying object. + const Type& get() const { return value_; } + + /// Returns the underlying object. + Type& operator()() { return value_; } + + /// Returns the underlying object. + const Type& operator()() const { return value_; } + + /// Assigns the underlying object. + auto& operator=(const Type& _value) { + value_ = _value; + return *this; + } + + /// Assigns the underlying object. + template , + bool>::type = true> + auto& operator=(const U& _value) { + value_ = _value; + return *this; + } + + /// Assigns the underlying object. + Hex& operator=(const Hex& _other) = default; + + /// Assigns the underlying object. + Hex& operator=(Hex&& _other) = default; + + /// Assigns the underlying object. + template + auto& operator=(const Hex& _other) { + value_ = _other.get(); + return *this; + } + + /// Assigns the underlying object. + template + auto& operator=(const std::string& _str) { + std::istringstream(_str) >> std::hex >> value_; + return *this; + } + + /// Assigns the underlying object. + template + auto& operator=(Hex&& _other) { + value_ = std::forward(_other.value_); + return *this; + } + + /// Necessary for the automated parsing to work. + std::string reflection() const { + std::stringstream stream; + stream << std::hex << value_; + return stream.str(); + } + + /// Assigns the underlying object. + void set(const Type& _value) { value_ = _value; } + + /// Returns the underlying value as a string, alias for .reflection(). + std::string str() const { return reflection(); } + + /// Returns the underlying object. + Type& value() { return value_; } + + /// Returns the underlying object. + const Type& value() const { return value_; } + + /// The underlying value. + Type value_; +}; + +} // namespace rfl + +#endif // RFL_FIELD_HPP_ diff --git a/build-config/reflect-cpp/include/rfl/Literal.hpp b/build-config/reflect-cpp/include/rfl/Literal.hpp new file mode 100644 index 0000000..bd9ec0c --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/Literal.hpp @@ -0,0 +1,371 @@ +#ifndef RFL_LITERAL_HPP_ +#define RFL_LITERAL_HPP_ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Result.hpp" +#include "Tuple.hpp" +#include "internal/StringLiteral.hpp" +#include "internal/find_index.hpp" +#include "internal/no_duplicate_field_names.hpp" + +namespace rfl { + +template +struct LiteralHelper { + constexpr static internal::StringLiteral name_ = _name; +}; + +template +class Literal { + using FieldsType = rfl::Tuple...>; + + public: + using ValueType = std::conditional_t; + + /// The number of different fields or different options that the literal + /// can assume. + static constexpr ValueType num_fields_ = sizeof...(fields_); + + using ReflectionType = std::string; + + /// Constructs a Literal from another literal. + Literal(const Literal& _other) = default; + + /// Constructs a Literal from another literal. + Literal(Literal&& _other) noexcept = default; + + Literal(const std::string& _str) : value_(find_value(_str).value()) {} + + Literal() : value_(0) {} + + ~Literal() = default; + + /// Constructs a new Literal. + template + static Literal make() { + return Literal(Literal::template value_of<_name>()); + } + + /// Constructs a new Literal, equivalent to make, for reasons of consistency. + template + static Literal from_name() { + return Literal::template make<_name>(); + } + + /// Constructs a new Literal. + template + static Literal from_value() { + static_assert(_value < num_fields_, + "Value cannot exceed number of fields."); + return Literal(_value); + } + + /// Constructs a new Literal. + static Result> from_value(ValueType _value) { + if (_value >= num_fields_) { + return error("Value cannot exceed number of fields."); + } + return Literal(_value); + } + + /// Determines whether the literal contains the string. + static bool contains(const std::string& _str) { + bool found = false; + has_value(_str, &found); + return found; + } + + /// Determines whether the literal contains the string at compile time. + template + static constexpr bool contains() { + return find_value_of<_name>() != -1; + } + + /// Determines whether the literal contains any of the strings in the other + /// literal at compile time. + template + static constexpr bool contains_any() { + return [](const std::integer_sequence&) { + return (false || ... || + OtherLiteralType::template contains< + find_name_within_own_fields<_is>()>()); + }(std::make_integer_sequence()); + } + + /// Determines whether the literal contains all of the strings in the other + /// literal at compile time. + template + static constexpr bool contains_all() { + return [](const std::integer_sequence&) { + return (true && ... && + OtherLiteralType::template contains< + find_name_within_own_fields<_is>()>()); + }(std::make_integer_sequence()); + } + + /// Determines whether the literal has duplicate strings at compile time. + /// These is useful for checking collections of strings in other contexts. + static constexpr bool has_duplicates() { + return !internal::no_duplicate_field_names(); + } + + /// Constructs a Literal from a string. Returns an error if the string + /// cannot be found. + static Result from_string(const std::string& _str) { + const auto to_literal = [](const auto& _v) { + return Literal(_v); + }; + return find_value(_str).transform(to_literal); + }; + + /// The name defined by the Literal. + std::string name() const { return find_name(); } + + /// Returns all possible values of the literal as a std::vector. + static std::vector names() { + return allowed_strings_vec(std::make_integer_sequence()); + } + + /// Helper function to retrieve a name at compile time. + template + constexpr static auto name_of() { + constexpr auto name = find_name_within_own_fields<_value>(); + return Literal(); + } + + /// Assigns from another literal. + Literal& operator=(const Literal& _other) = default; + + /// Assigns from another literal. + Literal& operator=(Literal&& _other) noexcept = + default; + + /// Assigns the literal from a string + Literal& operator=(const std::string& _str) { + value_ = find_value(_str).value(); + return *this; + } + + /// <=> for other Literals with the same fields. + auto operator<=>(const Literal& _other) const { + return value() <=> _other.value(); + } + + /// <=> for other Literals with different fields. + template + inline auto operator<=>(const Literal<_fields...>& _l2) const { + return name() <=> _l2.name(); + } + + /// <=> for strings. + inline auto operator<=>(const std::string& _str) const { +#if __cpp_lib_three_way_comparison >= 201907L + return name() <=> _str; +#else + auto const& const_name = name(); + if (const_name < _str) { + return std::strong_ordering::less; + } + if (const_name == _str) { + return std::strong_ordering::equal; + } + return std::strong_ordering::greater; +#endif + } + + /// <=> for const char*. + template + inline auto operator<=>(const char* _str) const { +#if __cpp_lib_three_way_comparison >= 201907L + return name() <=> _str; +#else + auto const& const_name = name(); + if (const_name < _str) { + return std::strong_ordering::less; + } + if (const_name == _str) { + return std::strong_ordering::equal; + } + return std::strong_ordering::greater; +#endif + } + + /// Equality operator. + template + bool operator==(const Other& _other) const { + return (*this <=> _other) == 0; + } + + /// Alias for .name(). + std::string reflection() const { return name(); } + + /// Returns the number of fields in the Literal. + static constexpr size_t size() { return num_fields_; } + + /// Alias for .name(). + std::string str() const { return name(); } + + /// Alias for .names(). + static std::vector strings() { + return allowed_strings_vec(std::make_integer_sequence()); + } + + /// Returns the value actually contained in the Literal. + ValueType value() const { return value_; } + + /// Returns the value of the string literal in the template. + template + static constexpr ValueType value_of() { + constexpr auto value = find_value_of<_name>(); + static_assert(value >= 0, "String not supported."); + return value; + } + + private: + /// Only the static methods are allowed to access this. + Literal(const ValueType _value) : value_(_value) {} + + /// Returns all of the allowed fields. + static std::string allowed_strings() { + const auto vec = + allowed_strings_vec(std::make_integer_sequence()); + std::string str; + for (size_t i = 0; i < vec.size(); ++i) { + const auto head = "'" + vec[i] + "'"; + str += i == 0 ? head : (", " + head); + } + return str; + } + + /// Returns all of the allowed fields. + template + static std::vector allowed_strings_vec( + std::integer_sequence) { + std::vector values; + (allowed_strings_vec_add_one<_is>(&values), ...); + return values; + } + + template + static void allowed_strings_vec_add_one(std::vector* _values) { + using FieldType = tuple_element_t<_i, FieldsType>; + _values->emplace_back(FieldType::name_.str()); + } + + /// Finds the correct index associated with + /// the string at run time. + std::string find_name() const { + return find_name_set_str(std::make_integer_sequence()); + } + + template + std::string find_name_set_str(std::integer_sequence) const { + std::string name; + (find_name_set_if_matches<_is>(&name), ...); + return name; + } + + template + void find_name_set_if_matches(std::string* _name) const { + if (_i == value_) { + using FieldType = tuple_element_t<_i, FieldsType>; + *_name = FieldType::name_.str(); + } + } + + /// Finds the correct index associated with + /// the string at compile time within the Literal's own fields. + template + constexpr static auto find_name_within_own_fields() { + return tuple_element_t<_i, FieldsType>::name_; + } + + /// Finds the correct value associated with + /// the string at run time. + static Result find_value(const std::string& _str) { + bool found = false; + const auto idx = find_value_set_idx( + _str, &found, std::make_integer_sequence()); + if (!found) { + return error( + "Literal does not support string '" + _str + + "'. The following strings are supported: " + allowed_strings() + "."); + } + return idx; + } + + template + static int find_value_set_idx(const std::string& _str, bool* _found, + std::integer_sequence) { + int idx = 0; + (find_value_set_if_matches<_is>(_str, _found, &idx), ...); + return idx; + } + + template + static void find_value_set_if_matches(const std::string& _str, bool* _found, + int* _idx) { + using FieldType = tuple_element_t<_i, FieldsType>; + if (!*_found && FieldType::name_.string_view() == _str) { + *_idx = _i; + *_found = true; + } + } + + /// Finds the value of a string literal at compile time. + template + static constexpr int find_value_of() { + return internal::find_index_or_minus_one<_name, FieldsType>(); + } + + /// Whether the literal contains this string. + static void has_value(const std::string& _str, bool* _found) { + find_value_set_idx(_str, _found, + std::make_integer_sequence()); + } + + static_assert(sizeof...(fields_) <= std::numeric_limits::max(), + "Too many fields."); + + static_assert(sizeof...(fields_) <= 1 || !has_duplicates(), + "Duplicate strings are not allowed in a Literal."); + + private: + /// The underlying value. + ValueType value_; +}; + +/// Helper function to retrieve a name at compile time. +template +inline constexpr auto name_of() { + return LiteralType::template name_of<_value>(); +} + +/// Helper function to retrieve a value at compile time. +template +inline constexpr auto value_of() { + return LiteralType::template value_of<_name>(); +} + +} // namespace rfl + +namespace std { +template +struct hash> { + size_t operator()(const rfl::Literal& _l) const { + return hash()(static_cast(_l.value())); + } +}; + +} // namespace std + +#endif // RFL_LITERAL_HPP_ diff --git a/build-config/reflect-cpp/include/rfl/MetaField.hpp b/build-config/reflect-cpp/include/rfl/MetaField.hpp new file mode 100644 index 0000000..d55cbb2 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/MetaField.hpp @@ -0,0 +1,32 @@ +#ifndef RFL_METAFIELD_HPP_ +#define RFL_METAFIELD_HPP_ + +#include + +namespace rfl { + +/// Contains meta-information about a field in a struct. +class MetaField { + public: + MetaField(const std::string& _name, const std::string& _type) + : name_(_name), type_(_type) {} + + ~MetaField() = default; + + /// The name of the field we describe. + const std::string& name() const { return name_; }; + + /// The type of the field we describe. + const std::string& type() const { return type_; }; + + private: + /// The name of the field we describe. + std::string name_; + + /// The type of the field we describe. + std::string type_; +}; + +} // namespace rfl + +#endif // RFL_TAGGEDUNION_HPP_ diff --git a/build-config/reflect-cpp/include/rfl/NamedTuple.hpp b/build-config/reflect-cpp/include/rfl/NamedTuple.hpp new file mode 100644 index 0000000..ca75952 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/NamedTuple.hpp @@ -0,0 +1,681 @@ +#ifndef RFL_NAMEDTUPLE_HPP_ +#define RFL_NAMEDTUPLE_HPP_ + +#include +#include +#include +#include + +#include "Field.hpp" +#include "Literal.hpp" +#include "Tuple.hpp" +#include "apply.hpp" +#include "get.hpp" +#include "internal/StringLiteral.hpp" +#include "internal/find_index.hpp" +#include "internal/is_extra_fields.hpp" +#include "make_from_tuple.hpp" +#include "tuple_cat.hpp" + +namespace rfl { + +/// A named tuple behaves like a tuple, +/// but the fields have explicit names, which +/// allows for reflection. +/// IMPORTANT: We have two template specializations. One with fields, one +/// without fields. +template +class NamedTuple; + +// ---------------------------------------------------------------------------- + +template +class NamedTuple { + template + struct Index {}; + + static constexpr auto seq_ = + std::make_integer_sequence(); + + public: + using Fields = rfl::Tuple...>; + using Names = Literal::name_...>; + using Values = rfl::Tuple::Type...>; + + public: + /// Construct from the values. + NamedTuple(typename std::remove_cvref::type::Type&&... _values) + : values_( + std::forward::type::Type>( + _values)...) {} + + /// Construct from the values. + NamedTuple( + const typename std::remove_cvref::type::Type&... _values) + : values_(rfl::make_tuple(_values...)) {} + + /// Construct from the fields. + NamedTuple(FieldTypes&&... _fields) + : values_(rfl::make_tuple(std::move(_fields.value_)...)) {} + + /// Construct from the fields. + NamedTuple(const FieldTypes&... _fields) + : values_(rfl::make_tuple(_fields.value_...)) {} + + /// Construct from a tuple containing fields. + NamedTuple(rfl::Tuple&& _tup) + : NamedTuple(rfl::make_from_tuple>( + std::forward>(_tup))) {} + + /// Construct from a tuple containing fields. + NamedTuple(const rfl::Tuple& _tup) + : NamedTuple(rfl::make_from_tuple>(_tup)) {} + + /// Copy constructor. + NamedTuple(const NamedTuple& _other) = default; + + /// Move constructor. + NamedTuple(NamedTuple&& _other) = default; + + /// Copy constructor. + template + NamedTuple(const NamedTuple& _other) + : NamedTuple(retrieve_fields(_other.fields(), seq_)) {} + + /// Move constructor. + template + NamedTuple(NamedTuple&& _other) + : NamedTuple(retrieve_fields( + std::forward>(_other).fields(), + seq_)) {} + + ~NamedTuple() = default; + + /// Returns a new named tuple with additional fields. + template + auto add(Field<_name, FType>&& _head, Tail&&... _tail) && { + using Head = Field<_name, FType>; + if constexpr (sizeof...(Tail) > 0) { + return NamedTuple>( + std::move(*this).make_fields(seq_, std::forward(_head))) + .add(std::forward(_tail)...); + } else { + return NamedTuple>( + std::move(*this).make_fields(seq_, std::forward(_head))); + } + } + + /// Returns a new named tuple with additional fields. + template + auto add(Field<_name, FType> _head, const Tail&... _tail) const& { + using Head = Field<_name, FType>; + if constexpr (sizeof...(Tail) > 0) { + return NamedTuple>( + make_fields(seq_, _head)) + .add(_tail...); + } else { + return NamedTuple>( + make_fields(seq_, _head)); + } + } + + /// Template specialization for rfl::Tuple, so we can pass fields from other + /// named tuples. + template + auto add(rfl::Tuple&& _tuple, Tail&&... _tail) && { + if constexpr (sizeof...(Tail) > 0) { + return std::move(*this) + .add_tuple(std::forward>(_tuple)) + .add(std::forward(_tail)...); + } else { + return std::move(*this).add_tuple( + std::forward>(_tuple)); + } + } + + /// Template specialization for rfl::Tuple, so we can pass fields from other + /// named tuples. + template + auto add(rfl::Tuple _tuple, const Tail&... _tail) const& { + if constexpr (sizeof...(Tail) > 0) { + return add_tuple(std::move(_tuple)).add(_tail...); + } else { + return add_tuple(std::move(_tuple)); + } + } + + /// Template specialization for NamedTuple, so we can pass fields from other + /// named tuples. + template + auto add(NamedTuple&& _named_tuple, Tail&&... _tail) && { + return std::move(*this).add( + std::forward>( + std::forward>(_named_tuple).fields()), + std::forward(_tail)...); + } + + /// Template specialization for NamedTuple, so we can pass fields from other + /// named tuples. + template + auto add(NamedTuple _named_tuple, + const Tail&... _tail) const& { + return add(_named_tuple.fields(), _tail...); + } + + /// Creates a new named tuple by applying the supplied function to + /// field. The function is expected to return a named tuple itself. + template + auto and_then(const F& _f) && { + const auto transform_field = [&_f](auto... _fields) { + return rfl::tuple_cat(_f(std::move(_fields)).fields()...); + }; + const auto to_nt = [](rfl::Tuple&& _tup) { + return NamedTuple(_tup); + }; + auto new_fields = rfl::apply(transform_field, std::move(*this).fields()); + return to_nt(std::move(new_fields)); + } + + /// Creates a new named tuple by applying the supplied function to + /// field. The function is expected to return a named tuple itself. + template + auto and_then(const F& _f) const& { + const auto transform_field = [&_f](auto... _fields) { + return rfl::tuple_cat(_f(std::move(_fields)).fields()...); + }; + const auto to_nt = [](rfl::Tuple&& _tup) { + return NamedTuple(_tup); + }; + auto new_fields = rfl::apply(transform_field, std::move(fields())); + return to_nt(std::move(new_fields)); + } + + /// Invokes a callable object once for each field in order. + template + void apply(F&& _f) const& { + const auto apply_to_field = [&_f](const auto&... fields) { + ((_f(fields)), ...); + }; + rfl::apply(apply_to_field, fields()); + } + + /// Returns a tuple containing the fields. + Fields fields() && { return std::move(*this).make_fields(seq_); } + + /// Returns a tuple containing the fields. + Fields fields() const& { return make_fields(seq_); } + + /// Gets a field by index. + template + auto& get() { + return rfl::get<_index>(*this); + } + + /// Gets a field by name. + template + auto& get() { + return rfl::get<_field_name>(*this); + } + + /// Gets a field by the field type. + template + auto& get() { + return rfl::get(*this); + } + + /// Gets a field by index. + template + const auto& get() const { + return rfl::get<_index>(*this); + } + + /// Gets a field by name. + template + const auto& get() const { + return rfl::get<_field_name>(*this); + } + + /// Gets a field by the field type. + template + const auto& get() const { + return rfl::get(*this); + } + + /// Returns the results wrapped in a field. + template + auto get_field() const { + return rfl::make_field<_field_name>(rfl::get<_field_name>(*this)); + } + + /// Copy assignment operator. + NamedTuple& operator=( + const NamedTuple& _other) = default; + + /// Move assignment operator. + NamedTuple& operator=( + NamedTuple&& _other) noexcept = default; + + /// Equality operator + inline auto operator==(const rfl::NamedTuple& _other) const { + return values() == _other.values(); + } + + /// Three-way comparison operator. + inline auto operator<=>(const rfl::NamedTuple& _other) const { + return values() <=> _other.values(); + } + + /// Returns the number of fields. Note that this is not necessary the same + /// thing as .size(), because there might be rfl::ExtraFields, which are + /// simply counted as one entry by .size(), but are counted by individually by + /// .num_fields(). + size_t num_fields() const { + if constexpr (pos_extra_fields() == -1) { + return size(); + } else { + return calc_num_fields(); + } + } + + /// The position of the extra fields, or -1 if there aren't any. + constexpr static int pos_extra_fields() { return pos_extra_fields_; } + + /// Replaces one or several fields, returning a new version + /// with the non-replaced fields left unchanged. + template + auto replace(Field<_name, FType>&& _field, + OtherRFields&&... _other_fields) && { + using RField = Field<_name, FType>; + constexpr auto num_other_fields = sizeof...(OtherRFields); + if constexpr (num_other_fields == 0) { + return std::move(*this).template replace_value(_field.value_); + } else { + return std::move(*this) + .template replace_value(_field.value_) + .replace(std::forward(_other_fields)...); + } + } + + /// Replaces one or several fields, returning a new version + /// with the non-replaced fields left unchanged. + template + auto replace(Field<_name, FType> _field, + const OtherRFields&... _other_fields) const& { + using RField = Field<_name, FType>; + constexpr auto num_other_fields = sizeof...(OtherRFields); + if constexpr (num_other_fields == 0) { + return replace_value(std::move(_field.value_)); + } else { + return replace_value(std::move(_field.value_)) + .replace(_other_fields...); + } + } + + /// Template specialization for rfl::Tuple, so we can pass fields from other + /// named tuples. + template + auto replace(rfl::Tuple&& _tuple, Tail&&... _tail) && { + if constexpr (sizeof...(Tail) > 0) { + return std::move(*this) + .replace_tuple(std::forward>(_tuple)) + .replace(std::forward(_tail)...); + } else { + return std::move(*this).replace_tuple( + std::forward>(_tuple)); + } + } + + /// Template specialization for rfl::Tuple, so we can pass fields from other + /// named tuples. + template + auto replace(rfl::Tuple _tuple, const Tail&... _tail) const& { + if constexpr (sizeof...(Tail) > 0) { + return replace_tuple(std::move(_tuple)).replace(_tail...); + } else { + return replace_tuple(std::move(_tuple)); + } + } + + /// Template specialization for NamedTuple, so we can pass fields from other + /// named tuples. + template + auto replace(NamedTuple&& _named_tuple, Tail&&... _tail) && { + return std::move(*this).replace( + std::forward>(_named_tuple).fields(), + std::forward(_tail)...); + } + + /// Template specialization for NamedTuple, so we can pass fields from other + /// named tuples. + template + auto replace(NamedTuple _named_tuple, + const Tail&... _tail) const& { + return replace(_named_tuple.fields(), _tail...); + } + + /// Returns the size of the named tuple + static constexpr size_t size() { return rfl::tuple_size_v; } + + /// Creates a new named tuple by applying the supplied function to every + /// field. + template + auto transform(const F& _f) && { + const auto transform_field = [&_f](auto... fields) { + return rfl::make_tuple(_f(std::move(fields))...); + }; + const auto to_nt = [](rfl::Tuple&& _tup) { + return NamedTuple(_tup); + }; + auto new_fields = rfl::apply(transform_field, std::move(*this).fields()); + return to_nt(std::move(new_fields)); + } + + /// Creates a new named tuple by applying the supplied function to every + /// field. + template + auto transform(const F& _f) const& { + const auto transform_field = [&_f](auto... fields) { + return rfl::make_tuple(_f(std::move(fields))...); + }; + const auto to_nt = [](rfl::Tuple&& _tup) { + return NamedTuple(_tup); + }; + auto new_fields = rfl::apply(transform_field, std::move(fields())); + return to_nt(std::move(new_fields)); + } + + /// Returns the underlying rfl::Tuple. + Values& values() { return values_; } + + /// Returns the underlying rfl::Tuple. + const Values& values() const { return values_; } + + private: + /// Adds the elements of a tuple to a newly created named tuple, + /// and other elements to a newly created named tuple. + template + constexpr auto add_tuple(rfl::Tuple&& _tuple) && { + const auto a = [this](auto&&... _fields) { + return std::move(*this).add(std::forward(_fields)...); + }; + return rfl::apply(a, std::forward>(_tuple)); + } + + /// Adds the elements of a tuple to a newly created named tuple, + /// and other elements to a newly created named tuple. + template + constexpr auto add_tuple(rfl::Tuple&& _tuple) const& { + const auto a = [this](auto&&... _fields) { + return this->add(std::forward(_fields)...); + }; + return rfl::apply(a, std::forward>(_tuple)); + } + + /// Unfortunately, MSVC forces us to do this... + template + size_t calc_num_fields() const { + const auto& extra_fields = get<_pos>(); + if constexpr (std::is_pointer_v< + std::remove_cvref_t>) { + return size() + extra_fields->size() - 1; + } else { + return size() + extra_fields.size() - 1; + } + } + + /// Finds the position of the extra fields, or -1 if there aren't any. + template + constexpr static int find_extra_fields() { + if constexpr (_i == size()) { + return _idx; + } else { + using FieldType = internal::nth_element_t<_i, FieldTypes...>; + constexpr bool is_extra_fields = + internal::is_extra_fields_v; + static_assert(_idx == -1 || !is_extra_fields, + "There can only be one rfl::ExtraFields in any struct or " + "named tuple."); + if constexpr (is_extra_fields) { + return find_extra_fields<_i + 1, _i>(); + } else { + return find_extra_fields<_i + 1, _idx>(); + } + } + } + + /// Generates the fields. + template + auto make_fields(std::integer_sequence, + AdditionalArgs&&... _args) && { + const auto wrap = [this](Index<_i>) { + using FieldType = internal::nth_element_t<_i, FieldTypes...>; + return FieldType(std::move(rfl::get<_i>(values_))); + }; + return rfl::make_tuple(wrap(Index<_is>{})..., + std::forward(_args)...); + } + + /// Generates the fields. + template + auto make_fields(std::integer_sequence, + AdditionalArgs... _args) const& { + const auto wrap = [this](Index<_i>) { + using FieldType = internal::nth_element_t<_i, FieldTypes...>; + return FieldType(rfl::get<_i>(values_)); + }; + return rfl::make_tuple(wrap(Index<_is>{})..., _args...); + } + + /// Generates a new named tuple with one value replaced with a new value. + template + auto make_replaced(V&& _values, T&& _val, + std::integer_sequence) const { + const auto wrap = [&](Index<_i>) { + if constexpr (_i == _index) { + return std::forward(_val); + } else { + using FieldType = internal::nth_element_t<_i, FieldTypes...>; + using U = typename FieldType::Type; + return FieldType(std::forward(rfl::get<_i>(_values))); + } + }; + return NamedTuple(wrap(Index<_is>{})...); + } + + /// Replaced the field signified by the field type. + template + NamedTuple replace_value(T&& _val) && { + using FieldType = std::remove_cvref_t; + constexpr auto index = internal::find_index(); + return make_replaced(std::move(values_), std::forward(_val), + seq_); + } + + /// Replaced the field signified by the field type. + template + NamedTuple replace_value(T&& _val) const& { + using FieldType = std::remove_cvref_t; + constexpr auto index = internal::find_index(); + auto values = values_; + return make_replaced(std::move(values), std::forward(_val), seq_); + } + + /// Adds the elements of a tuple to a newly created named tuple, + /// and other elements to a newly created named tuple. + template + auto replace_tuple(rfl::Tuple&& _tuple) && { + const auto r = [this](auto&&... _fields) { + return std::move(*this).replace(std::forward(_fields)...); + }; + return rfl::apply(r, std::forward>(_tuple)); + } + + /// Adds the elements of a tuple to a newly created named tuple, + /// and other elements to a newly created named tuple. + template + auto replace_tuple(rfl::Tuple&& _tuple) const& { + const auto r = [this](auto&&... _fields) { + return this->replace(std::forward(_fields)...); + }; + return rfl::apply(r, std::forward>(_tuple)); + } + + /// Retrieves the fields from another tuple. + template + constexpr static Fields retrieve_fields( + rfl::Tuple&& _other_fields, + std::integer_sequence) { + const auto get_field = [&](Index<_i>) { + constexpr auto field_name = + internal::nth_element_t<_i, FieldTypes...>::name_; + constexpr auto index = + internal::find_index>(); + using FieldType = internal::nth_element_t<_i, FieldTypes...>; + using T = std::remove_cvref_t; + return FieldType(std::forward(rfl::get(_other_fields).value_)); + }; + return rfl::make_tuple(get_field(Index<_is>{})...); + } + + private: + /// The values actually contained in the named tuple. + /// As you can see, a NamedTuple is just a normal tuple under-the-hood, + /// everything else is resolved at compile time. It should have no + /// runtime overhead over a normal rfl::Tuple. + Values values_; + + /// The position of rfl::ExtraFields, or -1 if there aren't any. + constexpr static int pos_extra_fields_ = find_extra_fields(); +}; + +// ---------------------------------------------------------------------------- + +/// We need a special template instantiation for empty named tuples. +template <> +class NamedTuple<> { + public: + using Fields = rfl::Tuple<>; + using Names = Literal<>; + using Values = rfl::Tuple<>; + + NamedTuple(){}; + + ~NamedTuple() = default; + + /// Returns a new named tuple with additional fields. + template + auto add(Field<_name, FType> _head, const Tail&... _tail) const { + if constexpr (sizeof...(Tail) > 0) { + return NamedTuple>(std::move(_head)).add(_tail...); + } else { + return NamedTuple>(std::move(_head)); + } + } + + /// Template specialization for rfl::Tuple, so we can pass fields from other + /// named tuples. + template + auto add(rfl::Tuple _tuple, const Tail&... _tail) const { + if constexpr (sizeof...(Tail) > 0) { + return NamedTuple(std::move(_tuple)).add(_tail...); + } else { + return NamedTuple(std::move(_tuple)); + } + } + + /// Template specialization for NamedTuple, so we can pass fields from other + /// named tuples. + template + auto add(NamedTuple _named_tuple, const Tail&... _tail) const { + return add(_named_tuple.fields(), _tail...); + } + + /// Returns an empty named tuple. + template + auto and_then(const F&) const { + return NamedTuple<>(); + } + + /// Does nothing at all. + template + void apply(F&&) const {} + + /// Returns an empty tuple. + auto fields() const { return rfl::Tuple(); } + + /// Must always be 0. + size_t num_fields() const { return 0; } + + /// Must always be -1. + constexpr static int pos_extra_fields() { return -1; } + + /// Must always be 0. + static constexpr size_t size() { return 0; } + + /// Returns an empty named tuple. + template + auto transform(const F&) const { + return NamedTuple<>(); + } + + /// Returns an empty tuple. + auto values() const { return rfl::Tuple(); } +}; + +// ---------------------------------------------------------------------------- + +template +inline auto operator*(const rfl::Field<_name1, Type1>& _f1, + const rfl::Field<_name2, Type2>& _f2) { + return NamedTuple(_f1, _f2); +} + +template +inline auto operator*(const NamedTuple& _tup, + const rfl::Field<_name, Type>& _f) { + return _tup.add(_f); +} + +template +inline auto operator*(const rfl::Field<_name, Type>& _f, + const NamedTuple& _tup) { + return NamedTuple(_f).add(_tup); +} + +template +inline auto operator*(const NamedTuple& _tup1, + const NamedTuple& _tup2) { + return _tup1.add(_tup2); +} + +template +inline auto operator*(rfl::Field<_name1, Type1>&& _f1, + rfl::Field<_name2, Type2>&& _f2) { + return NamedTuple(std::forward>(_f1), + std::forward>(_f2)); +} + +template +inline auto operator*(NamedTuple&& _tup, + rfl::Field<_name, Type>&& _f) { + return _tup.add(std::forward>(_f)); +} + +template +inline auto operator*(rfl::Field<_name, Type>&& _f, + NamedTuple&& _tup) { + return NamedTuple(std::forward>(_f)) + .add(std::forward>(_tup)); +} + +template +inline auto operator*(NamedTuple&& _tup1, + NamedTuple&& _tup2) { + return _tup1.add(std::forward>(_tup2)); +} + +} // namespace rfl + +#endif // RFL_NAMEDTUPLE_HPP_ diff --git a/build-config/reflect-cpp/include/rfl/NoExtraFields.hpp b/build-config/reflect-cpp/include/rfl/NoExtraFields.hpp new file mode 100644 index 0000000..85cf82a --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/NoExtraFields.hpp @@ -0,0 +1,19 @@ +#ifndef RFL_NOEXTRAFIELDS_HPP_ +#define RFL_NOEXTRAFIELDS_HPP_ + +namespace rfl { + +/// This is a "fake" processor - it doesn't do much in itself, but its +/// inclusion instructs the parsers to return an error when there are extra +/// fields instead of ignoring them. +struct NoExtraFields { + public: + template + static auto process(auto&& _named_tuple) { + return _named_tuple; + } +}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/NoFieldNames.hpp b/build-config/reflect-cpp/include/rfl/NoFieldNames.hpp new file mode 100644 index 0000000..91677ab --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/NoFieldNames.hpp @@ -0,0 +1,18 @@ +#ifndef RFL_NOFIELDNAMES_HPP_ +#define RFL_NOFIELDNAMES_HPP_ + +namespace rfl { + +/// This is a "fake" processor - it doesn't do much in itself, but its +/// inclusion instructs the parsers to strip field names. +struct NoFieldNames { + public: + template + static auto process(auto&& _named_tuple) { + return _named_tuple; + } +}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/NoOptionals.hpp b/build-config/reflect-cpp/include/rfl/NoOptionals.hpp new file mode 100644 index 0000000..9a7b3cd --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/NoOptionals.hpp @@ -0,0 +1,18 @@ +#ifndef RFL_NOOPTIONALS_HPP_ +#define RFL_NOOPTIONALS_HPP_ + +namespace rfl { + +/// This is a "fake" processor - it doesn't do much in itself, but its +/// inclusion instructs the parsers to require the inclusion of all fields. +struct NoOptionals { + public: + template + static auto process(auto&& _named_tuple) { + return _named_tuple; + } +}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/Object.hpp b/build-config/reflect-cpp/include/rfl/Object.hpp new file mode 100644 index 0000000..9a02be1 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/Object.hpp @@ -0,0 +1,248 @@ +#ifndef RFL_OBJECT_HPP_ +#define RFL_OBJECT_HPP_ + +#include +#include +#include +#include +#include +#include + +#include "Result.hpp" + +namespace rfl { + +/// Used to embed additional fields for which the names cannot be known in +/// advance and can therefore not be encoded in the struct. +template +class Object { + public: + using DataType = std::vector>; + using Type = T; + + /// We want this to behave as similarly to C++ standard containers as + /// possible. + using key_type = std::string; + using mapped_type = T; + using value_type = std::pair; + using size_type = typename DataType::size_type; + using difference_type = typename DataType::size_type; + using reference = value_type&; + using const_reference = const value_type&; + using pointer = typename DataType::pointer; + using const_pointer = typename DataType::const_pointer; + using iterator = typename DataType::iterator; + using const_iterator = typename DataType::const_iterator; + using reverse_iterator = typename DataType::reverse_iterator; + using const_reverse_iterator = typename DataType::const_reverse_iterator; + + Object() : data_(), i_(0) {} + + Object(const Object& _f) = default; + + Object(Object&& _f) noexcept = default; + + ~Object() = default; + + /// Iterator to the beginning. + auto begin() { return data_.begin(); } + + /// Iterator to the beginning. + auto begin() const { return data_.begin(); } + + /// Const iterator to the beginning. + auto cbegin() const { return data_.cbegin(); } + + /// Iterator to the end. + auto end() { return data_.end(); } + + /// Iterator to the end. + auto end() const { return data_.end(); } + + /// Const iterator to the end. + auto cend() const { return data_.cend(); } + + /// Reverse iterator. + auto rbegin() { return data_.rbegin(); } + + /// Reverse iterator. + auto rbegin() const { return data_.rbegin(); } + + /// Const reverse iterator. + auto crbegin() const { return data_.crbegin(); } + + /// Reverse iterator. + auto rend() { return data_.rend(); } + + /// Reverse iterator. + auto rend() const { return data_.rend(); } + + /// Const reverse iterator. + auto crend() const { return data_.crend(); } + + Object& operator=(const Object& _f) = default; + + Object& operator=(Object&& _f) = default; + + /// Whether the object is empty. + auto empty() const { return data_.size() == 0; } + + /// The number of elements currently inside the object. + auto size() const { return data_.size(); } + + std::size_t count(const key_type& key) const { return std::count_if(cbegin(), cend(), [&](const auto& p) { return p.first == key; }); } + + /// The maximum possible size. + auto max_size() const { return data_.max_size(); } + + /// Inserts a new element at the end. + template + void insert(const Args&... _values) { + (data_.push_back(_values), ...); + i_ = 0; + } + + /// Inserts a new element at the end. + template + void insert(Args&&... _values) { + (data_.emplace_back(std::move(_values)), ...); + i_ = 0; + } + + /// Inserts a new element at the end. + void insert(const std::string& _k, const T& _v) { + insert(std::make_pair(_k, _v)); + } + + /// Inserts a new element at the end. + void insert(const std::string& _k, T&& _v) { + insert(std::make_pair(_k, std::move(_v))); + } + + /// Inserts a new element at the end. + void insert(std::string&& _k, T&& _v) { + insert(std::make_pair(std::move(_k), std::move(_v))); + } + + /// Inserts a new element at the end. + void insert(const std::string_view& _k, const T& _v) { + insert(std::make_pair(std::string(_k), _v)); + } + + /// Inserts a new element at the end. + void insert(const std::string_view& _k, T&& _v) { + insert(std::make_pair(std::string(_k), std::move(_v))); + } + + /// Alias for insert that primarily exists for compatability with standard + /// containers. + template + void emplace(Args&&... _args) { + insert(std::forward(_args)...); + } + + /// Alias for insert that primarily exists for compatability with standard + /// containers. + template + void emplace(const Args&... _args) { + insert(_args...); + } + + /// Inserts several new elements at the end. + template + void insert_range(InputIt _first, InputIt _last) { + for (auto it = _first; it != _last; ++it) { + insert(*it); + } + } + + /// Inserts several new elements at the end. + template + void insert_range(RangeType _range) { + for (const auto& val : _range) { + insert(val); + } + } + + /// Returns the element signified by the key or creates a new one. + T& operator[](const std::string& _key) { + const auto i = find(_key); + if (i != size()) { + return data_[i].second; + } + data_.emplace_back(std::make_pair(_key, T())); + i_ = 0; + return data_.back().second; + } + + /// Returns the element signified by the key or creates a new one. + T& operator[](std::string&& _key) { + const auto i = find(_key); + if (i != size()) { + return data_[i].second; + } + data_.emplace_back(std::make_pair(std::move(_key), T())); + i_ = 0; + return data_.back().second; + } + + /// Deletes all elements. + void clear() { + data_.clear(); + i_ = 0; + } + + /// Returns the element signified by the key or throws an exception. + T& at(const std::string& _key) { + const auto i = find(_key); + if (i == size()) { + throw std::runtime_error("Key named '" + _key + "' not found."); + } + return data_[i].second; + } + + /// Returns the element signified by the key or throws an exception. + const T& at(const std::string& _key) const { + const auto i = find(_key); + if (i == size()) { + throw std::runtime_error("Key named '" + _key + "' not found."); + } + return data_[i].second; + } + + /// Returns a result wrapping the element signified by the key. + Result get(const std::string& _key) const noexcept { + const auto i = find(_key); + if (i == size()) { + return error("Key named '" + _key + "' not found."); + } + return data_[i].second; + } + + private: + size_t find(const std::string& _key) const { + for (size_t i = i_; i < size(); ++i) { + if (data_[i].first == _key) { + i_ = i + 1; + return i; + } + } + for (size_t i = 0; i < i_; ++i) { + if (data_[i].first == _key) { + i_ = i + 1; + return i; + } + } + return size(); + } + + private: + DataType data_; + + /// Allows faster access + mutable size_t i_; +}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/Oct.hpp b/build-config/reflect-cpp/include/rfl/Oct.hpp new file mode 100644 index 0000000..b466df0 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/Oct.hpp @@ -0,0 +1,130 @@ +#ifndef RFL_OCT_HPP_ +#define RFL_OCT_HPP_ + +#include +#include +#include +#include +#include +#include +#include + +namespace rfl { + +/// Used to define a field in the NamedTuple. +template +requires std::is_integral_v +struct Oct { + /// The underlying type. + using Type = T; + + using ReflectionType = std::string; + + Oct() : value_(0) {} + + Oct(const Type& _value) : value_(_value) {} + + Oct(Oct&& _other) noexcept = default; + + Oct(const Oct& _other) = default; + + template + Oct(const Oct& _other) : value_(_other.get()) {} + + template + Oct(Oct&& _other) : value_(_other.get()) {} + + template , + bool>::type = true> + Oct(const U& _value) : value_(_value) {} + + template , + bool>::type = true> + Oct(U&& _value) noexcept : value_(std::forward(_value)) {} + + template , + bool>::type = true> + Oct(const Oct& _other) : value_(_other.value()) {} + + Oct(const std::string& _str) { + std::istringstream(_str) >> std::oct >> value_; + } + + ~Oct() = default; + + /// Returns the underlying object. + const Type& get() const { return value_; } + + /// Returns the underlying object. + Type& operator()() { return value_; } + + /// Returns the underlying object. + const Type& operator()() const { return value_; } + + /// Assigns the underlying object. + auto& operator=(const Type& _value) { + value_ = _value; + return *this; + } + + /// Assigns the underlying object. + template , + bool>::type = true> + auto& operator=(const U& _value) { + value_ = _value; + return *this; + } + + /// Assigns the underlying object. + Oct& operator=(const Oct& _other) = default; + + /// Assigns the underlying object. + Oct& operator=(Oct&& _other) = default; + + /// Assigns the underlying object. + template + auto& operator=(const Oct& _other) { + value_ = _other.get(); + return *this; + } + + /// Assigns the underlying object. + template + auto& operator=(const std::string& _str) { + std::istringstream(_str) >> std::oct >> value_; + return *this; + } + + /// Assigns the underlying object. + template + auto& operator=(Oct&& _other) { + value_ = std::forward(_other.value_); + return *this; + } + + /// Necessary for the automated parsing to work. + std::string reflection() const { + std::stringstream stream; + stream << std::oct << value_; + return stream.str(); + } + + /// Assigns the underlying object. + void set(const Type& _value) { value_ = _value; } + + /// Returns the underlying value as a string, alias for .reflection(). + std::string str() const { return reflection(); } + + /// Returns the underlying object. + Type& value() { return value_; } + + /// Returns the underlying object. + const Type& value() const { return value_; } + + /// The underlying value. + Type value_; +}; + +} // namespace rfl + +#endif // RFL_FIELD_HPP_ diff --git a/build-config/reflect-cpp/include/rfl/OneOf.hpp b/build-config/reflect-cpp/include/rfl/OneOf.hpp new file mode 100644 index 0000000..e47d77b --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/OneOf.hpp @@ -0,0 +1,71 @@ +#ifndef RFL_ONEOF_HPP_ +#define RFL_ONEOF_HPP_ + +#include +#include +#include +#include + +#include "Result.hpp" +#include "parsing/schema/ValidationType.hpp" + +namespace rfl { + +/// Requires that all of the contraints C and Cs be true. +template +struct OneOf { + template + static rfl::Result validate(const T& _value) noexcept { + return validate_impl(_value, {}); + } + + template + static parsing::schema::ValidationType to_schema() { + using ValidationType = parsing::schema::ValidationType; + const auto types = std::vector( + {C::template to_schema(), Cs::template to_schema()...}); + return ValidationType{ValidationType::OneOf{.types_ = types}}; + } + + private: + static std::string make_error_message(const std::vector& _errors) { + std::stringstream stream; + stream << "Expected exactly 1 out of " << sizeof...(Cs) + 1 + << " validations to pass, but " << sizeof...(Cs) + 1 - _errors.size() + << " of them did. The following errors were generated: "; + for (size_t i = 0; i < _errors.size(); ++i) { + stream << "\n" << i + 1 << ") " << _errors.at(i).what(); + } + return stream.str(); + } + + template + static rfl::Result validate_impl(const T& _value, + std::vector _errors) { + return Head::validate(_value) + .and_then([&](auto&& _result) -> rfl::Result { + if constexpr (sizeof...(Tail) == 0) { + if (_errors.size() == sizeof...(Cs)) { + return _value; + // The AI suggests return std::forward(_result); + // is it correct in this context? + } + return error(make_error_message(_errors)); + } else { + return validate_impl(_value, std::move(_errors)); + } + }) + .or_else([&](auto&& _err) -> rfl::Result { + _errors.emplace_back(std::move(_err)); + if constexpr (sizeof...(Tail) == 0) { + return error(make_error_message(_errors)); + } else { + return validate_impl(_value, std::move(_errors)); + } + }); + } +}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/Pattern.hpp b/build-config/reflect-cpp/include/rfl/Pattern.hpp new file mode 100644 index 0000000..47a4eb7 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/Pattern.hpp @@ -0,0 +1,14 @@ +#ifndef RFL_PATTERN_HPP_ +#define RFL_PATTERN_HPP_ + +#include "PatternValidator.hpp" +#include "Validator.hpp" + +namespace rfl { + +template +using Pattern = Validator>; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/PatternValidator.hpp b/build-config/reflect-cpp/include/rfl/PatternValidator.hpp new file mode 100644 index 0000000..ef18ee6 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/PatternValidator.hpp @@ -0,0 +1,46 @@ +#ifndef RFL_PATTERNVALIDATOR_HPP_ +#define RFL_PATTERNVALIDATOR_HPP_ + +#include +#include + +#if __has_include() +#include +#else +#include "thirdparty/ctre.hpp" +#endif + +#include "Literal.hpp" +#include "Result.hpp" +#include "internal/StringLiteral.hpp" +#include "parsing/schema/ValidationType.hpp" + +namespace rfl { + +template +struct PatternValidator { + using Name = Literal<_name>; + using Regex = Literal<_regex>; + + static Result validate(const std::string& _str) noexcept { + if (ctre::match{ + ctll::construct_from_pointer, _regex.arr_.data()}>(_str)) { + return _str; + } else { + std::stringstream stream; + stream << "String '" << _str << "' did not match format '" << _name.str() + << "': '" << _regex.str() << "'."; + return error(stream.str()); + } + } + + template + static parsing::schema::ValidationType to_schema() { + using ValidationType = parsing::schema::ValidationType; + return ValidationType{ValidationType::Regex{.pattern_ = Regex().str()}}; + } +}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/Processors.hpp b/build-config/reflect-cpp/include/rfl/Processors.hpp new file mode 100644 index 0000000..14707b1 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/Processors.hpp @@ -0,0 +1,83 @@ +#ifndef RFL_INTERNAL_PROCESSORS_HPP_ +#define RFL_INTERNAL_PROCESSORS_HPP_ + +#include +#include + +#include "internal/is_add_tags_to_variants_v.hpp" +#include "internal/is_allow_raw_ptrs_v.hpp" +#include "internal/is_default_if_missing_v.hpp" +#include "internal/is_no_extra_fields_v.hpp" +#include "internal/is_no_field_names_v.hpp" +#include "internal/is_no_optionals_v.hpp" +#include "internal/is_underlying_enums_v.hpp" + +namespace rfl { + +template +struct Processors; + +template <> +struct Processors<> { + static constexpr bool add_tags_to_variants_ = false; + static constexpr bool add_namespaced_tags_to_variants_ = false; + static constexpr bool allow_raw_ptrs_ = false; + static constexpr bool all_required_ = false; + static constexpr bool default_if_missing_ = false; + static constexpr bool no_extra_fields_ = false; + static constexpr bool no_field_names_ = false; + static constexpr bool underlying_enums_ = false; + + template + static auto process(NamedTupleType&& _named_tuple) { + return _named_tuple; + } +}; + +template +struct Processors { + static constexpr bool add_tags_to_variants_ = + std::disjunction_v, + internal::is_add_tags_to_variants...>; + + static constexpr bool add_namespaced_tags_to_variants_ = + std::disjunction_v, + internal::is_add_namespaced_tags_to_variants...>; + + static constexpr bool allow_raw_ptrs_ = + std::disjunction_v, + internal::is_allow_raw_ptrs...>; + + static constexpr bool all_required_ = + std::disjunction_v, + internal::is_no_optionals...>; + + static constexpr bool default_if_missing_ = + std::disjunction_v, + internal::is_default_if_missing...>; + + static constexpr bool no_extra_fields_ = + std::disjunction_v, + internal::is_no_extra_fields...>; + + static constexpr bool no_field_names_ = + std::disjunction_v, + internal::is_no_field_names...>; + + static constexpr bool underlying_enums_ = + std::disjunction_v, + internal::is_underlying_enums...>; + + template + static auto process(NamedTupleType&& _named_tuple) { + static_assert(!add_tags_to_variants_ || !add_namespaced_tags_to_variants_, + "You cannot add both rfl::AddTagsToVariants and " + "rfl::AddNamespacedTagsToVariants."); + return Processors::template process( + Head::template process(std::move(_named_tuple))); + } +}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/Ref.hpp b/build-config/reflect-cpp/include/rfl/Ref.hpp new file mode 100644 index 0000000..9818a80 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/Ref.hpp @@ -0,0 +1,146 @@ +#ifndef RFL_REF_HPP_ +#define RFL_REF_HPP_ + +#include +#include + +#include "Result.hpp" + +namespace rfl { + +/// The Ref class behaves very similarly to the shared_ptr, but unlike the +/// unique_ptr, it is 100% guaranteed to be filled at all times (unless the user +/// tries to access it after calling std::move does something else that is +/// clearly bad practice). +template +class Ref { + public: + /// The default way of creating new references is + /// Ref::make(...) or make_ref(...). + template + static Ref make(Args&&... _args) { + return Ref(std::make_shared(std::forward(_args)...)); + } + + /// You can generate them from shared_ptrs as well, in which case it will + /// return an Error, if the shared_ptr is not set. + static Result> make(std::shared_ptr&& _ptr) { + if (!_ptr) { + return error("std::shared_ptr was a nullptr."); + } + return Ref(std::move(_ptr)); + } + + /// You can generate them from shared_ptrs as well, in which case it will + /// return an Error, if the shared_ptr is not set. + static Result> make(const std::shared_ptr& _ptr) { + if (!_ptr) { + return error("std::shared_ptr was a nullptr."); + } + return Ref(_ptr); + } + + Ref() : ptr_(std::make_shared()) {} + + Ref(const Ref& _other) = default; + + Ref(Ref&& _other) = default; + + template + Ref(const Ref& _other) : ptr_(_other.ptr()) {} + + template + Ref(Ref&& _other) noexcept + : ptr_(std::forward>(_other.ptr())) {} + + ~Ref() = default; + + /// Returns a pointer to the underlying object + T* get() const { return ptr_.get(); } + + /// Returns the underlying object. + T& operator*() { return *ptr_; } + + /// Returns the underlying object. + T& operator*() const { return *ptr_; } + + /// Returns the underlying object. + T* operator->() { return ptr_.get(); } + + /// Returns the underlying object. + T* operator->() const { return ptr_.get(); } + + /// Returns the underlying shared_ptr + std::shared_ptr& ptr() { return ptr_; } + + /// Returns the underlying shared_ptr + const std::shared_ptr& ptr() const { return ptr_; } + + /// Copy assignment operator. + template + Ref& operator=(const Ref& _other) { + ptr_ = _other.ptr(); + return *this; + } + + /// Move assignment operator + template + Ref& operator=(Ref&& _other) noexcept { + ptr_ = std::forward>(_other.ptr()); + return *this; + } + + /// Move assignment operator + Ref& operator=(Ref&& _other) noexcept = default; + + /// Copy assignment operator + Ref& operator=(const Ref& _other) = default; + + private: + /// Only make is allowed to use this constructor. + explicit Ref(std::shared_ptr&& _ptr) : ptr_(std::move(_ptr)) {} + + /// Only make is allowed to use this constructor. + explicit Ref(const std::shared_ptr& _ptr) : ptr_(_ptr) {} + + private: + /// The underlying shared_ptr_ + std::shared_ptr ptr_; +}; + +/// Generates a new Ref. +template +auto make_ref(Args&&... _args) { + return Ref::make(std::forward(_args)...); +} + +template +inline auto operator<=>(const Ref& _t1, const Ref& _t2) { + return _t1.ptr() <=> _t2.ptr(); +} + +template +inline std::basic_ostream& operator<<( + std::basic_ostream& _os, const Ref& _b) { + _os << _b.get(); + return _os; +} + +} // namespace rfl + +namespace std { +template +struct hash> { + size_t operator()(const rfl::Ref& _r) const { + return std::hash>{}(_r.ptr()); + } +}; + +template +inline void swap(rfl::Ref& _r1, rfl::Ref& _r2) { + return swap(_r1.ptr(), _r2.ptr()); +} + +} // namespace std + +#endif // RFL_REF_HPP_ diff --git a/build-config/reflect-cpp/include/rfl/Rename.hpp b/build-config/reflect-cpp/include/rfl/Rename.hpp new file mode 100644 index 0000000..685c1e2 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/Rename.hpp @@ -0,0 +1,141 @@ +#ifndef RFL_RENAME_HPP_ +#define RFL_RENAME_HPP_ + +#include +#include +#include +#include +#include + +#include "Literal.hpp" +#include "default.hpp" +#include "internal/StringLiteral.hpp" + +namespace rfl { + +/// Used to assign a new name to a field, which is different from the name +/// inside the struct. +template +struct Rename { + /// The underlying type. + using Type = T; + + /// The name of the field. + using Name = rfl::Literal<_name>; + + Rename() : value_(Type()) {} + + Rename(const Type& _value) : value_(_value) {} + + Rename(Type&& _value) noexcept : value_(std::move(_value)) {} + + Rename(Rename<_name, T>&& _field) noexcept = default; + + Rename(const Rename<_name, Type>& _field) = default; + + template + Rename(const Rename<_name, U>& _field) : value_(_field.get()) {} + + template + Rename(Rename<_name, U>&& _field) : value_(_field.get()) {} + + template , + bool>::type = true> + Rename(const U& _value) : value_(_value) {} + + template , + bool>::type = true> + Rename(U&& _value) noexcept : value_(std::forward(_value)) {} + + template , + bool>::type = true> + Rename(const Rename<_name, U>& _field) : value_(_field.value()) {} + + /// Assigns the underlying object to its default value. + template , + bool>::type = true> + Rename(const Default&) : value_(Type()) {} + + ~Rename() = default; + + /// The name of the field, for internal use. + constexpr static const internal::StringLiteral name_ = _name; + + /// Returns the underlying object. + const Type& get() const { return value_; } + + /// Returns the underlying object. + Type& operator()() { return value_; } + + /// Returns the underlying object. + const Type& operator()() const { return value_; } + + /// Assigns the underlying object. + auto& operator=(const Type& _value) { + value_ = _value; + return *this; + } + + /// Assigns the underlying object. + auto& operator=(Type&& _value) noexcept { + value_ = std::move(_value); + return *this; + } + + /// Assigns the underlying object. + template , + bool>::type = true> + auto& operator=(const U& _value) { + value_ = _value; + return *this; + } + + /// Assigns the underlying object to its default value. + template , + bool>::type = true> + auto& operator=(const Default&) { + value_ = Type(); + return *this; + } + + /// Assigns the underlying object. + Rename<_name, T>& operator=(const Rename<_name, T>& _field) = default; + + /// Assigns the underlying object. + Rename<_name, T>& operator=(Rename<_name, T>&& _field) = default; + + /// Assigns the underlying object. + template + auto& operator=(const Rename<_name, U>& _field) { + value_ = _field.get(); + return *this; + } + + /// Assigns the underlying object. + template + auto& operator=(Rename<_name, U>&& _field) { + value_ = std::forward(_field.value_); + return *this; + } + + /// Assigns the underlying object. + void set(const Type& _value) { value_ = _value; } + + /// Assigns the underlying object. + void set(Type&& _value) { value_ = std::move(_value); } + + /// Returns the underlying object. + Type& value() { return value_; } + + /// Returns the underlying object. + const Type& value() const { return value_; } + + /// The underlying value. + Type value_; +}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/Result.hpp b/build-config/reflect-cpp/include/rfl/Result.hpp new file mode 100644 index 0000000..4621f2b --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/Result.hpp @@ -0,0 +1,447 @@ +#ifndef RFL_RESULT_HPP_ +#define RFL_RESULT_HPP_ + +#ifdef REFLECTCPP_USE_STD_EXPECTED +#include +#endif + +#include +#include +#include +#include +#include +#include + +namespace rfl { + +/// Defines the error class to be returned when something went wrong +class Error { + public: + Error(const std::string& _what) : what_(_what) {} + Error(std::string&& _what) : what_(std::move(_what)) {} + + Error(const Error& e) = default; + Error(Error&& e) = default; + + Error& operator=(const Error&) = default; + Error& operator=(Error&&) = default; + + /// Returns the error message, equivalent to .what() in std::exception. + const std::string& what() const & { return what_; } + /// Moves the error message out of Error object and leaves what_ in a moved from state + std::string what() && { return std::move(what_); } + + private: + /// Documents what went wrong + std::string what_; +}; + +/// To be returned when there is nothing to return, but there might be an error. +struct Nothing {}; + +/// This implementation is for cases where std::expected is defined +#ifdef REFLECTCPP_USE_STD_EXPECTED + +template +using Unexpected = std::unexpected; + +template +using Result = std::expected; + +/// This implementation is for cases where std::expected is not defined +#else // REFLECTCPP_USE_STD_EXPECTED + +template +struct Unexpected { + Unexpected(E&& _err) : err_{std::forward(_err)} {} + + Unexpected(const E& _err) : err_{_err} {} + + Unexpected(Unexpected&&) = default; + + Unexpected(const Unexpected&) = default; + + Unexpected& operator=(Unexpected&&) = default; + + Unexpected& operator=(const Unexpected&) = default; + + const E& error() const& { return err_; } + + E&& error() && { return std::move(err_); } + + E& error() & { return err_; } + + private: + E err_; +}; + +/// The Result class is used for monadic error handling. +template +class Result { + static_assert(!std::is_same(), "The result type cannot be Error."); + + using TOrErr = std::array; + + public: + // using Type = T; + using value_type = T; + using error_type = rfl::Error; + + Result(const T& _val) : success_(true) { new (&get_t()) T(_val); } + + Result(T&& _val) noexcept : success_(true) { + new (&get_t()) T(std::move(_val)); + } + + Result(const Unexpected& _err) : success_(false) { + new (&get_err()) Error(_err.error()); + } + Result(Unexpected&& _err) : success_(false) { + new (&get_err()) Error(std::move(_err.error())); + } + + Result(Result&& _other) noexcept : success_(_other.success_) { + move_from_other(_other); + } + + Result(const Result& _other) : success_(_other.success_) { + copy_from_other(_other); + } + + template , + bool>::type = true> + Result(Result&& _other) : success_(_other && true) { + auto temp = std::forward >(_other).transform( + [](U&& _u) { return T(std::forward(_u)); }); + move_from_other(temp); + } + + template , + bool>::type = true> + Result(const Result& _other) : success_(_other && true) { + auto temp = _other.transform([](const U& _u) { return T(_u); }); + move_from_other(temp); + } + + ~Result() { destroy(); } + + /// Monadic operation - F must be a function of type T -> Result. + template + auto and_then(const F& _f) && { + /// Result_U is expected to be of type Result. + using Result_U = typename std::invoke_result::type; + if (success_) { + return Result_U(_f(std::move(*this).get_t())); + } else { + return Result_U(std::move(*this).get_err()); + } + } + + /// Monadic operation - F must be a function of type T -> Result. + template + auto and_then(const F& _f) const& { + /// Result_U is expected to be of type Result. + using Result_U = typename std::invoke_result::type; + if (success_) { + return Result_U(_f(get_t())); + } else { + return Result_U(get_err()); + } + } + + /// Returns true if the result contains a value, false otherwise. + operator bool() const noexcept { return success_; } + + /// Allows access to the underlying value. Careful: Will result in undefined + /// behavior, if the result contains an error. + T&& operator*() && noexcept { return std::move(*this).get_t(); } + + /// Allows access to the underlying value. Careful: Will result in undefined + /// behavior, if the result contains an error. + T& operator*() & noexcept { return get_t(); } + + /// Allows read access to the underlying value. Careful: Will result in + /// undefined behavior, if the result contains an error. + const T& operator*() const& noexcept { return get_t(); } + + /// Assigns the underlying object. + Result& operator=(const Result& _other) { + if (this == &_other) { + return *this; + } + destroy(); + success_ = _other.success_; + copy_from_other(_other); + return *this; + } + + /// Assigns the underlying object. + Result& operator=(Result&& _other) noexcept { + if (this == &_other) { + return *this; + } + destroy(); + success_ = _other.success_; + move_from_other(_other); + return *this; + } + + Result& operator=(Unexpected&& _err) noexcept { + destroy(); + success_ = false; + new (&get_err()) Error(_err.error()); + return *this; + } + + Result& operator=(const Unexpected& _err) noexcept { + destroy(); + success_ = false; + new (&get_err()) Error(_err.error()); + return *this; + } + + /// Assigns the underlying object. + template , + bool>::type = true> + auto& operator=(const Result& _other) { + const auto to_t = [](const U& _u) -> T { return _u; }; + t_or_err_ = _other.transform(to_t).t_or_err_; + return *this; + } + + /// Expects a function that takes of type Error -> Result and returns + /// Result. + template + Result or_else(const F& _f) && { + if (success_) { + return std::move(*this).get_t(); + } else { + return _f(std::move(*this).get_err()); + } + } + + /// Expects a function that takes of type Error -> Result and returns + /// Result. + template + Result or_else(const F& _f) const& { + if (success_) { + return get_t(); + } else { + return _f(get_err()); + } + } + + /// Functor operation - F must be a function of type T -> U. + template + auto transform(const F& _f) && { + /// Result_U is expected to be of type Result. + using U = std::invoke_result_t; + if (success_) { + return rfl::Result(_f(std::move(*this).get_t())); + } else { + return rfl::Result(rfl::Unexpected(std::move(*this).get_err())); + } + } + + /// Functor operation - F must be a function of type T -> U. + template + auto transform(const F& _f) const& { + /// Result_U is expected to be of type Result. + using U = typename std::invoke_result::type; + if (success_) { + return rfl::Result(_f(get_t())); + } else { + return rfl::Result(get_err()); + } + } + + /// Returns the value if the result does not contain an error, throws an + /// exceptions if not. Similar to .unwrap() in Rust. + T&& value() && { + if (success_) { + return std::move(*this).get_t(); + } else { + throw std::runtime_error(get_err().what()); + } + } + + /// Returns the value if the result does not contain an error, throws an + /// exceptions if not. Similar to .unwrap() in Rust. + T& value() & { + if (success_) { + return get_t(); + } else { + throw std::runtime_error(get_err().what()); + } + } + + /// Returns the value if the result does not contain an error, throws an + /// exceptions if not. Similar to .unwrap() in Rust. + const T& value() const& { + if (success_) { + return get_t(); + } else { + throw std::runtime_error(get_err().what()); + } + } + + /// Returns the value or a default. + T&& value_or(T&& _default) && noexcept { + if (success_) { + return std::move(*this).get_t(); + } else { + return std::forward(_default); + } + } + + /// Returns the value or a default. + T value_or(const T& _default) const& noexcept { + if (success_) { + return get_t(); + } else { + return _default; + } + } + + template + rfl::Error error_or(G&& _default) && { + if (success_) { + return std::forward(_default); + } else { + return std::move(*this).get_err(); + } + } + + // As specified by the standard : + // https://en.cppreference.com/w/cpp/utility/expected + // Observers + template + rfl::Error error_or(G&& _default) const& { + if (success_) { + return std::forward(_default); + } else { + return get_err(); + } + } + + bool has_value() const noexcept { return success_; } + + Error& error() && { + if (success_) throw std::runtime_error("Expected does not contain value"); + return std::move(*this).get_err(); + } + + Error& error() & { + if (success_) throw std::runtime_error("Expected does not contain value"); + return get_err(); + } + + const Error& error() const& { + if (success_) throw std::runtime_error("Expected does not contain value"); + return get_err(); + } + + T* operator->() noexcept { return &get_t(); } + + const T* operator->() const noexcept { return &get_t(); } + + template + rfl::Result transform_error(F&& f) && { + static_assert( + std::is_same, rfl::Error>(), + "A function passed to transform_error must return an error."); + if (!has_value()) { + return rfl::Result{std::invoke(f, std::move(*this).get_err())}; + } else { + return rfl::Result{std::move(*this).value()}; + } + } + + template + rfl::Result transform_error(F&& f) const& { + static_assert( + std::is_same, rfl::Error>(), + "A function passed to transform_error must return an error."); + if (!has_value()) { + return rfl::Result{std::invoke(f, get_err())}; + } else { + return rfl::Result{value()}; + } + } + + private: + void copy_from_other(const Result& _other) { + if (success_) { + new (&get_t()) T(_other.get_t()); + } else { + new (&get_err()) Error(_other.get_err()); + } + } + + void destroy() { + if (success_) { + if constexpr (std::is_destructible_v >) { + get_t().~T(); + } + } else { + get_err().~Error(); + } + } + + T&& get_t() && noexcept { + return std::move(*std::launder(reinterpret_cast(t_or_err_.data()))); + } + + T& get_t() & noexcept { + return *std::launder(reinterpret_cast(t_or_err_.data())); + } + + const T& get_t() const& noexcept { + return *std::launder(reinterpret_cast(t_or_err_.data())); + } + + Error&& get_err() && noexcept { + return std::move(*std::launder(reinterpret_cast(t_or_err_.data()))); + } + + Error& get_err() & noexcept { + return *std::launder(reinterpret_cast(t_or_err_.data())); + } + + const Error& get_err() const& noexcept { + return *std::launder(reinterpret_cast(t_or_err_.data())); + } + + void move_from_other(Result& _other) noexcept { + if (success_) { + new (&get_t()) T(std::move(_other.get_t())); + } else { + new (&get_err()) Error(std::move(_other.get_err())); + } + } + /// Signifies whether this was a success. + bool success_; + + /// The underlying data, can either be T or Error. + alignas(std::max(alignof(T), alignof(Error))) TOrErr t_or_err_; +}; + +#endif + +/// Shorthand for unexpected error. +inline Unexpected error(const std::string& _what) { + return Unexpected(Error(_what)); +} + +inline Unexpected error(std::string&& _what) { + return Unexpected(Error(std::move(_what))); +} + +/// Shorthand for unexpected error. +inline Unexpected error(const Error& _err) { + return Unexpected(_err); +} + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/Size.hpp b/build-config/reflect-cpp/include/rfl/Size.hpp new file mode 100644 index 0000000..72f1333 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/Size.hpp @@ -0,0 +1,35 @@ +#ifndef RFL_SIZE_HPP_ +#define RFL_SIZE_HPP_ + +#include + +#include "Ref.hpp" +#include "Result.hpp" +#include "parsing/schema/ValidationType.hpp" + +namespace rfl { + +template +struct Size { + template + static rfl::Result validate(const T& _t) { + const auto to_t = [&](const auto&) { return _t; }; + const auto embellish_error = [](const auto& _err) -> Error { + return Error("Size validation failed: " + _err.what()); + }; + return V::validate(_t.size()).transform(to_t).transform_error( + embellish_error); + } + + template + static parsing::schema::ValidationType to_schema() { + using ValidationType = parsing::schema::ValidationType; + return ValidationType{ValidationType::Size{ + .size_limit_ = + rfl::Ref::make(V::template to_schema())}}; + } +}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/Skip.hpp b/build-config/reflect-cpp/include/rfl/Skip.hpp new file mode 100644 index 0000000..9adc8b6 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/Skip.hpp @@ -0,0 +1,20 @@ +#ifndef RFL_SKIP_HPP_ +#define RFL_SKIP_HPP_ + +#include "internal/Skip.hpp" + +namespace rfl { + +template +using Skip = internal::Skip; + +template +using SkipSerialization = internal::Skip; + +template +using SkipDeserialization = internal::Skip; + +} // namespace rfl + +#endif + diff --git a/build-config/reflect-cpp/include/rfl/SnakeCaseToCamelCase.hpp b/build-config/reflect-cpp/include/rfl/SnakeCaseToCamelCase.hpp new file mode 100644 index 0000000..2681e1f --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/SnakeCaseToCamelCase.hpp @@ -0,0 +1,39 @@ +#ifndef RFL_SNAKECASETOCAMELCASE_HPP_ +#define RFL_SNAKECASETOCAMELCASE_HPP_ + +#include "Field.hpp" +#include "internal/is_rename.hpp" +#include "internal/transform_snake_case.hpp" + +namespace rfl { + +struct SnakeCaseToCamelCase { + public: + /// Replaces all instances of snake_case field names with camelCase. + template + static auto process(const auto& _named_tuple) { + return _named_tuple.transform([](const FieldType& _f) { + if constexpr (FieldType::name() != "xml_content" && + !internal::is_rename_v) { + return handle_one_field(_f); + } else { + return _f; + } + }); + } + + private: + /// Applies the logic to a single field. + template + static auto handle_one_field(const FieldType& _f) { + using NewFieldType = + Field(), + typename FieldType::Type>; + return NewFieldType(_f.value()); + } +}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/SnakeCaseToPascalCase.hpp b/build-config/reflect-cpp/include/rfl/SnakeCaseToPascalCase.hpp new file mode 100644 index 0000000..1eb4543 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/SnakeCaseToPascalCase.hpp @@ -0,0 +1,40 @@ +#ifndef RFL_SNAKECASETOPASCALCASE_HPP_ +#define RFL_SNAKECASETOPASCALCASE_HPP_ + +#include "Field.hpp" +#include "internal/is_rename.hpp" +#include "internal/transform_snake_case.hpp" + +namespace rfl { + +struct SnakeCaseToPascalCase { + public: + /// Replaces all instances of snake_case field names with PascalCase. + template + static auto process(const auto& _named_tuple) { + const auto handle_one = [](const FieldType& _f) { + if constexpr (FieldType::name() != "xml_content" && + !internal::is_rename_v) { + return handle_one_field(_f); + } else { + return _f; + } + }; + return _named_tuple.transform(handle_one); + } + + private: + /// Applies the logic to a single field. + template + static auto handle_one_field(const FieldType& _f) { + using NewFieldType = + Field(), + typename FieldType::Type>; + return NewFieldType(_f.value()); + } +}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/TaggedUnion.hpp b/build-config/reflect-cpp/include/rfl/TaggedUnion.hpp new file mode 100644 index 0000000..1fea1be --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/TaggedUnion.hpp @@ -0,0 +1,146 @@ +#ifndef RFL_TAGGEDUNION_HPP_ +#define RFL_TAGGEDUNION_HPP_ + +#include "Variant.hpp" +#include "define_literal.hpp" +#include "internal/Getter.hpp" +#include "internal/StringLiteral.hpp" +#include "internal/tag_t.hpp" + +namespace rfl { + +// https://serde.rs/enum-representations.html +template +struct TaggedUnion { + static constexpr internal::StringLiteral discrimininator_ = _discriminator; + + /// The type of the underlying variant. + using VariantType = rfl::Variant; + + TaggedUnion(const VariantType& _variant) : variant_(_variant) {} + + TaggedUnion(VariantType&& _variant) noexcept + : variant_(std::move(_variant)) {} + + TaggedUnion(const TaggedUnion<_discriminator, Ts...>& _tagged_union) = + default; + + TaggedUnion(TaggedUnion<_discriminator, Ts...>&& _tagged_union) noexcept = + default; + + template , + bool>::type = true> + TaggedUnion(const T& _t) : variant_(_t) {} + + template , + bool>::type = true> + TaggedUnion(T&& _t) noexcept : variant_(std::forward(_t)) {} + + ~TaggedUnion() = default; + + /// Assigns the underlying object. + TaggedUnion<_discriminator, Ts...>& operator=(const VariantType& _variant) { + variant_ = _variant; + return *this; + } + + /// Assigns the underlying object. + TaggedUnion<_discriminator, Ts...>& operator=(VariantType&& _variant) { + variant_ = std::move(_variant); + return *this; + } + + /// Assigns the underlying object. + template , + bool>::type = true> + TaggedUnion<_discriminator, Ts...>& operator=(T&& _variant) { + variant_ = std::forward(_variant); + return *this; + } + + /// Assigns the underlying object. + template , + bool>::type = true> + TaggedUnion<_discriminator, Ts...>& operator=(const T& _variant) { + variant_ = _variant; + return *this; + } + + /// Assigns the underlying object. + TaggedUnion<_discriminator, Ts...>& operator=( + const TaggedUnion<_discriminator, Ts...>& _other) = default; + + /// Assigns the underlying object. + TaggedUnion<_discriminator, Ts...>& operator=( + TaggedUnion<_discriminator, Ts...>&& _other) = default; + + /// Returns the underlying variant. + VariantType& variant() { return variant_; } + + /// Returns the underlying variant. + const VariantType& variant() const { return variant_; } + + /// Applies function _f to all underlying alternatives. + template + auto visit(F&& _f) + -> decltype(std::declval().visit(std::declval())) { + return variant_.visit(std::forward(_f)); + } + + /// Applies function _f to all underlying alternatives. + template + auto visit(F&& _f) const + -> decltype(std::declval().visit(std::declval())) { + return variant_.visit(std::forward(_f)); + } + + /// The underlying variant - a TaggedUnion is a thin wrapper + /// around a variant that is mainly used for parsing. + VariantType variant_; +}; + +template +concept TaggedUnionBased = requires(T t) { + []( + TaggedUnion<_discriminator, Args...> const&) {}(t); +}; + +template +struct PossibleTags; + +template +struct PossibleTags> { + using Type = define_literal_t...>; +}; + +template +using possible_tags_t = typename PossibleTags::Type; + +template +bool operator==( + const TaggedUnion<_discriminator, Ts...>& lhs, + const TaggedUnion<_discriminator, Ts...>& rhs + ) { + + return (lhs.variant().index() == rhs.variant().index()) && + lhs.variant().visit( + [&rhs](const auto& l) { + return rhs.variant().visit( + [&l](const auto& r) -> bool { + if constexpr (std::is_same_v, std::decay_t>) + return l == r; + else + return false; + } + ); + } + ); +} + +} // namespace rfl + +#endif // RFL_TAGGEDUNION_HPP_ diff --git a/build-config/reflect-cpp/include/rfl/Timestamp.hpp b/build-config/reflect-cpp/include/rfl/Timestamp.hpp new file mode 100644 index 0000000..6446822 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/Timestamp.hpp @@ -0,0 +1,121 @@ +#ifndef RFL_TIMESTAMP_HPP_ +#define RFL_TIMESTAMP_HPP_ + +#include +#include +#include +#include +#include + +#include "Literal.hpp" +#include "Result.hpp" +#include "internal/StringLiteral.hpp" + +namespace rfl { + +/// For serializing and deserializing time stamps. +template +class Timestamp { + constexpr static const internal::StringLiteral format_ = _format; + + public: + using Format = rfl::Literal<_format>; + + using ReflectionType = std::string; + + Timestamp() : tm_(std::tm{}) {} + + Timestamp(const char* _str) : tm_(std::tm{}) { + const auto r = strptime(_str, _format.str().c_str(), &tm_); + if (r == NULL) { + throw std::runtime_error("String '" + std::string(_str) + + "' did not match format '" + Format().str() + + "'."); + } + } + + Timestamp(const std::string& _str) : Timestamp(_str.c_str()) {} + + Timestamp(const std::tm& _tm) : tm_(_tm) {} + + Timestamp(const time_t _t) : tm_(std::tm{}) { + auto t = _t; +#if defined(_MSC_VER) || defined(__MINGW32__) + gmtime_s(&tm_, &t); +#else + gmtime_r(&t, &tm_); +#endif + } + + ~Timestamp() = default; + + /// Returns a result containing the timestamp when successful or an Error + /// otherwise. + static Result from_string(const char* _str) noexcept { + try { + return Timestamp(_str); + } catch (std::exception& e) { + return error(e.what()); + } + } + + /// Returns a result containing the timestamp when successful or an Error + /// otherwise. + static Result from_string(const std::string& _str) { + return from_string(_str.c_str()); + } + + /// Returns a result containing the timestamp when successful or an Error + /// otherwise. + static Result make(const auto& _str) noexcept { + return from_string(_str); + } + + /// Necessary for the serialization to work. + ReflectionType reflection() const { + char outstr[200]; + strftime(outstr, 200, format_.str().c_str(), &tm_); + return std::string(outstr); + } + + /// Expresses the underlying timestamp as a string. + std::string str() const { return reflection(); } + + /// Trivial accessor to the underlying time stamp. + std::tm& tm() { return tm_; } + + /// Trivial (const) accessor to the underlying time stamp. + const std::tm& tm() const { return tm_; } + + /// Returns a UTC time represented by a time_t type. + time_t to_time_t() const { + auto tm = tm_; +#if defined(_MSC_VER) || defined(__MINGW32__) + return _mkgmtime(&tm); +#else + return static_cast(timegm(&tm) - tm_.tm_gmtoff); +#endif + } + + private: +#if defined(_MSC_VER) || defined(__MINGW32__) + // This workaround is necessary, because strptime is not available on Windows. + char* strptime(const char* _s, const char* _f, std::tm* _tm) { + std::istringstream input(_s); + input.imbue(std::locale(setlocale(LC_ALL, nullptr))); + input >> std::get_time(_tm, _f); + if (input.fail()) { + return NULL; + } + return (char*)(_s + input.tellg()); + } +#endif + + private: + /// The underlying time stamp. + std::tm tm_; +}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/Tuple.hpp b/build-config/reflect-cpp/include/rfl/Tuple.hpp new file mode 100644 index 0000000..f654be4 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/Tuple.hpp @@ -0,0 +1,267 @@ +#ifndef RFL_TUPLE_HPP_ +#define RFL_TUPLE_HPP_ + +#include +#include +#include +#include +#include + +#include "internal/nth_element_t.hpp" +#include "internal/ptr_cast.hpp" +#include "internal/tuple/calculate_positions.hpp" + +namespace rfl { + +template +class Tuple; + +template <> +class Tuple<> { + public: + Tuple() {} +}; + +template +class Tuple { + static constexpr size_t size_ = sizeof...(Types); + + static constexpr auto positions_ = + internal::tuple::calculate_positions(); + + static constexpr auto seq_ = std::make_integer_sequence{}; + + static constexpr unsigned int num_bytes_ = std::get(positions_); + + using DataType = std::array; + + public: + Tuple(const Types&... _t) { copy_from_types(_t..., seq_); } + + Tuple(Types&&... _t) noexcept { move_from_types(std::move(_t)..., seq_); } + + Tuple() : Tuple(Types()...) {} + + Tuple(const Tuple& _other) { copy_from_other(_other, seq_); } + + Tuple(Tuple&& _other) noexcept { move_from_other(std::move(_other), seq_); } + + ~Tuple() { destroy_if_necessary(seq_); } + + /// Gets an element by index. + template + constexpr auto& get() { + using Type = internal::nth_element_t<_index, Types...>; + return *internal::ptr_cast(data_.data() + pos<_index>()); + } + + /// Gets an element by index. + template + constexpr const auto& get() const { + using Type = internal::nth_element_t<_index, Types...>; + return *internal::ptr_cast(data_.data() + pos<_index>()); + } + + /// Assigns the underlying object. + Tuple& operator=(const Tuple& _other) { + if (this == &_other) { + return *this; + } + auto temp = Tuple(_other); + destroy_if_necessary(seq_); + move_from_other(std::move(temp), seq_); + return *this; + } + + /// Assigns the underlying object. + Tuple& operator=(Tuple&& _other) noexcept { + if (this == &_other) { + return *this; + } + destroy_if_necessary(seq_); + move_from_other(std::move(_other), seq_); + return *this; + } + + /// Equality operator. + template + bool operator==(const Tuple& _other) const noexcept { + static_assert(sizeof...(Types) == sizeof...(OtherTypes), + "The size of the two tuples must be the same."); + const auto is_same = [&](std::integral_constant) -> bool { + return this->get<_i>() == _other.template get<_i>(); + }; + return [&](std::integer_sequence) { + return (true && ... && is_same(std::integral_constant{})); + }(std::make_integer_sequence()); + } + + /// Three-way comparison operator. + template + auto operator<=>(const Tuple& _other) const noexcept { + static_assert(sizeof...(Types) == sizeof...(OtherTypes), + "The size of the two tuples must be the same."); + + const auto compare = [&](std::strong_ordering* _ordering, + std::integral_constant) { + if (*_ordering != std::strong_ordering::equivalent && + this->get<_i>() != _other.template get<_i>()) { + *_ordering = (this->get<_i>() <=> _other.template get<_i>()); + } + }; + + return [&](std::integer_sequence) { + auto ordering = std::strong_ordering::equivalent; + (compare(&ordering, std::integral_constant{}), ...); + return ordering; + }(std::make_integer_sequence()); + } + + private: + template + void copy_from_other(const Tuple& _other, + std::integer_sequence) { + const auto copy_one = [this](const auto& _other, + std::integral_constant) { + using Type = internal::nth_element_t<_i, Types...>; + ::new (static_cast(data_.data() + pos<_i>())) + Type(_other.template get<_i>()); + }; + (copy_one(_other, std::integral_constant{}), ...); + } + + template + void copy_from_types(const Types&... _types, + std::integer_sequence) { + const auto copy_one = [this](const auto& _t, + std::integral_constant) { + using Type = internal::nth_element_t<_i, Types...>; + ::new (static_cast(data_.data() + pos<_i>())) Type(_t); + }; + (copy_one(_types, std::integral_constant{}), ...); + } + + template + void destroy_if_necessary(std::integer_sequence) { + const auto destroy_one = [](auto& _t) { + using Type = std::remove_cvref_t; + if constexpr (std::is_destructible_v) { + _t.~Type(); + } + }; + (destroy_one(get<_is>()), ...); + } + + template + void move_from_other(Tuple&& _other, std::integer_sequence) { + const auto move_one = [this](auto&& _other, + std::integral_constant) { + using Type = internal::nth_element_t<_i, Types...>; + ::new (static_cast(data_.data() + pos<_i>())) + Type(std::move(_other.template get<_i>())); + }; + (move_one(_other, std::integral_constant{}), ...); + } + + template + void move_from_types(Types&&... _types, std::integer_sequence) { + const auto move_one = [this](auto&& _t, + std::integral_constant) { + using Type = internal::nth_element_t<_i, Types...>; + ::new (static_cast(data_.data() + pos<_i>())) Type(std::move(_t)); + }; + (move_one(std::move(_types), std::integral_constant{}), ...); + } + + template + static consteval unsigned int pos() { + return std::get<_i>(positions_); + } + + private: + /// The underlying data, can be any of the underlying types. + alignas(Types...) DataType data_; +}; + +/// Gets an element by index. +template +constexpr auto& get(rfl::Tuple& _tup) { + return _tup.template get<_index>(); +} + +/// Gets an element by index. +template +constexpr const auto& get(const rfl::Tuple& _tup) { + return _tup.template get<_index>(); +} + +/// Gets an element by index. +template +constexpr auto& get(std::tuple& _tup) { + return std::get<_index>(_tup); +} + +/// Gets an element by index. +template +constexpr const auto& get(const std::tuple& _tup) { + return std::get<_index>(_tup); +} + +template +auto make_tuple(Types&&... _args) { + return rfl::Tuple...>(std::forward(_args)...); +} + +template +struct tuple_element; + +template +struct tuple_element> { + using type = internal::nth_element_t; +}; + +template +struct tuple_element> { + using type = internal::nth_element_t; +}; + +template +using tuple_element_t = + typename rfl::tuple_element>::type; + +template +struct tuple_size; + +template +struct tuple_size> { + static constexpr auto value = sizeof...(Ts); +}; + +template +struct tuple_size> { + static constexpr auto value = sizeof...(Ts); +}; + +template +inline constexpr auto tuple_size_v = + rfl::tuple_size>::value; + +} // namespace rfl + +namespace std { + +/// Gets an element by index. +template +constexpr auto& get(rfl::Tuple& _tup) { + return _tup.template get<_index>(); +} + +/// Gets an element by index. +template +constexpr const auto& get(const rfl::Tuple& _tup) { + return _tup.template get<_index>(); +} + +} // namespace std + +#endif diff --git a/build-config/reflect-cpp/include/rfl/UnderlyingEnums.hpp b/build-config/reflect-cpp/include/rfl/UnderlyingEnums.hpp new file mode 100644 index 0000000..e40727a --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/UnderlyingEnums.hpp @@ -0,0 +1,18 @@ +#ifndef RFL_UNDERLYINGENUMS_HPP_ +#define RFL_UNDERLYINGENUMS_HPP_ + +namespace rfl { + +/// This is a 'fake' processor - it doesn't do much by itself, but its +/// its inclusion instructs parsers not to convert enum types to strings, but to integers +struct UnderlyingEnums { + public: + template + static auto process(auto&& _named_tuple) { + return _named_tuple; + } +}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/Validator.hpp b/build-config/reflect-cpp/include/rfl/Validator.hpp new file mode 100644 index 0000000..f3a1329 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/Validator.hpp @@ -0,0 +1,135 @@ +#ifndef RFL_VALIDATOR_HPP_ +#define RFL_VALIDATOR_HPP_ + +#include +#include +#include +#include +#include + +#include "AllOf.hpp" +#include "Result.hpp" +#include "internal/HasValidation.hpp" + +namespace rfl { + +template + requires internal::HasValidation, T> +struct Validator { + public: + using ReflectionType = T; + using ValidationType = + std::conditional_t>; + + /// Exception-free validation. + static Result from_value(const T& _value) noexcept { + try { + return Validator(_value); + } catch (std::exception& e) { + return error(e.what()); + } + } + + Validator() : value_(ValidationType::validate(T()).value()) {} + + Validator(Validator&& _other) noexcept = default; + + Validator(const Validator& _other) = default; + + Validator(T&& _value) : value_(ValidationType::validate(_value).value()) {} + + Validator(const T& _value) + : value_(ValidationType::validate(_value).value()) {} + + template , + bool>::type = true> + Validator(U&& _value) + : value_(ValidationType::validate(T(std::forward(_value))).value()) {} + + template , + bool>::type = true> + Validator(const U& _value) + : value_(ValidationType::validate(T(_value)).value()) {} + + ~Validator() = default; + + /// Assigns the underlying object. + auto& operator=(const T& _value) { + value_ = ValidationType::validate(_value).value(); + return *this; + } + + /// Assigns the underlying object. + auto& operator=(T&& _value) { + value_ = ValidationType::validate(std::forward(_value)).value(); + return *this; + } + + /// Assigns the underlying object. + Validator& operator=(const Validator& _other) = + default; + + /// Assigns the underlying object. + Validator& operator=(Validator&& _other) noexcept = + default; + + /// Assigns the underlying object. + template , + bool>::type = true> + auto& operator=(U&& _value) noexcept { + value_ = ValidationType::validate(T(std::forward(_value))).value(); + return *this; + } + + /// Assigns the underlying object. + template , + bool>::type = true> + auto& operator=(const U& _value) { + value_ = ValidationType::validate(T(_value)).value(); + return *this; + } + + /// Equality operator other Validators. + bool operator==(const Validator& _other) const { + return value() == _other.value(); + } + + /// Exposes the underlying value. + T& value() { return value_; } + + /// Exposes the underlying value. + const T& value() const { return value_; } + + /// Necessary for the serialization to work. + const T& reflection() const { return value_; } + + private: + /// The underlying value. + T value_; +}; + +template +inline auto operator<=>(const Validator& _v1, + const Validator& _v2) { + return _v1.value() <=> _v2.value(); +} + +template +inline auto operator<=>(const Validator& _v, const T& _t) { + return _v.value() <=> _t; +} + +} // namespace rfl + +namespace std { + +template +struct hash> { + size_t operator()(const rfl::Validator& _v) const { + return hash()(_v.value()); + } +}; + +} // namespace std + +#endif diff --git a/build-config/reflect-cpp/include/rfl/Variant.hpp b/build-config/reflect-cpp/include/rfl/Variant.hpp new file mode 100644 index 0000000..09b45f2 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/Variant.hpp @@ -0,0 +1,559 @@ +#ifndef RFL_VARIANT_HPP_ +#define RFL_VARIANT_HPP_ + +#include +#include +#include +#include +#include +#include +#include + +#include "internal/element_index.hpp" +#include "internal/nth_element_t.hpp" +#include "internal/ptr_cast.hpp" +#include "internal/variant/find_max_size.hpp" +#include "internal/variant/is_alternative_type.hpp" +#include "internal/variant/result_t.hpp" + +namespace rfl { + +template +class Variant { + static constexpr auto max_size_wrapper_ = + internal::variant::find_max_size(); + + static constexpr unsigned long num_bytes_ = max_size_wrapper_.size_; + + using DataType = std::array; + + using IndexType = + std::conditional_t::max(), + std::uint8_t, std::uint16_t>; + + static constexpr IndexType size_ = sizeof...(AlternativeTypes); + + template + using result_t = internal::variant::result_t; + + template + using Index = std::integral_constant; + + template + struct TypeWrapper {}; + + public: + Variant() : index_(IndexType()), data_(DataType()) { + using FirstAlternative = internal::nth_element_t<0, AlternativeTypes...>; + move_from_type(FirstAlternative()); + } + + Variant(const Variant& _other) + : index_(IndexType()), data_(DataType()) { + copy_from_other(_other); + } + + Variant(Variant&& _other) noexcept + : index_(IndexType()), data_(DataType()) { + move_from_other(std::move(_other)); + } + + template (), + bool>::type = true> + Variant(const T& _t) : index_(IndexType()), data_(DataType()) { + copy_from_type(_t); + } + + template (), + bool>::type = true> + Variant(T&& _t) noexcept : index_(IndexType()), data_(DataType()) { + move_from_type(std::forward(_t)); + } + + ~Variant() { destroy_if_necessary(); } + + /// Emplaces a new element into the variant. + template + constexpr T& emplace(Args&&... _args) { + auto t = T{std::forward(_args)...}; + destroy_if_necessary(); + move_from_type(std::move(t)); + return *internal::ptr_cast(data_.data()); + } + + /// Emplaces a new element into the variant. + template + constexpr auto& emplace(Args&&... _args) { + using T = internal::nth_element_t<_i, AlternativeTypes...>; + return emplace(std::move(_args)...); + } + + /// Returns the index of the element currently held. + constexpr int index() const noexcept { return index_; } + + /// Assigns the underlying object. + template (), + bool>::type = true> + Variant& operator=(const T& _t) { + auto temp = Variant(_t); + destroy_if_necessary(); + move_from_other(std::move(temp)); + return *this; + } + + /// Assigns the underlying object. + template (), + bool>::type = true> + Variant& operator=(T&& _t) noexcept { + destroy_if_necessary(); + move_from_type(std::forward(_t)); + return *this; + } + + /// Assigns the underlying object. + Variant& operator=(const Variant& _other) { + if (this == &_other) { + return *this; + } + auto temp = Variant(_other); + destroy_if_necessary(); + move_from_other(std::move(temp)); + return *this; + } + + /// Assigns the underlying object. + Variant& operator=(Variant&& _other) noexcept { + if (this == &_other) { + return *this; + } + destroy_if_necessary(); + move_from_other(std::move(_other)); + return *this; + } + + /// Swaps the content with the other variant. + void swap(Variant& _other) noexcept { + if (this == &_other) { + return; + } + auto temp = Variant(std::move(*this)); + move_from_other(std::move(_other)); + _other = std::move(temp); + } + + template + result_t visit(F&& _f) { + using ResultType = result_t; + if constexpr (std::is_same_v) { + bool visited = false; + do_visit_no_result(std::forward(_f), &visited, + std::make_integer_sequence()); + } else if constexpr (std::is_reference_v) { + std::remove_reference_t* res = nullptr; + do_visit_with_reference(std::forward(_f), &res, + std::make_integer_sequence()); + return *res; + } else { + auto res = std::optional(); + do_visit_with_result(std::forward(_f), &res, + std::make_integer_sequence()); + return std::move(*res); + } + } + + template + result_t visit(F&& _f) const { + using ResultType = result_t; + if constexpr (std::is_same_v) { + bool visited = false; + do_visit_no_result(std::forward(_f), &visited, + std::make_integer_sequence()); + } else if constexpr (std::is_reference_v) { + std::remove_reference_t* res = nullptr; + do_visit_with_reference(std::forward(_f), &res, + std::make_integer_sequence()); + return *res; + } else { + auto res = std::optional(); + do_visit_with_result(std::forward(_f), &res, + std::make_integer_sequence()); + return std::move(*res); + } + } + + private: + void copy_from_other(const Variant& _other) { + const auto copy_one = [this](const auto& _t) { this->copy_from_type(_t); }; + _other.visit(copy_one); + } + + template + void copy_from_other_type(const T& _t) { + bool set = false; + const auto copy_one = [&, this](const T& _t, + const TypeWrapper) { + if constexpr (std::is_convertible_v) { + if (!set) { + move_from_type(AltType(_t)); + set = true; + } + } + }; + (copy_one(_t, TypeWrapper{}), ...); + } + + template + void copy_from_type(const T& _t) noexcept { + using CurrentType = std::remove_cvref_t; + index_ = + internal::element_index...>(); + new (data_.data()) CurrentType(_t); + } + + void destroy_if_necessary() { + const auto destroy_one = [](auto& _t) { + using T = std::remove_cvref_t; + if constexpr (std::is_destructible_v) { + _t.~T(); + } + }; + visit(destroy_one); + } + + template + void do_visit_no_result(F& _f, bool* _visited, + std::integer_sequence) { + auto visit_one = [this](const F& _f, bool* _visited, + Index<_i>) { + if (!*_visited && index_ == _i) { + _f(get_alternative<_i>()); + *_visited = true; + } + }; + (visit_one(_f, _visited, Index<_is>{}), ...); + } + + template + void do_visit_no_result(F& _f, bool* _visited, + std::integer_sequence) const { + auto visit_one = [this](const F& _f, bool* _visited, + Index<_i>) { + if (!*_visited && index_ == _i) { + _f(get_alternative<_i>()); + *_visited = true; + } + }; + (visit_one(_f, _visited, Index<_is>{}), ...); + } + + template + void do_visit_no_result(const F& _f, bool* _visited, + std::integer_sequence) { + const auto visit_one = [this](const F& _f, bool* _visited, + Index<_i>) { + if (!*_visited && index_ == _i) { + _f(get_alternative<_i>()); + *_visited = true; + } + }; + (visit_one(_f, _visited, Index<_is>{}), ...); + } + + template + void do_visit_no_result(const F& _f, bool* _visited, + std::integer_sequence) const { + const auto visit_one = [this](const F& _f, bool* _visited, + Index<_i>) { + if (!*_visited && index_ == _i) { + _f(get_alternative<_i>()); + *_visited = true; + } + }; + (visit_one(_f, _visited, Index<_is>{}), ...); + } + + template + void do_visit_with_result(F& _f, std::optional* _result, + std::integer_sequence) { + auto visit_one = [this](const F& _f, + std::optional* _result, + Index<_i>) { + if (!*_result && index_ == _i) { + _result->emplace(_f(get_alternative<_i>())); + } + }; + (visit_one(_f, _result, Index<_is>{}), ...); + } + + template + void do_visit_with_result(F& _f, std::optional* _result, + std::integer_sequence) const { + auto visit_one = [this](const F& _f, + std::optional* _result, + Index<_i>) { + if (!*_result && index_ == _i) { + _result->emplace(_f(get_alternative<_i>())); + } + }; + (visit_one(_f, _result, Index<_is>{}), ...); + } + + template + void do_visit_with_result(const F& _f, std::optional* _result, + std::integer_sequence) { + const auto visit_one = [this](const F& _f, + std::optional* _result, + Index<_i>) { + if (!*_result && index_ == _i) { + _result->emplace(_f(get_alternative<_i>())); + } + }; + (visit_one(_f, _result, Index<_is>{}), ...); + } + + template + void do_visit_with_result(const F& _f, std::optional* _result, + std::integer_sequence) const { + const auto visit_one = [this](const F& _f, + std::optional* _result, + Index<_i>) { + if (!*_result && index_ == _i) { + _result->emplace(_f(get_alternative<_i>())); + } + }; + (visit_one(_f, _result, Index<_is>{}), ...); + } + + template + void do_visit_with_reference(F& _f, ResultType** _result, + std::integer_sequence) { + const auto visit_one = [this](const F& _f, ResultType** _result, + Index<_i>) { + if (!*_result && index_ == _i) { + *_result = &_f(get_alternative<_i>()); + } + }; + (visit_one(_f, _result, Index<_is>{}), ...); + } + + template + void do_visit_with_reference(F& _f, ResultType** _result, + std::integer_sequence) const { + const auto visit_one = [this](const F& _f, ResultType** _result, + Index<_i>) { + if (!*_result && index_ == _i) { + *_result = &_f(get_alternative<_i>()); + } + }; + (visit_one(_f, _result, Index<_is>{}), ...); + } + + template + void do_visit_with_reference(const F& _f, ResultType** _result, + std::integer_sequence) { + const auto visit_one = [this](const F& _f, ResultType** _result, + Index<_i>) { + if (!*_result && index_ == _i) { + *_result = &_f(get_alternative<_i>()); + } + }; + (visit_one(_f, _result, Index<_is>{}), ...); + } + + template + void do_visit_with_reference(const F& _f, ResultType** _result, + std::integer_sequence) const { + const auto visit_one = [this](const F& _f, ResultType** _result, + Index<_i>) { + if (!*_result && index_ == _i) { + *_result = &_f(get_alternative<_i>()); + } + }; + (visit_one(_f, _result, Index<_is>{}), ...); + } + + template + auto& get_alternative() noexcept { + using CurrentType = internal::nth_element_t<_i, AlternativeTypes...>; + return *internal::ptr_cast(data_.data()); + } + + template + const auto& get_alternative() const noexcept { + using CurrentType = internal::nth_element_t<_i, AlternativeTypes...>; + return *internal::ptr_cast(data_.data()); + } + + void move_from_other(Variant&& _other) noexcept { + const auto move_one = [this](auto&& _t) { + this->move_from_type(std::forward>(_t)); + }; + std::move(_other).visit(move_one); + } + + template + void move_from_type(T&& _t) noexcept { + using CurrentType = std::remove_cvref_t; + index_ = + internal::element_index...>(); + new (data_.data()) CurrentType(std::forward(_t)); + } + + private: + /// Index indicating which of the alternatives is currently contained in the + /// variant. + IndexType index_; + + /// The underlying data, can be any of the underlying types. + alignas(AlternativeTypes...) DataType data_; +}; + +template +concept VariantBased = requires(std::decay_t v) { + [](Variant const&) {}(v); +}; + +template +constexpr T* get_if(Variant* _v) noexcept { + const auto get = [](auto& _v) -> T* { + using Type = std::remove_cvref_t; + if constexpr (std::is_same>()) { + return &_v; + } else { + return nullptr; + } + }; + return _v->visit(get); +} + +template +constexpr const T* get_if(const Variant* _v) noexcept { + const auto get = [](const auto& _v) -> const T* { + using Type = std::remove_cvref_t; + if constexpr (std::is_same>()) { + return &_v; + } else { + return nullptr; + } + }; + return _v->visit(get); +} + +template +constexpr auto* get_if(Variant* _v) noexcept { + using T = internal::nth_element_t<_i, Types...>; + return get_if(_v); +} + +template +constexpr auto* get_if(const Variant* _v) noexcept { + using T = internal::nth_element_t<_i, Types...>; + return get_if(_v); +} + +template +constexpr T& get(Variant& _v) { + auto ptr = get_if(&_v); + if (!ptr) { + throw std::runtime_error("Variant does not contain signified type."); + } + return *ptr; +} + +template +constexpr T&& get(Variant&& _v) { + auto ptr = get_if(&_v); + if (!ptr) { + throw std::runtime_error("Variant does not contain signified type."); + } + return std::move(*ptr); +} + +template +constexpr const T& get(const Variant& _v) { + auto ptr = get_if(&_v); + if (!ptr) { + throw std::runtime_error("Variant does not contain signified type."); + } + return *ptr; +} + +template +constexpr auto& get(Variant& _v) { + auto ptr = get_if<_i>(&_v); + if (!ptr) { + throw std::runtime_error("Variant does not contain signified type."); + } + return *ptr; +} + +template +constexpr auto&& get(Variant&& _v) { + auto ptr = get_if<_i>(&_v); + if (!ptr) { + throw std::runtime_error("Variant does not contain signified type."); + } + return std::move(*ptr); +} + +template +constexpr const auto& get(const Variant& _v) { + auto ptr = get_if<_i>(&_v); + if (!ptr) { + throw std::runtime_error("Variant does not contain signified type."); + } + return *ptr; +} + +template +constexpr bool holds_alternative(const Variant& _v) noexcept { + constexpr auto ix = internal::element_index, + std::remove_cvref_t...>(); + static_assert(ix != -1, "Type not supported."); + return ix == _v.index(); +} + +template +struct variant_alternative; + +template +struct variant_alternative> { + using type = internal::nth_element_t; +}; + +template +using variant_alternative_t = + typename variant_alternative>::type; + +template +struct variant_size; + +template +struct variant_size> + : std::integral_constant {}; + +template +constexpr size_t variant_size_v = + variant_size>(); + +} // namespace rfl + +namespace std { +template +void swap(rfl::Variant& _lhs, rfl::Variant& _rhs) noexcept { + _lhs.swap(_rhs); +}; +} // namespace std + +#endif diff --git a/build-config/reflect-cpp/include/rfl/Vectorstring.hpp b/build-config/reflect-cpp/include/rfl/Vectorstring.hpp new file mode 100644 index 0000000..8d3d26c --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/Vectorstring.hpp @@ -0,0 +1,13 @@ +#ifndef RFL_VECTORSTRING_HPP_ +#define RFL_VECTORSTRING_HPP_ + +#include +#include + +namespace rfl { + +using Vectorstring = std::vector; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/always_false.hpp b/build-config/reflect-cpp/include/rfl/always_false.hpp new file mode 100644 index 0000000..78041ea --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/always_false.hpp @@ -0,0 +1,12 @@ +#ifndef RFL_ALWAYSFALSE_HPP_ +#define RFL_ALWAYSFALSE_HPP_ + +namespace rfl { + +/// To be used inside visitor patterns +template +inline constexpr bool always_false_v = false; + +} // namespace rfl + +#endif // RFL_ALWAYSFALSE_HPP_ diff --git a/build-config/reflect-cpp/include/rfl/apply.hpp b/build-config/reflect-cpp/include/rfl/apply.hpp new file mode 100644 index 0000000..6f2f496 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/apply.hpp @@ -0,0 +1,31 @@ +#ifndef RFL_APPLY_HPP_ +#define RFL_APPLY_HPP_ + +#include + +#include "Tuple.hpp" +#include "internal/tuple/apply.hpp" + +namespace rfl { + +template +auto apply(F&& _f, const rfl::Tuple& _tup) { + return internal::tuple::apply( + _f, _tup, std::make_integer_sequence()); +} + +template +auto apply(F&& _f, rfl::Tuple& _tup) { + return internal::tuple::apply( + _f, _tup, std::make_integer_sequence()); +} + +template +auto apply(F&& _f, rfl::Tuple&& _tup) { + return internal::tuple::apply( + _f, std::move(_tup), std::make_integer_sequence()); +} + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/as.hpp b/build-config/reflect-cpp/include/rfl/as.hpp new file mode 100644 index 0000000..d5b9b6a --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/as.hpp @@ -0,0 +1,35 @@ +#ifndef RFL_AS_HPP_ +#define RFL_AS_HPP_ + +#include "from_named_tuple.hpp" +#include "make_named_tuple.hpp" +#include "to_named_tuple.hpp" + +namespace rfl { + +/// Generates a type T from the input values. +template +T as(Head&& _head, Tail&&... _tail) { + if constexpr (sizeof...(_tail) == 0) { + return from_named_tuple(to_named_tuple(std::forward(_head))); + } else { + return from_named_tuple( + to_named_tuple(std::forward(_head)) + .add(to_named_tuple(std::forward(_tail))...)); + } +} + +/// Generates a type T from the input values. +template +T as(const Head& _head, const Tail&... _tail) { + if constexpr (sizeof...(_tail) == 0) { + return from_named_tuple(to_named_tuple(_head)); + } else { + return from_named_tuple( + to_named_tuple(_head).add(to_named_tuple(_tail)...)); + } +} + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/common.hpp b/build-config/reflect-cpp/include/rfl/common.hpp new file mode 100644 index 0000000..d089e3a --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/common.hpp @@ -0,0 +1,19 @@ +#ifndef RFL_COMMON_HPP_ +#define RFL_COMMON_HPP_ + + +#ifdef RFL_BUILD_SHARED + #ifdef _WIN32 + #ifdef reflectcpp_EXPORTS + #define RFL_API __declspec(dllexport) + #else + #define RFL_API __declspec(dllimport) + #endif + #else + #define RFL_API __attribute__((visibility("default"))) + #endif +#else + #define RFL_API +#endif + +#endif \ No newline at end of file diff --git a/build-config/reflect-cpp/include/rfl/comparisons.hpp b/build-config/reflect-cpp/include/rfl/comparisons.hpp new file mode 100644 index 0000000..2dfb467 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/comparisons.hpp @@ -0,0 +1,164 @@ +#ifndef RFL_COMPARISONS_HPP_ +#define RFL_COMPARISONS_HPP_ + +#include +#include + +#include "Result.hpp" +#include "parsing/schema/ValidationType.hpp" + +namespace rfl { + +template +struct EqualTo { + template + static Result validate(T _value) noexcept { + constexpr auto threshold = static_cast(_threshold); + if (_value != threshold) { + std::stringstream stream; + stream << "Value expected to be equal to " << threshold << ", but got " + << _value << "."; + return error(stream.str()); + } + return _value; + } + + template + static parsing::schema::ValidationType to_schema() { + using ValidationType = parsing::schema::ValidationType; + const auto value = + std::is_floating_point_v + ? rfl::Variant(static_cast(_threshold)) + : rfl::Variant(static_cast(_threshold)); + return ValidationType{ValidationType::EqualTo{.value_ = value}}; + } +}; + +template +struct Minimum { + template + static Result validate(T _value) noexcept { + constexpr auto threshold = static_cast(_threshold); + if (_value < threshold) { + std::stringstream stream; + stream << "Value expected to be greater than or equal to " << threshold + << ", but got " << _value << "."; + return error(stream.str()); + } + return _value; + } + + template + static parsing::schema::ValidationType to_schema() { + using ValidationType = parsing::schema::ValidationType; + const auto value = + std::is_floating_point_v + ? rfl::Variant(static_cast(_threshold)) + : rfl::Variant(static_cast(_threshold)); + return ValidationType{ValidationType::Minimum{.value_ = value}}; + } +}; + +template +struct ExclusiveMinimum { + template + static Result validate(T _value) noexcept { + constexpr auto threshold = static_cast(_threshold); + if (_value <= threshold) { + std::stringstream stream; + stream << "Value expected to be greater than " << threshold + << ", but got " << _value << "."; + return error(stream.str()); + } + return _value; + } + + template + static parsing::schema::ValidationType to_schema() { + using ValidationType = parsing::schema::ValidationType; + const auto value = + std::is_floating_point_v + ? rfl::Variant(static_cast(_threshold)) + : rfl::Variant(static_cast(_threshold)); + return ValidationType{ValidationType::ExclusiveMinimum{.value_ = value}}; + } +}; + +template +struct Maximum { + template + static Result validate(T _value) noexcept { + constexpr auto threshold = static_cast(_threshold); + if (_value > threshold) { + std::stringstream stream; + stream << "Value expected to be less than or equal to " << threshold + << ", but got " << _value << "."; + return error(stream.str()); + } + return _value; + } + + template + static parsing::schema::ValidationType to_schema() { + using ValidationType = parsing::schema::ValidationType; + const auto value = + std::is_floating_point_v + ? rfl::Variant(static_cast(_threshold)) + : rfl::Variant(static_cast(_threshold)); + return ValidationType{ValidationType::Maximum{.value_ = value}}; + } +}; + +template +struct ExclusiveMaximum { + template + static Result validate(T _value) noexcept { + constexpr auto threshold = static_cast(_threshold); + if (_value >= threshold) { + std::stringstream stream; + stream << "Value expected to be less than " << threshold << ", but got " + << _value << "."; + return error(stream.str()); + } + return _value; + } + + template + static parsing::schema::ValidationType to_schema() { + using ValidationType = parsing::schema::ValidationType; + const auto value = + std::is_floating_point_v + ? rfl::Variant(static_cast(_threshold)) + : rfl::Variant(static_cast(_threshold)); + return ValidationType{ValidationType::ExclusiveMaximum{.value_ = value}}; + } +}; + +template +struct NotEqualTo { + template + static Result validate(T _value) noexcept { + constexpr auto threshold = static_cast(_threshold); + if (_value == threshold) { + std::stringstream stream; + stream << "Value expected not to be equal to " << threshold + << ", but got " << _value << "."; + return error(stream.str()); + } + return _value; + } + + template + static parsing::schema::ValidationType to_schema() { + using ValidationType = parsing::schema::ValidationType; + const auto value = + std::is_floating_point_v + ? rfl::Variant(static_cast(_threshold)) + : rfl::Variant(static_cast(_threshold)); + return ValidationType{ValidationType::NotEqualTo{.value_ = value}}; + } +}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/concepts.hpp b/build-config/reflect-cpp/include/rfl/concepts.hpp new file mode 100644 index 0000000..8ffa10c --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/concepts.hpp @@ -0,0 +1,67 @@ +#ifndef RFL_CONCEPTS_HPP_ +#define RFL_CONCEPTS_HPP_ + +#include +#include +#include +#include +#include + +namespace rfl::concepts { + +/// Concept for byte-like types that can be used in contiguous containers +/// Includes char, signed char, unsigned char, std::byte, and uint8_t +template +concept ByteLike = std::same_as || std::same_as || + std::same_as || + std::same_as || std::same_as; + +/// Concept for containers with a contiguous sequence of byte-like types +/// Requires: +/// - Container has a value_type that is byte-like +/// - Container provides data() method returning a pointer to contiguous memory +/// - Container provides size() method returning the number of elements +/// - Container supports range-based for loops (begin/end) +template +concept ContiguousByteContainer = requires(const Container& c) { + typename Container::value_type; + { c.data() } -> std::convertible_to; + { c.size() } -> std::convertible_to; + { c.begin() } -> std::input_iterator; + { c.end() } -> std::input_iterator; + requires ByteLike; + requires std::contiguous_iterator; +}; + +/// Concept for mutable containers with a contiguous sequence of byte-like types +/// Extends ContiguousByteContainer with mutable access requirements +template +concept MutableContiguousByteContainer = + ContiguousByteContainer && requires(Container& c) { + { c.data() } -> std::convertible_to; + { c.begin() } -> std::output_iterator; + { c.end() } -> std::output_iterator; + }; + +/// Concept for back-insertable byte containers (like std::vector) +/// Useful for containers that can grow dynamically during serialization +template +concept BackInsertableByteContainer = + ContiguousByteContainer && + requires(Container& c, typename Container::value_type v) { + c.push_back(v); + c.reserve(std::size_t{}); + { c.capacity() } -> std::convertible_to; + }; + +/// Concept for byte spans or views (read-only, non-owning containers) +/// Includes std::span, std::string_view when used with char +/// data, etc. +template +concept ByteSpanLike = ContiguousByteContainer && + std::is_trivially_copyable_v && + std::is_trivially_destructible_v; + +} // namespace rfl::concepts + +#endif // RFL_CONCEPTS_HPP_ diff --git a/build-config/reflect-cpp/include/rfl/config.hpp b/build-config/reflect-cpp/include/rfl/config.hpp new file mode 100644 index 0000000..9526f20 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/config.hpp @@ -0,0 +1,19 @@ +#ifndef RFL_CONFIG_HPP_ +#define RFL_CONFIG_HPP_ + +namespace rfl::config { + +// To specify a different range for a particular enum type, specialize the +// enum_range template for that enum type. +template +struct enum_range { + // In your template specialization, uncomment these two lines and replace them + // with the values of your choice. + // static constexpr int min = ...; + // static constexpr int max = ...; +}; + +} // namespace rfl::config + +#endif + diff --git a/build-config/reflect-cpp/include/rfl/default.hpp b/build-config/reflect-cpp/include/rfl/default.hpp new file mode 100644 index 0000000..fa6b1df --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/default.hpp @@ -0,0 +1,14 @@ +#ifndef RFL_DEFAULT_HPP_ +#define RFL_DEFAULT_HPP_ + +namespace rfl { + +/// Helper class that can be passed to a field +/// to trigger the default value of the type. +struct Default {}; + +inline static const auto default_value = Default{}; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/define_literal.hpp b/build-config/reflect-cpp/include/rfl/define_literal.hpp new file mode 100644 index 0000000..27f62a8 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/define_literal.hpp @@ -0,0 +1,16 @@ +#ifndef RFL_DEFINELITERAL_HPP_ +#define RFL_DEFINELITERAL_HPP_ + +#include "Literal.hpp" +#include "internal/define_literal.hpp" + +namespace rfl { + +/// Allows you to combine several literal types. +template +using define_literal_t = + typename internal::define_literal::type; + +} // namespace rfl + +#endif // RFL_DEFINELITERAL_HPP_ diff --git a/build-config/reflect-cpp/include/rfl/define_named_tuple.hpp b/build-config/reflect-cpp/include/rfl/define_named_tuple.hpp new file mode 100644 index 0000000..81340c3 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/define_named_tuple.hpp @@ -0,0 +1,15 @@ +#ifndef RFL_DEFINENAMEDTUPLE_HPP_ +#define RFL_DEFINENAMEDTUPLE_HPP_ + +#include "NamedTuple.hpp" +#include "internal/define_named_tuple.hpp" + +namespace rfl { + +template +using define_named_tuple_t = + typename internal::define_named_tuple::type; + +} // namespace rfl + +#endif // RFL_DEFINENAMEDTUPLE_HPP_ diff --git a/build-config/reflect-cpp/include/rfl/define_tagged_union.hpp b/build-config/reflect-cpp/include/rfl/define_tagged_union.hpp new file mode 100644 index 0000000..735e693 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/define_tagged_union.hpp @@ -0,0 +1,17 @@ +#ifndef RFL_DEFINETAGGEDUNION_HPP_ +#define RFL_DEFINETAGGEDUNION_HPP_ + +#include "TaggedUnion.hpp" +#include "internal/StringLiteral.hpp" +#include "internal/define_tagged_union.hpp" + +namespace rfl { + +template +using define_tagged_union_t = + typename internal::define_tagged_union<_discriminator, + TaggedUnionTypes...>::type; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/define_variant.hpp b/build-config/reflect-cpp/include/rfl/define_variant.hpp new file mode 100644 index 0000000..161a75e --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/define_variant.hpp @@ -0,0 +1,15 @@ +#ifndef RFL_DEFINEVARIANT_HPP_ +#define RFL_DEFINEVARIANT_HPP_ + +#include + +#include "internal/define_variant.hpp" + +namespace rfl { + +template +using define_variant_t = typename internal::define_variant::type; + +} // namespace rfl + +#endif // RFL_DEFINEVARIANT_HPP_ diff --git a/build-config/reflect-cpp/include/rfl/enums.hpp b/build-config/reflect-cpp/include/rfl/enums.hpp new file mode 100644 index 0000000..f2cab91 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/enums.hpp @@ -0,0 +1,118 @@ +#ifndef RFL_ENUMS_HPP_ +#define RFL_ENUMS_HPP_ + +#include + +#include "Result.hpp" +#include "internal/enums/get_enum_names.hpp" +#include "internal/strings/strings.hpp" +#include "thirdparty/enchantum/enchantum.hpp" +#include "thirdparty/enchantum/bitflags.hpp" + +namespace rfl { + +template +std::string enum_to_string(const EnumType _enum) { + const auto to_string_or_number = [](const EnumType e) { + const auto s = enchantum::to_string(e); + return s.empty() ? std::to_string( + static_cast>(e)) + : std::string(s); + }; + + if constexpr (enchantum::is_bitflag) { + // Iterates through the enum bit by bit and matches it against the flags. + using T = std::underlying_type_t; + auto val = static_cast(_enum); + int i = 0; + std::vector flags; + while (val != 0) { + const auto bit = val & static_cast(1); + if (bit == 1) { + auto str = + to_string_or_number(static_cast(static_cast(1) << i)); + flags.emplace_back(std::move(str)); + } + ++i; + val >>= 1; + } + return internal::strings::join("|", flags); + } else { + return to_string_or_number(_enum); + } +} + +// Converts a string to a value of the given enum type. +template +Result string_to_enum(const std::string& _str) { + const auto cast_numbers_or_names = + [](const std::string& name) -> Result { + const auto r = enchantum::cast(name); + if (r) return *r; + try { + return static_cast(std::stoi(name)); + } catch (std::exception& exp) { + return error(exp.what()); + } + }; + + if constexpr (enchantum::is_bitflag) { + using T = std::underlying_type_t; + const auto split = internal::strings::split(_str, "|"); + auto res = static_cast(0); + for (const auto& s : split) { + const auto r = cast_numbers_or_names(s); + if (r) { + res |= static_cast(*r); + } else { + return r; + } + } + return static_cast(res); + } else { + return cast_numbers_or_names(_str); + } +} + +// Returns a named tuple mapping names of enumerators of the given enum type to +// their values. +template +auto get_enumerators() { + return internal::enums::names_to_enumerator_named_tuple( + internal::enums::get_enum_names()); +} + +// Returns a named tuple mapping names of enumerators of the given enum type to +// their underlying values. +template +auto get_underlying_enumerators() { + return internal::enums::names_to_underlying_enumerator_named_tuple( + internal::enums::get_enum_names()); +} + +// Returns an std::array containing pairs of enumerator names (as +// std::string_view) and values. +template +constexpr auto get_enumerator_array() { + return internal::enums::names_to_enumerator_array( + internal::enums::get_enum_names()); +} + +// Returns an std::array containing pairs of enumerator names (as +// std::string_view) and underlying values. +template +constexpr auto get_underlying_enumerator_array() { + return internal::enums::names_to_underlying_enumerator_array( + internal::enums::get_enum_names()); +} + +// Returns the range of the given enum type as a pair of the minimum and maximum +template +constexpr auto get_enum_range() { + return std::make_pair(enchantum::enum_traits::min, + enchantum::enum_traits::max); +} + +} // namespace rfl + +#endif // RFL_ENUMS_HPP_ diff --git a/build-config/reflect-cpp/include/rfl/extract_discriminators.hpp b/build-config/reflect-cpp/include/rfl/extract_discriminators.hpp new file mode 100644 index 0000000..873bbdf --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/extract_discriminators.hpp @@ -0,0 +1,20 @@ +#ifndef RFL_EXTRACTDISTRIMINATORS_HPP_ +#define RFL_EXTRACTDISTRIMINATORS_HPP_ + +#include + +#include "TaggedUnion.hpp" +#include "define_literal.hpp" +#include "field_type.hpp" +#include "internal/extract_discriminators.hpp" + +namespace rfl { + +/// Extracts a Literal containing all of the discriminators from a TaggedUnion. +template +using extract_discriminators_t = + typename internal::extract_discriminators::type; + +} // namespace rfl + +#endif // RFL_EXTRACTDISTRIMINATORS_HPP_ diff --git a/build-config/reflect-cpp/include/rfl/field_names_t.hpp b/build-config/reflect-cpp/include/rfl/field_names_t.hpp new file mode 100644 index 0000000..b37eebb --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/field_names_t.hpp @@ -0,0 +1,18 @@ +#ifndef RFL_FIELD_NAMES_T_HPP_ +#define RFL_FIELD_NAMES_T_HPP_ + +#include +#include + +#include "internal/get_field_names.hpp" + +namespace rfl { + +/// Returns a rfl::Literal containing the field names of struct T. +template +using field_names_t = typename std::invoke_result< + decltype(internal::get_field_names>)>::type; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/field_type.hpp b/build-config/reflect-cpp/include/rfl/field_type.hpp new file mode 100644 index 0000000..9d79778 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/field_type.hpp @@ -0,0 +1,18 @@ +#ifndef RFL_FIELD_TYPE_HPP_ +#define RFL_FIELD_TYPE_HPP_ + +#include +#include +#include + +#include "internal/StringLiteral.hpp" +#include "internal/field_type.hpp" + +namespace rfl { + +template +using field_type_t = typename internal::FieldType<_field_name, T>::Type; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/fields.hpp b/build-config/reflect-cpp/include/rfl/fields.hpp new file mode 100644 index 0000000..4ae4e02 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/fields.hpp @@ -0,0 +1,17 @@ +#ifndef RFL_FIELDS_HPP_ +#define RFL_FIELDS_HPP_ + +#include "internal/get_meta_fields.hpp" +#include "named_tuple_t.hpp" + +namespace rfl { + +/// Returns meta-information about the fields. +template +auto fields() { + return internal::get_meta_fields>(); +} + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/from_generic.hpp b/build-config/reflect-cpp/include/rfl/from_generic.hpp new file mode 100644 index 0000000..0080a81 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/from_generic.hpp @@ -0,0 +1,17 @@ +#ifndef RFL_FROM_GENERIC_HPP_ +#define RFL_FROM_GENERIC_HPP_ + +#include "Generic.hpp" +#include "generic/read.hpp" + +namespace rfl { + +/// Generates the struct T from a named tuple. +template +auto from_generic(const Generic& _g) { + return rfl::generic::read(_g); +} + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/from_named_tuple.hpp b/build-config/reflect-cpp/include/rfl/from_named_tuple.hpp new file mode 100644 index 0000000..63a2983 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/from_named_tuple.hpp @@ -0,0 +1,53 @@ +#ifndef RFL_FROM_NAMED_TUPLE_HPP_ +#define RFL_FROM_NAMED_TUPLE_HPP_ + +#include + +#include "internal/copy_from_named_tuple.hpp" +#include "internal/copy_from_tuple.hpp" +#include "internal/has_fields.hpp" +#include "internal/move_from_named_tuple.hpp" +#include "internal/move_from_tuple.hpp" +#include "named_tuple_t.hpp" + +namespace rfl { + +/// Generates the struct T from a named tuple. +template +auto from_named_tuple(NamedTupleType&& _n) { + using RequiredType = std::remove_cvref_t>; + if constexpr (!std::is_same, + RequiredType>()) { + return from_named_tuple(RequiredType(std::forward(_n))); + } else if constexpr (internal::has_fields()) { + if constexpr (std::is_lvalue_reference{}) { + return internal::copy_from_named_tuple(_n); + } else { + return internal::move_from_named_tuple(_n); + } + } else { + if constexpr (std::is_lvalue_reference{}) { + return internal::copy_from_tuple(_n.values()); + } else { + return internal::move_from_tuple(std::move(_n.values())); + } + } +} + +/// Generates the struct T from a named tuple. +template +auto from_named_tuple(const NamedTupleType& _n) { + using RequiredType = std::remove_cvref_t>; + if constexpr (!std::is_same, + RequiredType>()) { + return from_named_tuple(RequiredType(_n)); + } else if constexpr (internal::has_fields()) { + return internal::copy_from_named_tuple(_n); + } else { + return internal::copy_from_tuple(_n.values()); + } +} + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/generic/Parser.hpp b/build-config/reflect-cpp/include/rfl/generic/Parser.hpp new file mode 100644 index 0000000..30d9015 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/generic/Parser.hpp @@ -0,0 +1,17 @@ +#ifndef GENERIC_PARSER_HPP_ +#define GENERIC_PARSER_HPP_ + +#include "../parsing/Parser.hpp" +#include "Reader.hpp" +#include "Writer.hpp" + +namespace rfl { +namespace generic { + +template +using Parser = parsing::Parser; + +} +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/generic/Reader.hpp b/build-config/reflect-cpp/include/rfl/generic/Reader.hpp new file mode 100644 index 0000000..2792082 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/generic/Reader.hpp @@ -0,0 +1,102 @@ +#ifndef GENERIC_READER_HPP_ +#define GENERIC_READER_HPP_ + +#include +#include +#include +#include + +#include "../Generic.hpp" +#include "../Result.hpp" +#include "../always_false.hpp" + +namespace rfl::generic { + +struct Reader { + using InputArrayType = Generic::Array; + using InputObjectType = Generic::Object; + using InputVarType = Generic; + + template + static constexpr bool has_custom_constructor = false; + + rfl::Result get_field_from_array( + const size_t _idx, const InputArrayType& _arr) const noexcept { + if (_idx >= _arr.size()) { + return error("Index " + std::to_string(_idx) + " of of bounds."); + } + return _arr[_idx]; + } + + rfl::Result get_field_from_object( + const std::string& _name, const InputObjectType& _obj) const noexcept { + return _obj.get(_name); + } + + bool is_empty(const InputVarType& _var) const noexcept { + return _var.is_null(); + } + + template + rfl::Result to_basic_type(const InputVarType& _var) const noexcept { + if constexpr (std::is_same, std::string>()) { + return _var.to_string(); + } else if constexpr (std::is_same, bool>()) { + return _var.to_bool(); + } else if constexpr (std::is_floating_point>()) { + return _var.to_double().transform( + [](const auto& _v) { return static_cast(_v); }); + } else if constexpr (std::is_integral>()) { + if constexpr (sizeof(T) > sizeof(int)) { + return _var.to_int64().transform( + [](const auto& _v) { return static_cast(_v); }); + } else { + return _var.to_int().transform( + [](const auto& _v) { return static_cast(_v); }); + } + } else { + static_assert(rfl::always_false_v, "Unsupported type."); + } + } + + template + std::optional read_array(const ArrayReader& _array_reader, + const InputArrayType& _arr) const noexcept { + for (const auto& v : _arr) { + const auto err = _array_reader.read(InputVarType(v)); + if (err) { + return err; + } + } + return std::nullopt; + } + + template + std::optional read_object(const ObjectReader& _object_reader, + const InputObjectType& _obj) const noexcept { + for (const auto& [k, v] : _obj) { + _object_reader.read(std::string_view(k), v); + } + return std::nullopt; + } + + rfl::Result to_array( + const InputVarType& _var) const noexcept { + return _var.to_array(); + } + + rfl::Result to_object( + const InputVarType& _var) const noexcept { + return _var.to_object(); + } + + template + rfl::Result use_custom_constructor( + const InputVarType /*_var*/) const noexcept { + return error("Not supported for generic types"); + } +}; + +} // namespace rfl::generic + +#endif diff --git a/build-config/reflect-cpp/include/rfl/generic/Writer.hpp b/build-config/reflect-cpp/include/rfl/generic/Writer.hpp new file mode 100644 index 0000000..d9e8cd8 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/generic/Writer.hpp @@ -0,0 +1,110 @@ +#ifndef GENERIC_WRITER_HPP_ +#define GENERIC_WRITER_HPP_ + +#include +#include +#include +#include +#include + +#include "../Generic.hpp" +#include "../always_false.hpp" +#include "../common.hpp" + +namespace rfl::generic { + +struct RFL_API Writer { + struct OutputArray { + Generic::Array* val_; + }; + + struct OutputObject { + Generic::Object* val_; + }; + + using OutputArrayType = OutputArray; + using OutputObjectType = OutputObject; + using OutputVarType = Generic; + + Writer() {} + + ~Writer() = default; + + OutputArrayType array_as_root(const size_t _size) const noexcept; + + OutputObjectType object_as_root(const size_t _size) const noexcept; + + OutputVarType null_as_root() const noexcept; + + template + OutputVarType value_as_root(const T& _var) const noexcept { + root_ = to_generic(_var); + return root_; + } + + OutputArrayType add_array_to_array(const size_t _size, + OutputArrayType* _parent) const noexcept; + + OutputArrayType add_array_to_object(const std::string_view& _name, + const size_t _size, + OutputObjectType* _parent) const noexcept; + + OutputObjectType add_object_to_array(const size_t _size, + OutputArrayType* _parent) const noexcept; + + OutputObjectType add_object_to_object( + const std::string_view& _name, const size_t _size, + OutputObjectType* _parent) const noexcept; + + template + OutputVarType add_value_to_array(const T& _var, + OutputArrayType* _parent) const noexcept { + const auto g = to_generic(_var); + _parent->val_->push_back(g); + return g; + } + + template + OutputVarType add_value_to_object(const std::string_view& _name, + const T& _var, + OutputObjectType* _parent) const noexcept { + const auto g = to_generic(_var); + _parent->val_->insert(_name, g); + return g; + } + + OutputVarType add_null_to_array(OutputArrayType* _parent) const noexcept; + + OutputVarType add_null_to_object(const std::string_view& _name, + OutputObjectType* _parent) const noexcept; + + void end_array(OutputArrayType*) const noexcept {} + + void end_object(OutputObjectType*) const noexcept {} + + OutputVarType& root() { return root_; } + + private: + template + OutputVarType to_generic(const T& _var) const noexcept { + if constexpr (std::is_same, std::string>()) { + return OutputVarType(_var); + } else if constexpr (std::is_same, bool>()) { + return OutputVarType(_var); + } else if constexpr (std::is_floating_point>()) { + return OutputVarType(static_cast(_var)); + } else if constexpr (std::is_integral>()) { + return OutputVarType(static_cast(_var)); + } else { + static_assert(always_false_v, "Unsupported type"); + } + return OutputVarType{}; + } + + private: + mutable OutputVarType root_; +}; + +} // namespace rfl::generic + +#endif diff --git a/build-config/reflect-cpp/include/rfl/generic/read.hpp b/build-config/reflect-cpp/include/rfl/generic/read.hpp new file mode 100644 index 0000000..0934c8c --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/generic/read.hpp @@ -0,0 +1,22 @@ +#ifndef GENERIC_READ_HPP_ +#define GENERIC_READ_HPP_ + + +#include "../Generic.hpp" +#include "../Processors.hpp" +#include "Parser.hpp" + +namespace rfl { +namespace generic { + +/// Parses an object from a generic type. +template +auto read(const Generic& _g) { + const auto r = Reader(); + return Parser>::read(r, _g); +} + +} // namespace generic +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/generic/write.hpp b/build-config/reflect-cpp/include/rfl/generic/write.hpp new file mode 100644 index 0000000..401c692 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/generic/write.hpp @@ -0,0 +1,24 @@ +#ifndef GENERIC_WRITE_HPP_ +#define GENERIC_WRITE_HPP_ + +#include "../Generic.hpp" +#include "../parsing/Parent.hpp" +#include "Parser.hpp" + +namespace rfl { +namespace generic { + +/// Writes an object to a generic. +template +Generic write(const auto& _t) { + using T = std::remove_cvref_t; + using ParentType = parsing::Parent; + auto w = Writer(); + Parser>::write(w, _t, typename ParentType::Root{}); + return w.root(); +} + +} // namespace generic +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/get.hpp b/build-config/reflect-cpp/include/rfl/get.hpp new file mode 100644 index 0000000..74ed3c6 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/get.hpp @@ -0,0 +1,48 @@ +#ifndef RFL_GET_HPP_ +#define RFL_GET_HPP_ + +#include "internal/Getter.hpp" +#include "internal/StringLiteral.hpp" + +namespace rfl { + +/// Gets a field by index. +template +inline auto& get(NamedTupleType& _tup) { + return internal::Getter::template get<_index>(_tup); +} + +/// Gets a field by name. +template +inline auto& get(NamedTupleType& _tup) { + return internal::Getter::template get<_field_name>(_tup); +} + +/// Gets a field by the field type. +template +inline auto& get(NamedTupleType& _tup) { + return internal::Getter::template get(_tup); +} + +/// Gets a field by index. +template +inline const auto& get(const NamedTupleType& _tup) { + return internal::Getter::template get_const<_index>(_tup); +} + +/// Gets a field by name. +template +inline const auto& get(const NamedTupleType& _tup) { + return internal::Getter::template get_const<_field_name>( + _tup); +} + +/// Gets a field by the field type. +template +inline const auto& get(const NamedTupleType& _tup) { + return internal::Getter::template get_const(_tup); +} + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/Array.hpp b/build-config/reflect-cpp/include/rfl/internal/Array.hpp new file mode 100644 index 0000000..8e16b63 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/Array.hpp @@ -0,0 +1,32 @@ +#ifndef RFL_INTERNAL_ARRAY_HPP_ +#define RFL_INTERNAL_ARRAY_HPP_ + +#include +#include + +#include "to_std_array.hpp" + +namespace rfl { +namespace internal { + +template + requires std::is_array_v +struct Array { + using Type = T; + using StdArrayType = to_std_array_t; + + Array() = default; + Array(const StdArrayType &_arr) : arr_(_arr) {} + Array(StdArrayType &&_arr) : arr_(std::move(_arr)) {} + Array(const T &_arr) : arr_(to_std_array(_arr)) {} + Array(T &&_arr) : arr_(to_std_array(_arr)) {} + + ~Array() = default; + + StdArrayType arr_; +}; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/Field.hpp b/build-config/reflect-cpp/include/rfl/internal/Field.hpp new file mode 100644 index 0000000..186b12f --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/Field.hpp @@ -0,0 +1,18 @@ +#ifndef RFL_INTERNAL_FIELD_TUPLE_T_HPP_ +#define RFL_INTERNAL_FIELD_TUPLE_T_HPP_ + +#include + +#include "copy_to_field_tuple.hpp" + +namespace rfl { +namespace internal { + +template +using field_tuple_t = + typename std::invoke_result), T>::type; + +} +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/Fields.hpp b/build-config/reflect-cpp/include/rfl/internal/Fields.hpp new file mode 100644 index 0000000..b9b242a --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/Fields.hpp @@ -0,0 +1,23 @@ +#ifndef RFL_INTERNAL_FIELDS_HPP_ +#define RFL_INTERNAL_FIELDS_HPP_ + +#include +#include +#include +#include +#include + +namespace rfl { +namespace internal { + +template +struct Fields { + std::array names_; + + std::unordered_map indices_; +}; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/Getter.hpp b/build-config/reflect-cpp/include/rfl/internal/Getter.hpp new file mode 100644 index 0000000..d64aae4 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/Getter.hpp @@ -0,0 +1,84 @@ +#ifndef RFL_INTERNAL_GETTER_HPP_ +#define RFL_INTERNAL_GETTER_HPP_ + +#include "../Tuple.hpp" +#include "StringLiteral.hpp" +#include "find_index.hpp" + +namespace rfl::internal { + +// ---------------------------------------------------------------------------- + +template +struct Getter; + +// ---------------------------------------------------------------------------- + +/// Default case - anything that cannot be explicitly matched. +template +struct Getter { + public: + /// Retrieves the indicated value from the tuple. + template + static inline auto& get(NamedTupleType& _tup) { + return rfl::get<_index>(_tup.values()); + } + + /// Gets a field by name. + template + static inline auto& get(NamedTupleType& _tup) { + constexpr auto index = + find_index<_field_name, typename NamedTupleType::Fields>(); + return Getter::template get(_tup); + } + + /// Gets a field by the field type. + template + static inline auto& get(NamedTupleType& _tup) { + constexpr auto index = + find_index(); + static_assert( + std::is_same::Type, + typename Field::Type>(), + "If two fields have the same name, " + "their type must be the same as " + "well."); + return Getter::template get(_tup); + } + + /// Retrieves the indicated value from the tuple. + template + static inline const auto& get_const(const NamedTupleType& _tup) { + return rfl::get<_index>(_tup.values()); + } + + /// Gets a field by name. + template + static inline const auto& get_const(const NamedTupleType& _tup) { + constexpr auto index = + find_index<_field_name, typename NamedTupleType::Fields>(); + return Getter::template get_const(_tup); + } + + /// Gets a field by the field type. + template + static inline const auto& get_const(const NamedTupleType& _tup) { + constexpr auto index = + find_index(); + static_assert( + std::is_same::Type, + typename Field::Type>(), + "If two fields have the same name, " + "their type must be the same as " + "well."); + return Getter::template get_const(_tup); + } +}; + +// ---------------------------------------------------------------------------- + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/HasValidation.hpp b/build-config/reflect-cpp/include/rfl/internal/HasValidation.hpp new file mode 100644 index 0000000..23391c3 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/HasValidation.hpp @@ -0,0 +1,17 @@ +#ifndef RFL_INTERNAL_HASVALIDATION_HPP_ +#define RFL_INTERNAL_HASVALIDATION_HPP_ + +#include "../Result.hpp" + +namespace rfl { +namespace internal { + +template +concept HasValidation = requires(Class obj, T value) { + { Class::validate(value) } -> std::same_as>; +}; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/Skip.hpp b/build-config/reflect-cpp/include/rfl/internal/Skip.hpp new file mode 100644 index 0000000..a97603d --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/Skip.hpp @@ -0,0 +1,149 @@ +#ifndef RFL_INTERNAL_SKIP_HPP_ +#define RFL_INTERNAL_SKIP_HPP_ + +#include +#include + +#include "../default.hpp" + +namespace rfl::internal { + +template +class Skip { + private: + using SelfType = Skip; + + public: + static constexpr bool skip_serialization_ = _skip_serialization; + static constexpr bool skip_deserialization_ = _skip_deserialization; + + /// The underlying type. + using Type = T; + using ReflectionType = std::optional; + + Skip() : value_(Type()) {} + + Skip(const Type& _value) : value_(_value) {} + + Skip(ReflectionType&& _value) noexcept + : value_(_value ? std::move(*_value) : Type()) {} + + Skip(const ReflectionType& _value) : value_(_value ? *_value : Type()) {} + + Skip(Type&& _value) noexcept : value_(std::move(_value)) {} + + Skip(SelfType&& _skip) noexcept = default; + + Skip(const SelfType& _skip) = default; + + template + Skip(const Skip& _other) : value_(_other.get()) {} + + template + Skip(Skip&& _other) : value_(_other.get()) {} + + template , + bool>::type = true> + Skip(const U& _value) : value_(_value) {} + + template , + bool>::type = true> + Skip(U&& _value) noexcept : value_(std::forward(_value)) {} + + template , + bool>::type = true> + Skip(const Skip& _skip) : value_(_skip.value()) {} + + /// Assigns the underlying object to its default value. + template , + bool>::type = true> + Skip(const Default&) : value_(Type()) {} + + ~Skip() = default; + + /// Returns the underlying object. + Type& get() { return value_; } + + /// Returns the underlying object. + const Type& get() const { return value_; } + + /// Returns the underlying object. + Type& operator()() { return value_; } + + /// Returns the underlying object. + const Type& operator()() const { return value_; } + + /// Assigns the underlying object. + auto& operator=(const Type& _value) { + value_ = _value; + return *this; + } + + /// Assigns the underlying object. + auto& operator=(Type&& _value) noexcept { + value_ = std::move(_value); + return *this; + } + + /// Assigns the underlying object. + template , + bool>::type = true> + auto& operator=(const U& _value) { + value_ = _value; + return *this; + } + + /// Assigns the underlying object to its default value. + template , + bool>::type = true> + auto& operator=(const Default&) { + value_ = Type(); + return *this; + } + + /// Assigns the underlying object. + SelfType& operator=(const SelfType& _other) = default; + + /// Assigns the underlying object. + SelfType& operator=(SelfType&& _other) = default; + + /// Assigns the underlying object. + template + auto& operator=(const Skip& _skip) { + value_ = _skip.get(); + return *this; + } + + /// Assigns the underlying object. + template + auto& operator=(Skip&& _skip) { + value_ = std::forward(_skip.value_); + return *this; + } + + /// Returns the ReflectionType - necessary for the serialization to work. + ReflectionType reflection() const { return value_; } + + /// Assigns the underlying object. + void set(const Type& _value) { value_ = _value; } + + /// Assigns the underlying object. + void set(Type&& _value) { value_ = std::move(_value); } + + /// Returns the underlying object. + Type& value() { return value_; } + + /// Returns the underlying object. + const Type& value() const { return value_; } + + private: + /// The underlying value + T value_; +}; + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/StringLiteral.hpp b/build-config/reflect-cpp/include/rfl/internal/StringLiteral.hpp new file mode 100644 index 0000000..c4cc88c --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/StringLiteral.hpp @@ -0,0 +1,56 @@ +#ifndef RFL_INTERNAL_STRINGLITERAL_HPP_ +#define RFL_INTERNAL_STRINGLITERAL_HPP_ + +#include +#include +#include +#include + +namespace rfl { +namespace internal { + +/// Normal strings cannot be used as template +/// parameters, but this can. This is needed +/// for the parameters names in the NamedTuples. +template +struct StringLiteral { + constexpr StringLiteral(const auto... _chars) : arr_{_chars..., '\0'} {} + + constexpr StringLiteral(const std::array _arr) : arr_(_arr) {} + + constexpr StringLiteral(const char (&_str)[N]) { + std::copy_n(_str, N, std::data(arr_)); + } + + /// Returns the value as a string. + std::string str() const { return std::string(string_view()); } + + /// Returns the value as a string. + constexpr std::string_view string_view() const { + return std::string_view(std::data(arr_), N - 1); + } + + static constexpr size_t length = N - 1; + + std::array arr_{}; +}; + +template +constexpr inline bool operator==(const StringLiteral& _first, + const StringLiteral& _second) { + if constexpr (N1 != N2) { + return false; + } + return _first.string_view() == _second.string_view(); +} + +template +constexpr inline bool operator!=(const StringLiteral& _first, + const StringLiteral& _second) { + return !(_first == _second); +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/VisitTree.hpp b/build-config/reflect-cpp/include/rfl/internal/VisitTree.hpp new file mode 100644 index 0000000..954877a --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/VisitTree.hpp @@ -0,0 +1,29 @@ +#ifndef RFL_INTERNAL_VISITTREE_HPP_ +#define RFL_INTERNAL_VISITTREE_HPP_ + +namespace rfl { +namespace internal { + +struct VisitTree { + /// Evaluates a visitor pattern using a tree-like structure. + template + static inline auto visit(const auto& _v, const int _i, + const Args&... _args) { + static_assert(_end > _begin, "_end needs to be greater than _begin."); + if constexpr (_end - _begin == 1) { + return _v.template visit<_begin>(_args...); + } else { + constexpr int middle = (_begin + _end) / 2; + if (_i < middle) { + return visit<_begin, middle, Visitor>(_v, _i, _args...); + } else { + return visit(_v, _i, _args...); + } + } + } +}; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/VisitorWrapper.hpp b/build-config/reflect-cpp/include/rfl/internal/VisitorWrapper.hpp new file mode 100644 index 0000000..06bc7c8 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/VisitorWrapper.hpp @@ -0,0 +1,27 @@ +#ifndef RFL_INTERNAL_VISITORWRAPPER_HPP_ +#define RFL_INTERNAL_VISITORWRAPPER_HPP_ + +#include "../Literal.hpp" +#include "../TaggedUnion.hpp" +#include "StringLiteral.hpp" + +namespace rfl { +namespace internal { + +/// Necessary for the VisitTree structure. +template +struct VisitorWrapper { + /// Calls the underlying visitor when required to do so. + template + inline auto visit(const Args&... _args) const { + return (*visitor_)(name_of, _i>(), _args...); + } + + /// The underlying visitor. + const Visitor* visitor_; +}; + +} // namespace internal +} // namespace rfl + +#endif // RFL_VISIT_HPP_ diff --git a/build-config/reflect-cpp/include/rfl/internal/all_fields.hpp b/build-config/reflect-cpp/include/rfl/internal/all_fields.hpp new file mode 100644 index 0000000..9d9190b --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/all_fields.hpp @@ -0,0 +1,23 @@ +#ifndef RFL_INTERNAL_ALLFIELDS_HPP_ +#define RFL_INTERNAL_ALLFIELDS_HPP_ + +#include "../Tuple.hpp" +#include "is_field.hpp" + +namespace rfl { +namespace internal { + +template +constexpr bool all_fields() { + if constexpr (_i == rfl::tuple_size_v) { + return true; + } else { + using T = tuple_element_t<_i, TupleType>; + return is_field_v && all_fields(); + } +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/bind_to_tuple.hpp b/build-config/reflect-cpp/include/rfl/internal/bind_to_tuple.hpp new file mode 100644 index 0000000..e2b28b2 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/bind_to_tuple.hpp @@ -0,0 +1,4401 @@ +#ifndef RFL_INTERNAL_BIND_TO_TUPLE_HPP_ +#define RFL_INTERNAL_BIND_TO_TUPLE_HPP_ + +#include +#include +#include + +#include "../Tuple.hpp" +#include "../always_false.hpp" +// #include "is_named_tuple.hpp" //Not here +#include "num_fields.hpp" + +namespace rfl::internal { + +#define RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( \ + n, ...) \ + auto& [__VA_ARGS__] = _t; \ + return [](auto&... _refs) { return rfl::make_tuple(&_refs...); }(__VA_ARGS__); + +// The following boilerplate code has been generated with +// scripts/bind_to_tuple_impl.py +template +auto bind_to_tuple_impl(auto& _t) { + if constexpr (_num_fields == 0) { + return rfl::make_tuple(); + } else { + if constexpr (_num_fields < 129) { + if constexpr (_num_fields < 65) { + if constexpr (_num_fields < 33) { + if constexpr (_num_fields < 17) { + if constexpr (_num_fields < 9) { + if constexpr (_num_fields < 5) { + if constexpr (_num_fields < 3) { + if constexpr (_num_fields < 2) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 1, f1); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 2, f1, f2); + } + } else { + if constexpr (_num_fields < 4) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 3, f1, f2, f3); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 4, f1, f2, f3, f4); + } + } + } else { + if constexpr (_num_fields < 7) { + if constexpr (_num_fields < 6) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 5, f1, f2, f3, f4, f5); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 6, f1, f2, f3, f4, f5, f6); + } + } else { + if constexpr (_num_fields < 8) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 7, f1, f2, f3, f4, f5, f6, f7); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 8, f1, f2, f3, f4, f5, f6, f7, f8); + } + } + } + } else { + if constexpr (_num_fields < 13) { + if constexpr (_num_fields < 11) { + if constexpr (_num_fields < 10) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 9, f1, f2, f3, f4, f5, f6, f7, f8, f9); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 10, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10); + } + } else { + if constexpr (_num_fields < 12) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 11, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 12, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12); + } + } + } else { + if constexpr (_num_fields < 15) { + if constexpr (_num_fields < 14) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 13, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 14, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14); + } + } else { + if constexpr (_num_fields < 16) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 15, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 16, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16); + } + } + } + } + } else { + if constexpr (_num_fields < 25) { + if constexpr (_num_fields < 21) { + if constexpr (_num_fields < 19) { + if constexpr (_num_fields < 18) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 17, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 18, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18); + } + } else { + if constexpr (_num_fields < 20) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 19, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 20, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20); + } + } + } else { + if constexpr (_num_fields < 23) { + if constexpr (_num_fields < 22) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 21, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 22, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22); + } + } else { + if constexpr (_num_fields < 24) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 23, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 24, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24); + } + } + } + } else { + if constexpr (_num_fields < 29) { + if constexpr (_num_fields < 27) { + if constexpr (_num_fields < 26) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 25, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 26, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26); + } + } else { + if constexpr (_num_fields < 28) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 27, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 28, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28); + } + } + } else { + if constexpr (_num_fields < 31) { + if constexpr (_num_fields < 30) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 29, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 30, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30); + } + } else { + if constexpr (_num_fields < 32) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 31, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 32, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32); + } + } + } + } + } + } else { + if constexpr (_num_fields < 49) { + if constexpr (_num_fields < 41) { + if constexpr (_num_fields < 37) { + if constexpr (_num_fields < 35) { + if constexpr (_num_fields < 34) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 33, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 34, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34); + } + } else { + if constexpr (_num_fields < 36) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 35, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 36, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36); + } + } + } else { + if constexpr (_num_fields < 39) { + if constexpr (_num_fields < 38) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 37, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 38, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38); + } + } else { + if constexpr (_num_fields < 40) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 39, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 40, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40); + } + } + } + } else { + if constexpr (_num_fields < 45) { + if constexpr (_num_fields < 43) { + if constexpr (_num_fields < 42) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 41, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 42, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42); + } + } else { + if constexpr (_num_fields < 44) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 43, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 44, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44); + } + } + } else { + if constexpr (_num_fields < 47) { + if constexpr (_num_fields < 46) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 45, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 46, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46); + } + } else { + if constexpr (_num_fields < 48) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 47, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 48, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48); + } + } + } + } + } else { + if constexpr (_num_fields < 57) { + if constexpr (_num_fields < 53) { + if constexpr (_num_fields < 51) { + if constexpr (_num_fields < 50) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 49, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 50, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50); + } + } else { + if constexpr (_num_fields < 52) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 51, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 52, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52); + } + } + } else { + if constexpr (_num_fields < 55) { + if constexpr (_num_fields < 54) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 53, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 54, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54); + } + } else { + if constexpr (_num_fields < 56) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 55, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 56, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56); + } + } + } + } else { + if constexpr (_num_fields < 61) { + if constexpr (_num_fields < 59) { + if constexpr (_num_fields < 58) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 57, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 58, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58); + } + } else { + if constexpr (_num_fields < 60) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 59, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 60, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60); + } + } + } else { + if constexpr (_num_fields < 63) { + if constexpr (_num_fields < 62) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 61, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 62, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62); + } + } else { + if constexpr (_num_fields < 64) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 63, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 64, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64); + } + } + } + } + } + } + } else { + if constexpr (_num_fields < 97) { + if constexpr (_num_fields < 81) { + if constexpr (_num_fields < 73) { + if constexpr (_num_fields < 69) { + if constexpr (_num_fields < 67) { + if constexpr (_num_fields < 66) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 65, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 66, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66); + } + } else { + if constexpr (_num_fields < 68) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 67, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 68, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68); + } + } + } else { + if constexpr (_num_fields < 71) { + if constexpr (_num_fields < 70) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 69, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 70, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70); + } + } else { + if constexpr (_num_fields < 72) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 71, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 72, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72); + } + } + } + } else { + if constexpr (_num_fields < 77) { + if constexpr (_num_fields < 75) { + if constexpr (_num_fields < 74) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 73, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 74, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74); + } + } else { + if constexpr (_num_fields < 76) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 75, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 76, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76); + } + } + } else { + if constexpr (_num_fields < 79) { + if constexpr (_num_fields < 78) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 77, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 78, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78); + } + } else { + if constexpr (_num_fields < 80) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 79, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 80, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80); + } + } + } + } + } else { + if constexpr (_num_fields < 89) { + if constexpr (_num_fields < 85) { + if constexpr (_num_fields < 83) { + if constexpr (_num_fields < 82) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 81, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 82, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82); + } + } else { + if constexpr (_num_fields < 84) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 83, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 84, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84); + } + } + } else { + if constexpr (_num_fields < 87) { + if constexpr (_num_fields < 86) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 85, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 86, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86); + } + } else { + if constexpr (_num_fields < 88) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 87, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 88, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88); + } + } + } + } else { + if constexpr (_num_fields < 93) { + if constexpr (_num_fields < 91) { + if constexpr (_num_fields < 90) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 89, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 90, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90); + } + } else { + if constexpr (_num_fields < 92) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 91, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 92, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92); + } + } + } else { + if constexpr (_num_fields < 95) { + if constexpr (_num_fields < 94) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 93, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 94, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94); + } + } else { + if constexpr (_num_fields < 96) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 95, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 96, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96); + } + } + } + } + } + } else { + if constexpr (_num_fields < 113) { + if constexpr (_num_fields < 105) { + if constexpr (_num_fields < 101) { + if constexpr (_num_fields < 99) { + if constexpr (_num_fields < 98) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 97, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 98, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98); + } + } else { + if constexpr (_num_fields < 100) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 99, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 100, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100); + } + } + } else { + if constexpr (_num_fields < 103) { + if constexpr (_num_fields < 102) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 101, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 102, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102); + } + } else { + if constexpr (_num_fields < 104) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 103, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 104, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104); + } + } + } + } else { + if constexpr (_num_fields < 109) { + if constexpr (_num_fields < 107) { + if constexpr (_num_fields < 106) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 105, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 106, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106); + } + } else { + if constexpr (_num_fields < 108) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 107, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 108, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108); + } + } + } else { + if constexpr (_num_fields < 111) { + if constexpr (_num_fields < 110) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 109, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 110, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110); + } + } else { + if constexpr (_num_fields < 112) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 111, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 112, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112); + } + } + } + } + } else { + if constexpr (_num_fields < 121) { + if constexpr (_num_fields < 117) { + if constexpr (_num_fields < 115) { + if constexpr (_num_fields < 114) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 113, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 114, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114); + } + } else { + if constexpr (_num_fields < 116) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 115, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 116, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116); + } + } + } else { + if constexpr (_num_fields < 119) { + if constexpr (_num_fields < 118) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 117, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 118, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118); + } + } else { + if constexpr (_num_fields < 120) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 119, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 120, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120); + } + } + } + } else { + if constexpr (_num_fields < 125) { + if constexpr (_num_fields < 123) { + if constexpr (_num_fields < 122) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 121, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 122, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122); + } + } else { + if constexpr (_num_fields < 124) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 123, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 124, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124); + } + } + } else { + if constexpr (_num_fields < 127) { + if constexpr (_num_fields < 126) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 125, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 126, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126); + } + } else { + if constexpr (_num_fields < 128) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 127, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 128, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128); + } + } + } + } + } + } + } + } else { + if constexpr (_num_fields < 193) { + if constexpr (_num_fields < 161) { + if constexpr (_num_fields < 145) { + if constexpr (_num_fields < 137) { + if constexpr (_num_fields < 133) { + if constexpr (_num_fields < 131) { + if constexpr (_num_fields < 130) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 129, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 130, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130); + } + } else { + if constexpr (_num_fields < 132) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 131, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 132, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132); + } + } + } else { + if constexpr (_num_fields < 135) { + if constexpr (_num_fields < 134) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 133, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 134, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134); + } + } else { + if constexpr (_num_fields < 136) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 135, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 136, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136); + } + } + } + } else { + if constexpr (_num_fields < 141) { + if constexpr (_num_fields < 139) { + if constexpr (_num_fields < 138) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 137, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 138, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138); + } + } else { + if constexpr (_num_fields < 140) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 139, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 140, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140); + } + } + } else { + if constexpr (_num_fields < 143) { + if constexpr (_num_fields < 142) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 141, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 142, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142); + } + } else { + if constexpr (_num_fields < 144) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 143, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 144, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144); + } + } + } + } + } else { + if constexpr (_num_fields < 153) { + if constexpr (_num_fields < 149) { + if constexpr (_num_fields < 147) { + if constexpr (_num_fields < 146) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 145, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 146, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146); + } + } else { + if constexpr (_num_fields < 148) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 147, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 148, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148); + } + } + } else { + if constexpr (_num_fields < 151) { + if constexpr (_num_fields < 150) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 149, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 150, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150); + } + } else { + if constexpr (_num_fields < 152) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 151, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 152, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152); + } + } + } + } else { + if constexpr (_num_fields < 157) { + if constexpr (_num_fields < 155) { + if constexpr (_num_fields < 154) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 153, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 154, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154); + } + } else { + if constexpr (_num_fields < 156) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 155, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 156, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156); + } + } + } else { + if constexpr (_num_fields < 159) { + if constexpr (_num_fields < 158) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 157, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 158, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158); + } + } else { + if constexpr (_num_fields < 160) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 159, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 160, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160); + } + } + } + } + } + } else { + if constexpr (_num_fields < 177) { + if constexpr (_num_fields < 169) { + if constexpr (_num_fields < 165) { + if constexpr (_num_fields < 163) { + if constexpr (_num_fields < 162) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 161, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 162, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162); + } + } else { + if constexpr (_num_fields < 164) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 163, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 164, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164); + } + } + } else { + if constexpr (_num_fields < 167) { + if constexpr (_num_fields < 166) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 165, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 166, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166); + } + } else { + if constexpr (_num_fields < 168) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 167, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 168, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168); + } + } + } + } else { + if constexpr (_num_fields < 173) { + if constexpr (_num_fields < 171) { + if constexpr (_num_fields < 170) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 169, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 170, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170); + } + } else { + if constexpr (_num_fields < 172) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 171, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 172, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172); + } + } + } else { + if constexpr (_num_fields < 175) { + if constexpr (_num_fields < 174) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 173, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 174, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174); + } + } else { + if constexpr (_num_fields < 176) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 175, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 176, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176); + } + } + } + } + } else { + if constexpr (_num_fields < 185) { + if constexpr (_num_fields < 181) { + if constexpr (_num_fields < 179) { + if constexpr (_num_fields < 178) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 177, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 178, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178); + } + } else { + if constexpr (_num_fields < 180) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 179, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 180, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180); + } + } + } else { + if constexpr (_num_fields < 183) { + if constexpr (_num_fields < 182) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 181, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 182, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182); + } + } else { + if constexpr (_num_fields < 184) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 183, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 184, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184); + } + } + } + } else { + if constexpr (_num_fields < 189) { + if constexpr (_num_fields < 187) { + if constexpr (_num_fields < 186) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 185, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 186, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186); + } + } else { + if constexpr (_num_fields < 188) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 187, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 188, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188); + } + } + } else { + if constexpr (_num_fields < 191) { + if constexpr (_num_fields < 190) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 189, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 190, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190); + } + } else { + if constexpr (_num_fields < 192) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 191, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 192, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192); + } + } + } + } + } + } + } else { + if constexpr (_num_fields < 225) { + if constexpr (_num_fields < 209) { + if constexpr (_num_fields < 201) { + if constexpr (_num_fields < 197) { + if constexpr (_num_fields < 195) { + if constexpr (_num_fields < 194) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 193, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 194, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194); + } + } else { + if constexpr (_num_fields < 196) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 195, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 196, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196); + } + } + } else { + if constexpr (_num_fields < 199) { + if constexpr (_num_fields < 198) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 197, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 198, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198); + } + } else { + if constexpr (_num_fields < 200) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 199, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 200, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200); + } + } + } + } else { + if constexpr (_num_fields < 205) { + if constexpr (_num_fields < 203) { + if constexpr (_num_fields < 202) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 201, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 202, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202); + } + } else { + if constexpr (_num_fields < 204) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 203, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 204, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204); + } + } + } else { + if constexpr (_num_fields < 207) { + if constexpr (_num_fields < 206) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 205, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 206, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206); + } + } else { + if constexpr (_num_fields < 208) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 207, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 208, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208); + } + } + } + } + } else { + if constexpr (_num_fields < 217) { + if constexpr (_num_fields < 213) { + if constexpr (_num_fields < 211) { + if constexpr (_num_fields < 210) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 209, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 210, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210); + } + } else { + if constexpr (_num_fields < 212) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 211, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 212, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212); + } + } + } else { + if constexpr (_num_fields < 215) { + if constexpr (_num_fields < 214) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 213, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 214, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214); + } + } else { + if constexpr (_num_fields < 216) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 215, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 216, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216); + } + } + } + } else { + if constexpr (_num_fields < 221) { + if constexpr (_num_fields < 219) { + if constexpr (_num_fields < 218) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 217, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 218, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218); + } + } else { + if constexpr (_num_fields < 220) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 219, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 220, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220); + } + } + } else { + if constexpr (_num_fields < 223) { + if constexpr (_num_fields < 222) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 221, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 222, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222); + } + } else { + if constexpr (_num_fields < 224) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 223, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 224, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224); + } + } + } + } + } + } else { + if constexpr (_num_fields < 241) { + if constexpr (_num_fields < 233) { + if constexpr (_num_fields < 229) { + if constexpr (_num_fields < 227) { + if constexpr (_num_fields < 226) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 225, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 226, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226); + } + } else { + if constexpr (_num_fields < 228) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 227, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 228, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228); + } + } + } else { + if constexpr (_num_fields < 231) { + if constexpr (_num_fields < 230) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 229, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 230, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230); + } + } else { + if constexpr (_num_fields < 232) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 231, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 232, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231, f232); + } + } + } + } else { + if constexpr (_num_fields < 237) { + if constexpr (_num_fields < 235) { + if constexpr (_num_fields < 234) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 233, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231, f232, f233); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 234, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231, f232, f233, f234); + } + } else { + if constexpr (_num_fields < 236) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 235, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231, f232, f233, f234, f235); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 236, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231, f232, f233, f234, f235, + f236); + } + } + } else { + if constexpr (_num_fields < 239) { + if constexpr (_num_fields < 238) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 237, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231, f232, f233, f234, f235, + f236, f237); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 238, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231, f232, f233, f234, f235, + f236, f237, f238); + } + } else { + if constexpr (_num_fields < 240) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 239, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231, f232, f233, f234, f235, + f236, f237, f238, f239); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 240, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231, f232, f233, f234, f235, + f236, f237, f238, f239, f240); + } + } + } + } + } else { + if constexpr (_num_fields < 249) { + if constexpr (_num_fields < 245) { + if constexpr (_num_fields < 243) { + if constexpr (_num_fields < 242) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 241, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231, f232, f233, f234, f235, + f236, f237, f238, f239, f240, f241); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 242, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231, f232, f233, f234, f235, + f236, f237, f238, f239, f240, f241, f242); + } + } else { + if constexpr (_num_fields < 244) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 243, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231, f232, f233, f234, f235, + f236, f237, f238, f239, f240, f241, f242, f243); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 244, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231, f232, f233, f234, f235, + f236, f237, f238, f239, f240, f241, f242, f243, f244); + } + } + } else { + if constexpr (_num_fields < 247) { + if constexpr (_num_fields < 246) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 245, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231, f232, f233, f234, f235, + f236, f237, f238, f239, f240, f241, f242, f243, f244, + f245); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 246, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231, f232, f233, f234, f235, + f236, f237, f238, f239, f240, f241, f242, f243, f244, + f245, f246); + } + } else { + if constexpr (_num_fields < 248) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 247, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231, f232, f233, f234, f235, + f236, f237, f238, f239, f240, f241, f242, f243, f244, + f245, f246, f247); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 248, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231, f232, f233, f234, f235, + f236, f237, f238, f239, f240, f241, f242, f243, f244, + f245, f246, f247, f248); + } + } + } + } else { + if constexpr (_num_fields < 253) { + if constexpr (_num_fields < 251) { + if constexpr (_num_fields < 250) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 249, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231, f232, f233, f234, f235, + f236, f237, f238, f239, f240, f241, f242, f243, f244, + f245, f246, f247, f248, f249); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 250, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231, f232, f233, f234, f235, + f236, f237, f238, f239, f240, f241, f242, f243, f244, + f245, f246, f247, f248, f249, f250); + } + } else { + if constexpr (_num_fields < 252) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 251, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231, f232, f233, f234, f235, + f236, f237, f238, f239, f240, f241, f242, f243, f244, + f245, f246, f247, f248, f249, f250, f251); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 252, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231, f232, f233, f234, f235, + f236, f237, f238, f239, f240, f241, f242, f243, f244, + f245, f246, f247, f248, f249, f250, f251, f252); + } + } + } else { + if constexpr (_num_fields < 255) { + if constexpr (_num_fields < 254) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 253, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231, f232, f233, f234, f235, + f236, f237, f238, f239, f240, f241, f242, f243, f244, + f245, f246, f247, f248, f249, f250, f251, f252, f253); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 254, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231, f232, f233, f234, f235, + f236, f237, f238, f239, f240, f241, f242, f243, f244, + f245, f246, f247, f248, f249, f250, f251, f252, f253, + f254); + } + } else { + if constexpr (_num_fields < 256) { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 255, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231, f232, f233, f234, f235, + f236, f237, f238, f239, f240, f241, f242, f243, f244, + f245, f246, f247, f248, f249, f250, f251, f252, f253, + f254, f255); + } else { + RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 256, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, + f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, + f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, + f57, f58, f59, f60, f61, f62, f63, f64, f65, f66, f67, + f68, f69, f70, f71, f72, f73, f74, f75, f76, f77, f78, + f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, + f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, + f101, f102, f103, f104, f105, f106, f107, f108, f109, + f110, f111, f112, f113, f114, f115, f116, f117, f118, + f119, f120, f121, f122, f123, f124, f125, f126, f127, + f128, f129, f130, f131, f132, f133, f134, f135, f136, + f137, f138, f139, f140, f141, f142, f143, f144, f145, + f146, f147, f148, f149, f150, f151, f152, f153, f154, + f155, f156, f157, f158, f159, f160, f161, f162, f163, + f164, f165, f166, f167, f168, f169, f170, f171, f172, + f173, f174, f175, f176, f177, f178, f179, f180, f181, + f182, f183, f184, f185, f186, f187, f188, f189, f190, + f191, f192, f193, f194, f195, f196, f197, f198, f199, + f200, f201, f202, f203, f204, f205, f206, f207, f208, + f209, f210, f211, f212, f213, f214, f215, f216, f217, + f218, f219, f220, f221, f222, f223, f224, f225, f226, + f227, f228, f229, f230, f231, f232, f233, f234, f235, + f236, f237, f238, f239, f240, f241, f242, f243, f244, + f245, f246, f247, f248, f249, f250, f251, f252, f253, + f254, f255, f256); + } + } + } + } + } + } + } + } + } +} + +// End of boilerplate code + +#undef RFL_INTERNAL_TUPLE_VIEW_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS + +template +auto bind_to_tuple(T& _t) { + return bind_to_tuple_impl>(_t); +} + +template +auto bind_to_tuple(T& _t, const F& _f) { + auto view = bind_to_tuple(_t); + return [&](std::index_sequence<_is...>) { + return rfl::make_tuple(_f(rfl::get<_is>(view))...); + }(std::make_index_sequence>()); +} + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/copy_flattened_tuple_to_named_tuple.hpp b/build-config/reflect-cpp/include/rfl/internal/copy_flattened_tuple_to_named_tuple.hpp new file mode 100644 index 0000000..543f1e1 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/copy_flattened_tuple_to_named_tuple.hpp @@ -0,0 +1,36 @@ +#ifndef RFL_INTERNAL_COPY_FLATTENED_TUPLE_TO_NAMED_TUPLE_HPP_ +#define RFL_INTERNAL_COPY_FLATTENED_TUPLE_TO_NAMED_TUPLE_HPP_ + +#include +#include + +#include "../Field.hpp" +#include "../make_named_tuple.hpp" +#include "lit_name.hpp" + +namespace rfl { +namespace internal { + +template +auto copy_one_element(const auto& _flattened_tuple) { + const auto name_literal = FieldNames::template name_of<_i>(); + return rfl::make_field< + lit_name_v>>( + std::get<_i>(_flattened_tuple)); +} + +template +auto copy_flattened_tuple_to_named_tuple(const auto& _flattened_tuple) { + constexpr auto size = + rfl::tuple_size_v>; + return [&](std::integer_sequence) { + return make_named_tuple( + copy_one_element(_flattened_tuple)...); + } + (std::make_integer_sequence()); +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/copy_from_named_tuple.hpp b/build-config/reflect-cpp/include/rfl/internal/copy_from_named_tuple.hpp new file mode 100644 index 0000000..b9b9ba4 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/copy_from_named_tuple.hpp @@ -0,0 +1,20 @@ +#ifndef RFL_INTERNAL_COPY_FROM_NAMED_TUPLE_HPP_ +#define RFL_INTERNAL_COPY_FROM_NAMED_TUPLE_HPP_ + +#include "move_from_named_tuple.hpp" + +namespace rfl { +namespace internal { + +/// Creates a struct of type T from a named tuple. +/// All fields of the struct must be an rfl::Field. +template +T copy_from_named_tuple(const NamedTupleType& _n) { + auto n = _n; + return move_from_named_tuple(std::move(n)); +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/copy_from_tuple.hpp b/build-config/reflect-cpp/include/rfl/internal/copy_from_tuple.hpp new file mode 100644 index 0000000..d639dd3 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/copy_from_tuple.hpp @@ -0,0 +1,20 @@ +#ifndef RFL_COPY_FROM_TUPLE_HPP_ +#define RFL_COPY_FROM_TUPLE_HPP_ + +#include "move_from_tuple.hpp" + +namespace rfl { +namespace internal { + +/// Creates a struct of type T from a tuple by copying the underlying +/// fields. +template +T copy_from_tuple(const TupleType& _t) { + auto t = _t; + return move_from_tuple(std::move(t)); +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/copy_to_field_tuple.hpp b/build-config/reflect-cpp/include/rfl/internal/copy_to_field_tuple.hpp new file mode 100644 index 0000000..3e8ae3d --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/copy_to_field_tuple.hpp @@ -0,0 +1,18 @@ +#ifndef RFL_INTERNAL_COPY_TO_FIELD_TUPLE_HPP_ +#define RFL_INTERNAL_COPY_TO_FIELD_TUPLE_HPP_ + +#include "move_to_field_tuple.hpp" + +namespace rfl { +namespace internal { + +template +auto copy_to_field_tuple(const T& _t) { + auto t = _t; + return move_to_field_tuple(std::move(t)); +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/define_literal.hpp b/build-config/reflect-cpp/include/rfl/internal/define_literal.hpp new file mode 100644 index 0000000..e97eb3c --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/define_literal.hpp @@ -0,0 +1,29 @@ +#ifndef RFL_INTERNAL_DEFINELITERAL_HPP_ +#define RFL_INTERNAL_DEFINELITERAL_HPP_ + +#include "../Literal.hpp" + +namespace rfl { +namespace internal { + +/// Allows you to combine several literals. +template +struct define_literal; + +/// General case +template +struct define_literal, Literal<_content2...>, Tail...> { + using type = typename define_literal, + Tail...>::type; +}; + +/// Special case - only a single literal is left +template +struct define_literal> { + using type = Literal<_content...>; +}; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/define_named_tuple.hpp b/build-config/reflect-cpp/include/rfl/internal/define_named_tuple.hpp new file mode 100644 index 0000000..ba71091 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/define_named_tuple.hpp @@ -0,0 +1,46 @@ +#ifndef RFL_INTERNAL_DEFINENAMEDTUPLE_HPP_ +#define RFL_INTERNAL_DEFINENAMEDTUPLE_HPP_ + +#include "../NamedTuple.hpp" + +namespace rfl { +namespace internal { + +template +struct define_named_tuple; + +/// Allows you to combine several named tuples and/or additional fields. +/// Recursive case - all types are fields. +template +struct define_named_tuple { + using type = typename define_named_tuple, Tail...>::type; +}; + +/// Allows you to combine several named tuples and/or additional fields. +/// Recursive case - first type is NamedTuple, second type is field. +template +struct define_named_tuple, Head, Tail...> { + using type = typename define_named_tuple, + Tail...>::type; +}; + +/// Allows you to combine several named tuples and/or additional fields. +/// Recursive case - first type is NamedTuple, second type is also NamedTuple. +template +struct define_named_tuple, NamedTuple, + Tail...> { + using type = + typename define_named_tuple, + Tail...>::type; +}; + +/// Allows you to combine several named tuples and/or additional fields. +template +struct define_named_tuple> { + using type = NamedTuple; +}; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/define_tagged_union.hpp b/build-config/reflect-cpp/include/rfl/internal/define_tagged_union.hpp new file mode 100644 index 0000000..a780148 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/define_tagged_union.hpp @@ -0,0 +1,57 @@ +#ifndef RFL_INTERNAL_DEFINETAGGEDUNION_HPP_ +#define RFL_INTERNAL_DEFINETAGGEDUNION_HPP_ + +#include "../TaggedUnion.hpp" +#include "StringLiteral.hpp" + +namespace rfl { +namespace internal { + +/// Allows you to combine several tagged unions. +template +struct define_tagged_union; + +/// Recursive case - both tagged union. +template +struct define_tagged_union< + _discriminator, TaggedUnion<_discriminator, NamedTupleTypes1...>, + TaggedUnion<_discriminator, NamedTupleTypes2...>, Tail...> { + using type = typename define_tagged_union< + _discriminator, + TaggedUnion<_discriminator, NamedTupleTypes1..., NamedTupleTypes2...>, + Tail...>::type; +}; + +/// Recursive case - tagged union plus named tuple. +template +struct define_tagged_union<_discriminator, + TaggedUnion<_discriminator, NamedTupleTypes...>, + NamedTuple, Tail...> { + using type = typename define_tagged_union< + _discriminator, + TaggedUnion<_discriminator, NamedTupleTypes..., + NamedTuple>, + Tail...>::type; +}; + +/// Recursive case - named tuple. +template +struct define_tagged_union<_discriminator, NamedTuple, Tail...> { + using type = typename define_tagged_union< + _discriminator, TaggedUnion<_discriminator, NamedTuple>, + Tail...>::type; +}; + +/// Special case - only a single TaggedUnion is left. +template +struct define_tagged_union<_discriminator, + TaggedUnion<_discriminator, NamedTupleTypes...>> { + using type = TaggedUnion<_discriminator, NamedTupleTypes...>; +}; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/define_variant.hpp b/build-config/reflect-cpp/include/rfl/internal/define_variant.hpp new file mode 100644 index 0000000..3c09ebf --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/define_variant.hpp @@ -0,0 +1,42 @@ +#ifndef RFL_INTERNAL_DEFINEVARIANT_HPP_ +#define RFL_INTERNAL_DEFINEVARIANT_HPP_ + +#include + +namespace rfl { +namespace internal { + +/// Allows you to combine several variants. +template +struct define_variant; + +/// Recursive case - both variants. +template +struct define_variant, std::variant, Tail...> { + using type = typename define_variant, + Tail...>::type; +}; + +/// Recursive case - variant plus other type. +template +struct define_variant, Head, Tail...> { + using type = + typename define_variant, Tail...>::type; +}; + +/// Recursive case - other type. +template +struct define_variant { + using type = typename define_variant, Tail...>::type; +}; + +/// Special case - only a single variant is left. +template +struct define_variant> { + using type = std::variant; +}; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/element_index.hpp b/build-config/reflect-cpp/include/rfl/internal/element_index.hpp new file mode 100644 index 0000000..c02b5a2 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/element_index.hpp @@ -0,0 +1,29 @@ +#ifndef RFL_INTERNAL_ELEMENT_INDEX_HPP_ +#define RFL_INTERNAL_ELEMENT_INDEX_HPP_ + +#include + +namespace rfl::internal { + +template +consteval int find_element_index() { + return -1; +} + +template +consteval int find_element_index() { + if constexpr (std::is_same_v) { + return _i; + } else { + return find_element_index<_i + 1, T, Tail...>(); + } +} + +template +consteval int element_index() { + return find_element_index<0, T, AlternativeTypes...>(); +} + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/enums/Names.hpp b/build-config/reflect-cpp/include/rfl/internal/enums/Names.hpp new file mode 100644 index 0000000..a35944a --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/enums/Names.hpp @@ -0,0 +1,69 @@ +#ifndef RFL_INTERNAL_ENUMS_NAMES_HPP_ +#define RFL_INTERNAL_ENUMS_NAMES_HPP_ + +#include +#include +#include +#include + +#include "../../Literal.hpp" +//#include "../../config.hpp" +//#include "../../define_literal.hpp" +#include "../../make_named_tuple.hpp" +//#include "../../thirdparty/enchantum/enchantum.hpp" +#include "../StringLiteral.hpp" + +namespace rfl::internal::enums { + +template +struct Names { + /// Contains a collection of enums as compile-time strings. + using Literal = LiteralType; + + /// The number of possible values + constexpr static size_t size = N; + + /// A list of all the possible enums + constexpr static auto enums_ = std::array{_enums...}; +}; + +template +auto names_to_enumerator_named_tuple( + Names, N, _is_flag, _enums...>) { + return make_named_tuple(Field<_names, EnumType>{_enums}...); +} + +template +auto names_to_underlying_enumerator_named_tuple( + Names, N, _is_flag, _enums...>) { + return make_named_tuple(Field<_names, std::underlying_type_t>{ + static_cast>(_enums)}...); +} + +template +constexpr std::array, N> +names_to_enumerator_array( + Names, N, _is_flag, _enums...>) { + return { + std::make_pair(LiteralHelper<_names>::name_.string_view(), _enums)...}; +} + +template +constexpr std::array< + std::pair>, N> +names_to_underlying_enumerator_array( + Names, N, _is_flag, _enums...>) { + return { + std::make_pair(LiteralHelper<_names>::name_.string_view(), + static_cast>(_enums))...}; +} + +} // namespace rfl::internal::enums + +#endif + diff --git a/build-config/reflect-cpp/include/rfl/internal/enums/get_enum_names.hpp b/build-config/reflect-cpp/include/rfl/internal/enums/get_enum_names.hpp new file mode 100644 index 0000000..b81a715 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/enums/get_enum_names.hpp @@ -0,0 +1,129 @@ +#ifndef RFL_INTERNAL_ENUMS_GET_ENUM_NAMES_HPP_ +#define RFL_INTERNAL_ENUMS_GET_ENUM_NAMES_HPP_ + +// Enum values must be greater than or equal to RFL_ENUM_RANGE_MIN. +// By default, RFL_ENUM_RANGE_MIN is set to -256. +// To change the default minimum range for all enum types, redefine the macro +// RFL_ENUM_RANGE_MIN. +#if !defined(RFL_ENUM_RANGE_MIN) +#define RFL_ENUM_RANGE_MIN -256 +#endif + +// Enum values must be less than or equal to RFL_ENUM_RANGE_MAX. +// By default, RFL_ENUM_RANGE_MAX is set to 256. +// To change the default maximum range for all enum types, redefine the macro +// RFL_ENUM_RANGE_MAX. +#if !defined(RFL_ENUM_RANGE_MAX) +#define RFL_ENUM_RANGE_MAX 256 +#endif + +#ifdef ENCHANTUM_MIN_RANGE +#undef ENCHANTUM_MIN_RANGE +#endif +#define ENCHANTUM_MIN_RANGE RFL_ENUM_RANGE_MIN + +#ifdef ENCHANTUM_MAX_RANGE +#undef ENCHANTUM_MAX_RANGE +#endif +#define ENCHANTUM_MAX_RANGE RFL_ENUM_RANGE_MAX + +#include +#include + +#include "../../thirdparty/enchantum/enchantum.hpp"// NOLINT(unused-includes) + +#include "../../Literal.hpp" +#include "Names.hpp" +#include "range_defined.hpp" + +// https://en.cppreference.com/w/cpp/language/static_cast: + +// 8) A value of integer or enumeration type can be converted to any complete +// enumeration type. + +// If the underlying type is not fixed, the behavior is undefined if the value +// of expression is out of range (the range is all values possible for the +// smallest bit-field large enough to hold all enumerators of the target +// enumeration). If the underlying type is fixed, the result is the same as +// converting the original value first to the underlying type of the enumeration +// and then to the enumeration type. + +// https://en.cppreference.com/w/cpp/language/enum + +// enum struct|class name { enumerator = constexpr , enumerator = constexpr , +// ... } (1) +// ... +// 1) declares a scoped enumeration type whose underlying type is int (the +// keywords class and struct are exactly equivalent) +// +// --> These rules taken together imply that if you EITHER fix the type OR you +// use a scoped integer, static_cast(some_integer_value) will always be +// defined. + +template + requires requires(E e) { + { e | e } -> std::same_as; + } +constexpr inline bool enchantum::is_bitflag = true; + +// Specialize the enchantum EnumTraits further, so rfl::config::enum_range +// works. +namespace enchantum { + +template + requires rfl::internal::enums::range_defined +struct enum_traits { + static constexpr std::size_t prefix_length = 0; + + static constexpr auto min = rfl::config::enum_range::min; + static constexpr auto max = rfl::config::enum_range::max; +}; + +template + requires rfl::internal::enums::range_defined +struct enum_traits { + static constexpr std::size_t prefix_length = 0; + + static constexpr auto min = rfl::config::enum_range::min; + static constexpr auto max = rfl::config::enum_range::max; +}; + +template + requires SignedEnum && + (!EnumFixedUnderlying) && rfl::internal::enums::range_defined +struct enum_traits { + static constexpr auto min = rfl::config::enum_range::min; + static constexpr auto max = rfl::config::enum_range::max; +}; + +template + requires UnsignedEnum && + (!EnumFixedUnderlying) && rfl::internal::enums::range_defined +struct enum_traits { + static constexpr auto min = rfl::config::enum_range::min; + static constexpr auto max = rfl::config::enum_range::max; +}; + +} // namespace enchantum + +namespace rfl::internal::enums { + +template +consteval auto get_enum_names() { + return [](std::index_sequence) { + constexpr auto& entries = enchantum::entries; + constexpr auto to_str_lit = + [](const char* name, std::index_sequence) { + return StringLiteral{name[Js]...}; + }; + return Names{})...>, + entries.size(), enchantum::is_bitflag, + entries[Is].first...>{}; + }(std::make_index_sequence>{}); +} +} // namespace rfl::internal::enums + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/enums/range_defined.hpp b/build-config/reflect-cpp/include/rfl/internal/enums/range_defined.hpp new file mode 100644 index 0000000..5f87f50 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/enums/range_defined.hpp @@ -0,0 +1,17 @@ +#ifndef RFL_INTERNAL_ENUMS_RANGE_DEFINED_HPP_ +#define RFL_INTERNAL_ENUMS_RANGE_DEFINED_HPP_ + +#include "../../config.hpp" + +namespace rfl::internal::enums { + +template +concept range_defined = requires { + { config::enum_range::min }; + + { config::enum_range::max }; +}; + +} // namespace rfl::internal::enums + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/extract_discriminators.hpp b/build-config/reflect-cpp/include/rfl/internal/extract_discriminators.hpp new file mode 100644 index 0000000..a56c04f --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/extract_discriminators.hpp @@ -0,0 +1,25 @@ +#ifndef RFL_INTERNAL_EXTRACTDISTRIMINATORS_HPP_ +#define RFL_INTERNAL_EXTRACTDISTRIMINATORS_HPP_ + +#include + +#include "../TaggedUnion.hpp" +#include "../define_literal.hpp" +#include "../field_type.hpp" + +namespace rfl { +namespace internal { + +template +struct extract_discriminators; + +template +struct extract_discriminators> { + using type = define_literal_t< + std::remove_cvref_t>...>; +}; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/field_tuple_t.hpp b/build-config/reflect-cpp/include/rfl/internal/field_tuple_t.hpp new file mode 100644 index 0000000..186b12f --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/field_tuple_t.hpp @@ -0,0 +1,18 @@ +#ifndef RFL_INTERNAL_FIELD_TUPLE_T_HPP_ +#define RFL_INTERNAL_FIELD_TUPLE_T_HPP_ + +#include + +#include "copy_to_field_tuple.hpp" + +namespace rfl { +namespace internal { + +template +using field_tuple_t = + typename std::invoke_result), T>::type; + +} +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/field_type.hpp b/build-config/reflect-cpp/include/rfl/internal/field_type.hpp new file mode 100644 index 0000000..6d4f728 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/field_type.hpp @@ -0,0 +1,64 @@ +#ifndef RFL_INTERNAL_FIELD_TYPE_HPP_ +#define RFL_INTERNAL_FIELD_TYPE_HPP_ + +#include +#include + +//#include "../NamedTuple.hpp" +#include "../TaggedUnion.hpp" +#include "../Tuple.hpp" +#include "../named_tuple_t.hpp" +#include "StringLiteral.hpp" +#include "find_index.hpp" + +namespace rfl { +namespace internal { + +template +struct are_same : std::conjunction...> {}; + +/// Finds the type of the field signified by _field_name +template +struct FieldType; + +/// Default option - for named tuples. +template +struct FieldType { + using NamedTupleType = named_tuple_t; + + static constexpr int field_ix_ = + internal::find_index<_field_name, typename NamedTupleType::Fields>(); + + using Type = typename tuple_element_t::Type; +}; + +/// For variants - in this case the FieldType returned by all options must be +/// the same. +template +struct FieldType<_field_name, + std::variant> { + constexpr static bool all_types_match = std::conjunction_v::Type, + typename FieldType<_field_name, OtherAlternativeTypes>::Type>...>; + + static_assert(all_types_match, "All field types must be the same."); + + using Type = typename FieldType<_field_name, FirstAlternativeType>::Type; +}; + +/// For tagged union - just defers to the variant. +template +struct FieldType<_field_name, TaggedUnion<_discriminator_name, VarTypes...>> { + using Type = + typename FieldType<_field_name, + typename TaggedUnion<_discriminator_name, + VarTypes...>::VariantType>::Type; +}; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/find_index.hpp b/build-config/reflect-cpp/include/rfl/internal/find_index.hpp new file mode 100644 index 0000000..f32bc96 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/find_index.hpp @@ -0,0 +1,66 @@ +#ifndef RFL_FIND_INDEX_HPP_ +#define RFL_FIND_INDEX_HPP_ + +#include "../Tuple.hpp" +#include "StringLiteral.hpp" + +namespace rfl { +namespace internal { + +template +struct FieldWrapper { + constexpr static int i_ = _i; +}; + +template +constexpr auto operator|(const FieldWrapper& _f1, + const FieldWrapper& _f2) { + if constexpr (F1::name_ == _field_name) { + return _f1; + } else { + return _f2; + } +} + +template +constexpr auto find_matching_field(const Head& _head, const Tail&... _tail) { + return (_head | ... | _tail); +}; + +template +constexpr auto wrap_fields(std::integer_sequence) { + return find_matching_field(FieldWrapper, + _field_name, _is>{}...) + .i_; +} + +/// Finds the index of the field signified by _field_name +template +constexpr static int find_index() { + constexpr int ix = wrap_fields<_field_name, Fields>( + std::make_integer_sequence>()); + static_assert(rfl::tuple_element_t::name_ == _field_name, + "No matching field found."); + return ix; +} + +/// Finds the index of the field signified by _field_name or -1. +template +constexpr static int find_index_or_minus_one() { + if constexpr (rfl::tuple_size_v == 0) { + return -1; + } else { + constexpr int ix = wrap_fields<_field_name, Fields>( + std::make_integer_sequence>()); + if constexpr (rfl::tuple_element_t::name_ == _field_name) { + return ix; + } else { + return -1; + } + } +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/flattened_ptr_tuple_t.hpp b/build-config/reflect-cpp/include/rfl/internal/flattened_ptr_tuple_t.hpp new file mode 100644 index 0000000..9c8a3f3 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/flattened_ptr_tuple_t.hpp @@ -0,0 +1,18 @@ +#ifndef RFL_INTERNAL_FLATTENED_PTR_TUPLE_T_HPP_ +#define RFL_INTERNAL_FLATTENED_PTR_TUPLE_T_HPP_ + +#include + +#include "to_flattened_ptr_tuple.hpp" + +namespace rfl { +namespace internal { + +template +using flattened_ptr_tuple_t = + typename std::invoke_result), T>::type; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/flattened_tuple_t.hpp b/build-config/reflect-cpp/include/rfl/internal/flattened_tuple_t.hpp new file mode 100644 index 0000000..0577102 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/flattened_tuple_t.hpp @@ -0,0 +1,18 @@ +#ifndef RFL_INTERNAL_FLATTENED_TUPLE_T_HPP_ +#define RFL_INTERNAL_FLATTENED_TUPLE_T_HPP_ + +#include "flattened_ptr_tuple_t.hpp" +#include "remove_ptrs_tup.hpp" +//#include "../to_named_tuple.hpp" + +namespace rfl { +namespace internal { + +template +using flattened_tuple_t = + typename remove_ptrs_tup>::TupleType; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/get_fake_object.hpp b/build-config/reflect-cpp/include/rfl/internal/get_fake_object.hpp new file mode 100644 index 0000000..27f7fc5 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/get_fake_object.hpp @@ -0,0 +1,46 @@ +#ifndef RFL_INTERNAL_GETFAKEOBJECT_HPP_ +#define RFL_INTERNAL_GETFAKEOBJECT_HPP_ + +namespace rfl { +namespace internal { + +#if __GNUC__ +#ifndef __clang__ +#pragma GCC system_header +#endif +#endif + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wundefined-var-template" +#pragma clang diagnostic ignored "-Wundefined-internal" +#endif + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 7631) +#endif + +template +struct wrapper { + const T value; + static const wrapper report_if_you_see_a_link_error_with_this_object; +}; + +template +consteval const T& get_fake_object() noexcept { + return wrapper::report_if_you_see_a_link_error_with_this_object.value; +} + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/get_field_names.hpp b/build-config/reflect-cpp/include/rfl/internal/get_field_names.hpp new file mode 100644 index 0000000..683d5c7 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/get_field_names.hpp @@ -0,0 +1,170 @@ +#ifndef RFL_INTERNAL_GETFIELDNAMES_HPP_ +#define RFL_INTERNAL_GETFIELDNAMES_HPP_ + +#include +#include + +#if __has_include() +#include +#endif + +#include "../Literal.hpp" +#include "get_ith_field_from_fake_object.hpp" +#include "is_flatten_field.hpp" +#include "is_rename.hpp" +#include "num_fields.hpp" + +#if __GNUC__ +#ifndef __clang__ +#pragma GCC system_header +#endif +#endif + +namespace rfl::internal { + +template +struct Wrapper { + using Type = T; + T v; +}; + +template +Wrapper(T) -> Wrapper; + +// This workaround is necessary for clang. +template +constexpr auto wrap(const T& arg) noexcept { + return Wrapper{arg}; +} + +template +consteval auto get_field_name_str_view() { +#if __cpp_lib_source_location >= 201907L + const auto func_name = + std::string_view{std::source_location::current().function_name()}; +#elif defined(_MSC_VER) + // Officially, we only support MSVC versions that are modern enough to contain + // , but inofficially, this might work. + const auto func_name = std::string_view{__FUNCSIG__}; +#else + const auto func_name = std::string_view{__PRETTY_FUNCTION__}; +#endif +#if defined(__clang__) + const auto split = func_name.substr(0, func_name.size() - 2); + return split.substr(split.find_last_of(":.") + 1); +#elif defined(__GNUC__) + const auto split = func_name.substr(0, func_name.size() - 2); + return split.substr(split.find_last_of(":") + 1); +#elif defined(_MSC_VER) + const auto split = func_name.substr(0, func_name.size() - 7); + return split.substr(split.rfind("->") + 2); +#else + static_assert(false, + "You are using an unsupported compiler. Please use GCC, Clang " + "or MSVC or switch to the rfl::Field-syntax."); +#endif +} + +template +consteval auto get_field_name_str_lit() { + constexpr auto name = get_field_name_str_view(); + const auto to_str_lit = [&](std::index_sequence) { + return StringLiteral{name[Ns]...}; + }; + return to_str_lit(std::make_index_sequence{}); +} + +template +auto get_field_names(); + +template +auto get_field_name() { +#if defined(__clang__) + using Type = std::remove_cvref_t::Type>>; +#else + using Type = std::remove_cvref_t>; +#endif + if constexpr (is_rename_v) { + using Name = typename Type::Name; + return Name(); + } else if constexpr (is_flatten_field_v) { + return get_field_names>(); + } else { + return rfl::Literal()>(); + } +} + +// We don't want the operator+ to apply to normal literals, +// so we introduce this wrapper. +template +struct LiteralWrapper { + Literal<_names...> literal_; +}; + +template +auto wrap_literal(const Literal<_names...>& _literal) { + return LiteralWrapper<_names...>{_literal}; +} + +template +auto operator+(const LiteralWrapper<_names1...>&, + const LiteralWrapper<_names2...>&) { + return LiteralWrapper<_names1..., _names2...>{ + rfl::Literal<_names1..., _names2...>::template from_value<0>()}; +} + +template +auto concat_literals(const Head& _head, const Tail&... _tail) { + return (wrap_literal(_head) + ... + wrap_literal(_tail)).literal_; +} + +// Special case - the struct does not contain rfl::Flatten. +template +auto concat_literals(const rfl::Literal<_head>&, + const rfl::Literal<_tail>&...) { + return rfl::Literal<_head, _tail...>::template from_value<0>(); +} + +inline auto concat_literals() { return rfl::Literal<>(); } + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wundefined-var-template" +#pragma clang diagnostic ignored "-Wundefined-inline" +#endif + +template +#if __GNUC__ +#ifndef __clang__ +[[gnu::no_sanitize_undefined]] +#endif +#endif +auto get_field_names() { + using Type = std::remove_cvref_t; + if constexpr (std::is_pointer_v) { + return get_field_names>(); + } else { +#if defined(__clang__) + const auto get = [](std::index_sequence<_is...>) { + return concat_literals( + get_field_name())>()...); + }; +#else + const auto get = [](std::index_sequence<_is...>) { + return concat_literals( + get_field_name()>()...); + }; +#endif + return get(std::make_index_sequence>()); + } +} + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/get_ith_field_from_fake_object.hpp b/build-config/reflect-cpp/include/rfl/internal/get_ith_field_from_fake_object.hpp new file mode 100644 index 0000000..6707ae1 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/get_ith_field_from_fake_object.hpp @@ -0,0 +1,2825 @@ +#ifndef RFL_INTERNAL_GET_ITH_FIELD_FROM_FAKE_OBJECT_HPP_ +#define RFL_INTERNAL_GET_ITH_FIELD_FROM_FAKE_OBJECT_HPP_ + +#include +#include + +#include "../always_false.hpp" +#include "get_fake_object.hpp" +#include "nth_element.hpp" +#include "num_fields.hpp" + +namespace rfl::internal { + +template +struct fake_object_helper { + template + static consteval auto get_field() { + static_assert( + rfl::always_false_v, + "\n\nThis error occurs for one of two reasons:\n\n" + "1) You have created a struct with more than 256 fields, which is " + "unsupported. Please split up your struct into several " + "smaller structs and then use rfl::Flatten<...> to combine them. " + "Refer " + "to the documentation on rfl::Flatten<...> for details.\n\n" + "2) You have added a custom constructor to your struct, which you " + "shouldn't do either. Please refer to the sections on custom " + "classes or custom parsers in the documentation " + "for solutions to this problem.\n\n"); + } +}; + +#define RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( \ + n, ...) \ + template \ + struct fake_object_helper { \ + template \ + static consteval auto get_field() { \ + const auto& [__VA_ARGS__] = get_fake_object>(); \ + const auto get_ptrs = [](const auto&... _refs) { \ + return nth_element<_i>(&_refs...); \ + }; \ + return get_ptrs(__VA_ARGS__); \ + } \ + } + +/*The following boilerplate code was generated using a Python script: +macro = +"RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS" +with open("generated_code4.cpp", "w", encoding="utf-8") as codefile: + codefile.write( + "\n".join( + [ + f"{macro}({i}, {', '.join([f'f{j}' for j in range(i)])});" + for i in range(1, 101) + ] + ) + ) +*/ + +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 1, f0); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 2, f0, f1); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 3, f0, f1, f2); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 4, f0, f1, f2, f3); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 5, f0, f1, f2, f3, f4); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 6, f0, f1, f2, f3, f4, f5); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 7, f0, f1, f2, f3, f4, f5, f6); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 8, f0, f1, f2, f3, f4, f5, f6, f7); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 9, f0, f1, f2, f3, f4, f5, f6, f7, f8); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 10, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 11, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 12, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 13, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 14, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 15, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 16, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 17, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 18, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 19, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 20, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 21, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 22, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 23, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 24, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 25, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 26, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 27, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 28, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 29, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 30, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 31, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 32, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 33, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 34, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 35, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 36, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 37, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 38, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 39, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 40, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 41, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 42, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 43, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 44, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 45, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 46, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 47, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 48, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 49, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 50, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 51, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 52, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 53, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 54, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 55, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 56, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 57, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 58, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 59, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 60, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 61, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 62, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 63, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 64, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 65, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 66, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 67, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 68, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 69, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 70, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 71, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 72, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 73, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 74, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 75, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 76, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 77, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 78, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 79, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 80, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 81, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 82, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 83, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 84, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 85, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 86, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 87, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 88, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 89, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 90, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 91, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 92, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 93, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 94, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 95, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 96, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 97, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 98, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 99, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 100, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 101, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 102, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 103, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 104, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 105, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 106, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 107, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 108, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 109, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 110, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 111, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 112, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 113, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 114, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 115, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 116, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 117, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 118, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 119, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 120, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 121, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 122, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 123, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 124, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 125, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 126, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 127, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 128, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 129, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 130, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 131, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 132, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 133, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 134, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 135, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 136, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 137, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 138, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 139, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 140, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 141, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 142, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 143, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 144, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 145, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 146, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 147, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 148, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 149, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 150, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 151, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 152, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 153, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 154, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 155, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 156, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 157, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 158, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 159, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 160, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 161, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 162, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 163, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 164, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 165, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 166, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 167, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 168, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 169, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 170, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 171, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 172, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 173, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 174, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 175, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 176, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 177, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 178, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 179, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 180, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 181, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 182, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 183, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 184, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 185, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 186, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 187, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 188, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 189, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 190, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 191, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 192, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 193, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 194, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 195, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 196, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 197, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 198, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 199, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 200, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 201, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 202, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 203, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 204, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 205, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 206, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 207, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 208, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 209, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 210, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 211, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 212, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 213, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 214, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 215, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 216, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 217, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 218, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 219, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 220, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 221, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 222, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 223, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 224, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 225, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 226, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 227, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 228, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 229, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 230, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 231, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 232, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230, f231); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 233, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230, f231, f232); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 234, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230, f231, f232, f233); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 235, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230, f231, f232, f233, f234); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 236, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230, f231, f232, f233, f234, f235); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 237, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230, f231, f232, f233, f234, f235, f236); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 238, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230, f231, f232, f233, f234, f235, f236, + f237); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 239, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230, f231, f232, f233, f234, f235, f236, + f237, f238); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 240, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230, f231, f232, f233, f234, f235, f236, + f237, f238, f239); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 241, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230, f231, f232, f233, f234, f235, f236, + f237, f238, f239, f240); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 242, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230, f231, f232, f233, f234, f235, f236, + f237, f238, f239, f240, f241); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 243, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230, f231, f232, f233, f234, f235, f236, + f237, f238, f239, f240, f241, f242); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 244, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230, f231, f232, f233, f234, f235, f236, + f237, f238, f239, f240, f241, f242, f243); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 245, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230, f231, f232, f233, f234, f235, f236, + f237, f238, f239, f240, f241, f242, f243, f244); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 246, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230, f231, f232, f233, f234, f235, f236, + f237, f238, f239, f240, f241, f242, f243, f244, f245); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 247, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230, f231, f232, f233, f234, f235, f236, + f237, f238, f239, f240, f241, f242, f243, f244, f245, f246); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 248, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230, f231, f232, f233, f234, f235, f236, + f237, f238, f239, f240, f241, f242, f243, f244, f245, f246, f247); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 249, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230, f231, f232, f233, f234, f235, f236, + f237, f238, f239, f240, f241, f242, f243, f244, f245, f246, f247, f248); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 250, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230, f231, f232, f233, f234, f235, f236, + f237, f238, f239, f240, f241, f242, f243, f244, f245, f246, f247, f248, + f249); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 251, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230, f231, f232, f233, f234, f235, f236, + f237, f238, f239, f240, f241, f242, f243, f244, f245, f246, f247, f248, + f249, f250); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 252, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230, f231, f232, f233, f234, f235, f236, + f237, f238, f239, f240, f241, f242, f243, f244, f245, f246, f247, f248, + f249, f250, f251); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 253, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230, f231, f232, f233, f234, f235, f236, + f237, f238, f239, f240, f241, f242, f243, f244, f245, f246, f247, f248, + f249, f250, f251, f252); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 254, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230, f231, f232, f233, f234, f235, f236, + f237, f238, f239, f240, f241, f242, f243, f244, f245, f246, f247, f248, + f249, f250, f251, f252, f253); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 255, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230, f231, f232, f233, f234, f235, f236, + f237, f238, f239, f240, f241, f242, f243, f244, f245, f246, f247, f248, + f249, f250, f251, f252, f253, f254); +RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS( + 256, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, + f46, f47, f48, f49, f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, f60, + f61, f62, f63, f64, f65, f66, f67, f68, f69, f70, f71, f72, f73, f74, f75, + f76, f77, f78, f79, f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, f90, + f91, f92, f93, f94, f95, f96, f97, f98, f99, f100, f101, f102, f103, f104, + f105, f106, f107, f108, f109, f110, f111, f112, f113, f114, f115, f116, + f117, f118, f119, f120, f121, f122, f123, f124, f125, f126, f127, f128, + f129, f130, f131, f132, f133, f134, f135, f136, f137, f138, f139, f140, + f141, f142, f143, f144, f145, f146, f147, f148, f149, f150, f151, f152, + f153, f154, f155, f156, f157, f158, f159, f160, f161, f162, f163, f164, + f165, f166, f167, f168, f169, f170, f171, f172, f173, f174, f175, f176, + f177, f178, f179, f180, f181, f182, f183, f184, f185, f186, f187, f188, + f189, f190, f191, f192, f193, f194, f195, f196, f197, f198, f199, f200, + f201, f202, f203, f204, f205, f206, f207, f208, f209, f210, f211, f212, + f213, f214, f215, f216, f217, f218, f219, f220, f221, f222, f223, f224, + f225, f226, f227, f228, f229, f230, f231, f232, f233, f234, f235, f236, + f237, f238, f239, f240, f241, f242, f243, f244, f245, f246, f247, f248, + f249, f250, f251, f252, f253, f254, f255); + +#undef RFL_INTERNAL_FAKE_OBJECT_IF_YOU_SEE_AN_ERROR_REFER_TO_DOCUMENTATION_ON_C_ARRAYS + +template +consteval auto get_ith_field_from_fake_object() { + return fake_object_helper>::template get_field<_i>(); +} + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/get_meta_fields.hpp b/build-config/reflect-cpp/include/rfl/internal/get_meta_fields.hpp new file mode 100644 index 0000000..6468210 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/get_meta_fields.hpp @@ -0,0 +1,32 @@ +#ifndef RFL_INTERNAL_GETMETAFIELDS_HPP_ +#define RFL_INTERNAL_GETMETAFIELDS_HPP_ + +#include +#include + +#include "../MetaField.hpp" +#include "../Tuple.hpp" +#include "../type_name_t.hpp" + +namespace rfl { +namespace internal { + +template +auto get_meta_fields(AlreadyExtracted&&... _already_extracted) { + constexpr size_t i = sizeof...(_already_extracted); + if constexpr (NamedTupleType::size() == i) { + return std::array{std::move(_already_extracted)...}; + } else { + using FieldType = tuple_element_t; + auto name = typename FieldType::Name().str(); + auto type = type_name_t().str(); + return get_meta_fields( + std::move(_already_extracted)..., + MetaField(std::move(name), std::move(type))); + } +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/get_type_name.hpp b/build-config/reflect-cpp/include/rfl/internal/get_type_name.hpp new file mode 100644 index 0000000..38ab1c4 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/get_type_name.hpp @@ -0,0 +1,63 @@ +#ifndef RFL_INTERNAL_GETTYPENAME_HPP_ +#define RFL_INTERNAL_GETTYPENAME_HPP_ + +#include + +#include "StringLiteral.hpp" + +#if __has_include() +#include +#endif + +namespace rfl { +namespace internal { + +template +consteval auto get_type_name_str_view() { +#if __cpp_lib_source_location >= 201907L + const auto func_name = + std::string_view{std::source_location::current().function_name()}; +#elif defined(_MSC_VER) + // Officially, we only support MSVC versions that are modern enough to contain + // , but inofficially, this might work. + const auto func_name = std::string_view{__FUNCSIG__}; +#else + const auto func_name = std::string_view{__PRETTY_FUNCTION__}; +#endif +#if defined(__clang__) + const auto split = func_name.substr(0, func_name.size() - 1); + return split.substr(split.find("T = ") + 4); +#elif defined(__GNUC__) + const auto split = func_name.substr(0, func_name.size() - 1); + return split.substr(split.find("T = ") + 4); +#elif defined(_MSC_VER) + auto split = func_name.substr(0, func_name.size() - 7); + split = split.substr(split.find("get_type_name_str_view<") + 23); + auto pos = split.find(" "); + if (pos != std::string_view::npos) { + return split.substr(pos + 1); + } + return split; +#else + static_assert( + false, + "You are using an unsupported compiler. Please use GCC, Clang " + "or MSVC or explicitly tag your structs using 'Tag' or 'Name'."); +#endif +} + +template +consteval auto get_type_name() { + static_assert(get_type_name_str_view() == "int", + "Expected 'int', got something else."); + constexpr auto name = get_type_name_str_view(); + const auto to_str_lit = [&](std::index_sequence) { + return StringLiteral{name[Ns]...}; + }; + return to_str_lit(std::make_index_sequence{}); +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/has_custom_parser.hpp b/build-config/reflect-cpp/include/rfl/internal/has_custom_parser.hpp new file mode 100644 index 0000000..40b5720 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/has_custom_parser.hpp @@ -0,0 +1,23 @@ +#ifndef RFL_INTERNAL_HASCUSTOMPARSER_HPP_ +#define RFL_INTERNAL_HASCUSTOMPARSER_HPP_ + +#include + +#include "../parsing/Parser.hpp" + +namespace rfl::internal { + +template +concept has_custom_parser = requires( + const T& _t, const typename parsing::Parser< + R, W, T, ProcessorsType>::CustomParserHelperStruct& _h) { + { + std::remove_cvref_t::from_class(_t) + } -> std::same_as>; + + { _h.to_class() } -> std::same_as; +}; + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/has_default_val_v.hpp b/build-config/reflect-cpp/include/rfl/internal/has_default_val_v.hpp new file mode 100644 index 0000000..6920ae7 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/has_default_val_v.hpp @@ -0,0 +1,27 @@ +#ifndef RFL_HASDEFAULTVALV_HPP_ +#define RFL_HASDEFAULTVALV_HPP_ +#include + +#include "../NamedTuple.hpp" +#include "../named_tuple_t.hpp" +#include "is_default_val_v.hpp" + +namespace rfl::internal { + +template +struct HasDefaultVal; + +template +struct HasDefaultVal> { + static constexpr bool value = + (false || ... || + is_default_val_v< + std::remove_cvref_t>>); +}; + +template +constexpr bool has_default_val_v = HasDefaultVal>::value; + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/has_fields.hpp b/build-config/reflect-cpp/include/rfl/internal/has_fields.hpp new file mode 100644 index 0000000..412b87b --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/has_fields.hpp @@ -0,0 +1,80 @@ +#ifndef RFL_INTERNAL_HASFIELDS_HPP_ +#define RFL_INTERNAL_HASFIELDS_HPP_ + +#include +#include + +#include "../Tuple.hpp" +//#include "all_fields.hpp" +#include "is_field.hpp" +#include "is_flatten_field.hpp" +#include "ptr_tuple_t.hpp" +#include "is_named_tuple.hpp" + + +namespace rfl { +namespace internal { + +template +constexpr bool all_fields_or_flatten() { + const auto is_true_for_one = + [](std::integral_constant) -> bool { + using T = std::remove_cvref_t>; + if constexpr (is_flatten_field_v) { + return all_fields_or_flatten< + ptr_tuple_t::Type>>(); + } else { + return is_field_v; + } + }; + + return [&](std::integer_sequence) { + return (true && ... && is_true_for_one(std::integral_constant{})); + } + (std::make_integer_sequence>()); +} + +template +constexpr bool some_fields_or_flatten() { + const auto is_true_for_one = + [](std::integral_constant) -> bool { + using T = std::remove_cvref_t>; + if constexpr (is_flatten_field_v) { + return some_fields_or_flatten< + ptr_tuple_t::Type>>(); + } else { + return is_field_v; + } + }; + + return [&](std::integer_sequence) { + return (false || ... || + is_true_for_one(std::integral_constant{})); + } + (std::make_integer_sequence>()); +} + +template +constexpr bool has_fields() { + if constexpr (is_named_tuple_v) { + return true; + } else { + using TupleType = ptr_tuple_t; + if constexpr (some_fields_or_flatten()) { + static_assert( + all_fields_or_flatten(), + "If some of your fields are annotated using rfl::Field<...>, " + "then you must annotate all of your fields. " + "Also, you cannot combine annotated and " + "unannotated fields using rfl::Flatten<...>."); + return true; + } else { + return false; + } + } +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/has_flatten_fields.hpp b/build-config/reflect-cpp/include/rfl/internal/has_flatten_fields.hpp new file mode 100644 index 0000000..42209e7 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/has_flatten_fields.hpp @@ -0,0 +1,31 @@ +#ifndef RFL_INTERNAL_HASFLATTENFIELDS_HPP_ +#define RFL_INTERNAL_HASFLATTENFIELDS_HPP_ + +#include +#include + +#include "../Tuple.hpp" +#include "is_flatten_field.hpp" + +namespace rfl { +namespace internal { + +template +constexpr bool has_flatten_fields() { + const auto is_true_for_one = + [](std::integral_constant) -> bool { + using T = std::remove_cvref_t>; + return is_flatten_field_v; + }; + + return [&](std::integer_sequence) { + return (false || ... || + is_true_for_one(std::integral_constant{})); + } + (std::make_integer_sequence>()); +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/has_reflection_method_v.hpp b/build-config/reflect-cpp/include/rfl/internal/has_reflection_method_v.hpp new file mode 100644 index 0000000..963253b --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/has_reflection_method_v.hpp @@ -0,0 +1,15 @@ +#ifndef RFL_INTERNAL_HASREFLECTIONMETHODV_HPP_ +#define RFL_INTERNAL_HASREFLECTIONMETHODV_HPP_ + +#include + +namespace rfl::internal { + +template +constexpr bool has_reflection_method_v = requires(T t) { + { t.reflection() } -> std::convertible_to; +}; + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/has_reflection_type_v.hpp b/build-config/reflect-cpp/include/rfl/internal/has_reflection_type_v.hpp new file mode 100644 index 0000000..c602013 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/has_reflection_type_v.hpp @@ -0,0 +1,20 @@ +#ifndef RFL_HASREFLECTIONTYPEV_HPP_ +#define RFL_HASREFLECTIONTYPEV_HPP_ + +#include + +namespace rfl::internal { + +template +struct ReflectionTypeWrapper {}; + +template +constexpr bool has_reflection_type_v = requires() { + { + ReflectionTypeWrapper{} + } -> std::same_as>; +}; + +} // namespace rfl::internal + +#endif // RFL_HASNAMEDTUPLETYPEV_HPP_ diff --git a/build-config/reflect-cpp/include/rfl/internal/has_reflector.hpp b/build-config/reflect-cpp/include/rfl/internal/has_reflector.hpp new file mode 100644 index 0000000..cfc1b80 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/has_reflector.hpp @@ -0,0 +1,24 @@ +#ifndef RFL_INTERNAL_HASREFLECTOR_HPP_ +#define RFL_INTERNAL_HASREFLECTOR_HPP_ + +namespace rfl { +template +struct Reflector; + +namespace internal { + +template +concept has_write_reflector = requires(Type&& item) { + Reflector::from(item); +}; + +template +concept has_read_reflector = + requires(const typename Reflector::ReflType& item) { + Reflector::to(item); +}; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/has_tag_v.hpp b/build-config/reflect-cpp/include/rfl/internal/has_tag_v.hpp new file mode 100644 index 0000000..299618f --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/has_tag_v.hpp @@ -0,0 +1,21 @@ +#ifndef RFL_HASTAGV_HPP_ +#define RFL_HASTAGV_HPP_ + +#include + +namespace rfl::internal { + +template +struct TagWrapper {}; + +/// Used for tagged unions - determines whether a struct as a Tag. +template +constexpr bool has_tag_v = requires() { + { + TagWrapper{} + } -> std::same_as>; +}; + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/has_to_class_method_v.hpp b/build-config/reflect-cpp/include/rfl/internal/has_to_class_method_v.hpp new file mode 100644 index 0000000..92857fb --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/has_to_class_method_v.hpp @@ -0,0 +1,28 @@ +#ifndef RFL_INTERNAL_HASTOCLASSMETHODV_HPP_ +#define RFL_INTERNAL_HASTOCLASSMETHODV_HPP_ + +#include + +namespace rfl { +namespace internal { + +template +using to_class_method_t = decltype(std::declval().to_class()); + +template > +struct has_to_class_m : std::false_type {}; + +template +struct has_to_class_m>> + : std::true_type {}; + +/// Utility parameter for named tuple parsing, can be used by the +/// parsers to determine whether a class or struct has a method +/// called "to_class". +template +constexpr bool has_to_class_method_v = has_to_class_m::value; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/is_add_tags_to_variants_v.hpp b/build-config/reflect-cpp/include/rfl/internal/is_add_tags_to_variants_v.hpp new file mode 100644 index 0000000..4385b1d --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/is_add_tags_to_variants_v.hpp @@ -0,0 +1,40 @@ +#ifndef RFL_INTERNAL_ISADDTAGSTOVARIANTS_HPP_ +#define RFL_INTERNAL_ISADDTAGSTOVARIANTS_HPP_ + +#include + +#include "../AddTagsToVariants.hpp" + +namespace rfl ::internal { + +template +class is_add_tags_to_variants; + +template +class is_add_tags_to_variants : public std::false_type {}; + +template <> +class is_add_tags_to_variants : public std::true_type {}; + +template +constexpr bool is_add_tags_to_variants_v = is_add_tags_to_variants< + std::remove_cvref_t>>::value; + +template +class is_add_namespaced_tags_to_variants; + +template +class is_add_namespaced_tags_to_variants : public std::false_type {}; + +template <> +class is_add_namespaced_tags_to_variants + : public std::true_type {}; + +template +constexpr bool is_add_namespaced_tags_to_variants_v = + is_add_namespaced_tags_to_variants< + std::remove_cvref_t>>::value; + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/is_allow_raw_ptrs_v.hpp b/build-config/reflect-cpp/include/rfl/internal/is_allow_raw_ptrs_v.hpp new file mode 100644 index 0000000..3b3e51a --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/is_allow_raw_ptrs_v.hpp @@ -0,0 +1,27 @@ +#ifndef RFL_INTERNAL_ISALLOWRAWPTRS_HPP_ +#define RFL_INTERNAL_ISALLOWRAWPTRS_HPP_ + +#include + +#include "../AllowRawPtrs.hpp" + +namespace rfl { +namespace internal { + +template +class is_allow_raw_ptrs; + +template +class is_allow_raw_ptrs : public std::false_type {}; + +template <> +class is_allow_raw_ptrs : public std::true_type {}; + +template +constexpr bool is_allow_raw_ptrs_v = + is_allow_raw_ptrs>>::value; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/is_array.hpp b/build-config/reflect-cpp/include/rfl/internal/is_array.hpp new file mode 100644 index 0000000..42ff45d --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/is_array.hpp @@ -0,0 +1,25 @@ +#ifndef RFL_INTERNAL_ISARRAY_HPP_ +#define RFL_INTERNAL_ISARRAY_HPP_ + +#include + +#include "Array.hpp" + +namespace rfl::internal { + +template +class is_array; + +template +class is_array : public std::false_type {}; + +template +class is_array> : public std::true_type {}; + +template +constexpr bool is_array_v = + is_array>>::value; + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/is_attribute.hpp b/build-config/reflect-cpp/include/rfl/internal/is_attribute.hpp new file mode 100644 index 0000000..b51d4e4 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/is_attribute.hpp @@ -0,0 +1,28 @@ +#ifndef RFL_INTERNAL_ISATTRIBUTE_HPP_ +#define RFL_INTERNAL_ISATTRIBUTE_HPP_ + +#include + +#include "../Attribute.hpp" +//#include "../Field.hpp" +#include "remove_rename.hpp" + +namespace rfl { +namespace internal { + +template +class is_attribute; + +template +class is_attribute : public std::false_type {}; + +template +class is_attribute> : public std::true_type {}; + +template +constexpr bool is_attribute_v = is_attribute>::value; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/is_basic_type.hpp b/build-config/reflect-cpp/include/rfl/internal/is_basic_type.hpp new file mode 100644 index 0000000..a5b4ad6 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/is_basic_type.hpp @@ -0,0 +1,20 @@ +#ifndef RFL_INTERNAL_ISBASICTYPE_HPP_ +#define RFL_INTERNAL_ISBASICTYPE_HPP_ + +#include +#include + +namespace rfl { +namespace internal { + +template +constexpr bool is_basic_type_v = + std::is_floating_point_v> || + std::is_integral_v> || + std::is_same, std::string>() || + std::is_same, bool>(); + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/is_default_if_missing_v.hpp b/build-config/reflect-cpp/include/rfl/internal/is_default_if_missing_v.hpp new file mode 100644 index 0000000..836ca7e --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/is_default_if_missing_v.hpp @@ -0,0 +1,25 @@ +#ifndef RFL_INTERNAL_ISDEFAULTIFMISSING_HPP_ +#define RFL_INTERNAL_ISDEFAULTIFMISSING_HPP_ + +#include + +#include "../DefaultIfMissing.hpp" + +namespace rfl::internal { + +template +class is_default_if_missing; + +template +class is_default_if_missing : public std::false_type {}; + +template <> +class is_default_if_missing : public std::true_type {}; + +template +constexpr bool is_default_if_missing_v = + is_default_if_missing>>::value; + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/is_default_val_v.hpp b/build-config/reflect-cpp/include/rfl/internal/is_default_val_v.hpp new file mode 100644 index 0000000..9897754 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/is_default_val_v.hpp @@ -0,0 +1,25 @@ +#ifndef RFL_INTERNAL_ISDEFAULTVAL_HPP_ +#define RFL_INTERNAL_ISDEFAULTVAL_HPP_ + +#include + +#include "../DefaultVal.hpp" + +namespace rfl::internal { + +template +class is_default_val; + +template +class is_default_val : public std::false_type {}; + +template +class is_default_val> : public std::true_type {}; + +template +constexpr bool is_default_val_v = + is_default_val>>::value; + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/is_description.hpp b/build-config/reflect-cpp/include/rfl/internal/is_description.hpp new file mode 100644 index 0000000..6349c43 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/is_description.hpp @@ -0,0 +1,28 @@ +#ifndef RFL_INTERNAL_ISDESCRIPTION_HPP_ +#define RFL_INTERNAL_ISDESCRIPTION_HPP_ + +#include + +#include "../Description.hpp" +#include "StringLiteral.hpp" + +namespace rfl { +namespace internal { + +template +class is_description; + +template +class is_description : public std::false_type {}; + +template +class is_description> : public std::true_type {}; + +template +constexpr bool is_description_v = + is_description>>::value; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/is_empty.hpp b/build-config/reflect-cpp/include/rfl/internal/is_empty.hpp new file mode 100644 index 0000000..7434710 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/is_empty.hpp @@ -0,0 +1,25 @@ +#ifndef RFL_INTERNAL_ISEMPTY_HPP_ +#define RFL_INTERNAL_ISEMPTY_HPP_ + +#include + +#include "../Tuple.hpp" +#include "is_named_tuple.hpp" +#include "ptr_tuple_t.hpp" + +namespace rfl::internal { + +template +constexpr bool is_empty() { + using U = std::remove_cvref_t>; + if constexpr (is_named_tuple_v) { + return U::size() == 0; + } else { + using TupleType = ptr_tuple_t; + return rfl::tuple_size_v == 0; + } +} + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/is_extra_fields.hpp b/build-config/reflect-cpp/include/rfl/internal/is_extra_fields.hpp new file mode 100644 index 0000000..9675999 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/is_extra_fields.hpp @@ -0,0 +1,25 @@ +#ifndef RFL_INTERNAL_ISEXTRAFIELDS_HPP_ +#define RFL_INTERNAL_ISEXTRAFIELDS_HPP_ + +#include + +#include "../ExtraFields.hpp" + +namespace rfl::internal { + +template +class is_extra_fields; + +template +class is_extra_fields : public std::false_type {}; + +template +class is_extra_fields> : public std::true_type {}; + +template +constexpr bool is_extra_fields_v = + is_extra_fields>>::value; + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/is_field.hpp b/build-config/reflect-cpp/include/rfl/internal/is_field.hpp new file mode 100644 index 0000000..4a21081 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/is_field.hpp @@ -0,0 +1,28 @@ +#ifndef RFL_INTERNAL_ISFIELD_HPP_ +#define RFL_INTERNAL_ISFIELD_HPP_ + +#include + +#include "../Field.hpp" +#include "StringLiteral.hpp" + +namespace rfl { +namespace internal { + +template +class is_field; + +template +class is_field : public std::false_type {}; + +template +class is_field> : public std::true_type {}; + +template +constexpr bool is_field_v = + is_field>>::value; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/is_flatten_field.hpp b/build-config/reflect-cpp/include/rfl/internal/is_flatten_field.hpp new file mode 100644 index 0000000..bc7619a --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/is_flatten_field.hpp @@ -0,0 +1,27 @@ +#ifndef RFL_INTERNAL_ISFLATTENFIELD_HPP_ +#define RFL_INTERNAL_ISFLATTENFIELD_HPP_ + +#include + +#include "../Flatten.hpp" + +namespace rfl { +namespace internal { + +template +class is_flatten_field; + +template +class is_flatten_field : public std::false_type {}; + +template +class is_flatten_field> : public std::true_type {}; + +template +constexpr bool is_flatten_field_v = + is_flatten_field>>::value; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/is_literal.hpp b/build-config/reflect-cpp/include/rfl/internal/is_literal.hpp new file mode 100644 index 0000000..0eb29ee --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/is_literal.hpp @@ -0,0 +1,28 @@ +#ifndef RFL_INTERNAL_ISLITERAL_HPP_ +#define RFL_INTERNAL_ISLITERAL_HPP_ + +#include + +#include "../Literal.hpp" +#include "StringLiteral.hpp" + +namespace rfl { +namespace internal { + +template +class is_literal; + +template +class is_literal : public std::false_type {}; + +template +class is_literal> : public std::true_type {}; + +template +constexpr bool is_literal_v = + is_literal>>::value; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/is_named_tuple.hpp b/build-config/reflect-cpp/include/rfl/internal/is_named_tuple.hpp new file mode 100644 index 0000000..5ac01c8 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/is_named_tuple.hpp @@ -0,0 +1,27 @@ +#ifndef RFL_INTERNAL_IS_NAMED_TUPLE_HPP_ +#define RFL_INTERNAL_IS_NAMED_TUPLE_HPP_ + +#include + +#include "../NamedTuple.hpp" + +namespace rfl { +namespace internal { + +template +class is_named_tuple; + +template +class is_named_tuple : public std::false_type {}; + +template +class is_named_tuple> : public std::true_type {}; + +template +constexpr bool is_named_tuple_v = + is_named_tuple>>::value; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/is_no_extra_fields_v.hpp b/build-config/reflect-cpp/include/rfl/internal/is_no_extra_fields_v.hpp new file mode 100644 index 0000000..1c62453 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/is_no_extra_fields_v.hpp @@ -0,0 +1,27 @@ +#ifndef RFL_INTERNAL_ISNOEXTRAFIELDS_HPP_ +#define RFL_INTERNAL_ISNOEXTRAFIELDS_HPP_ + +#include + +#include "../NoExtraFields.hpp" + +namespace rfl { +namespace internal { + +template +class is_no_extra_fields; + +template +class is_no_extra_fields : public std::false_type {}; + +template <> +class is_no_extra_fields : public std::true_type {}; + +template +constexpr bool is_no_extra_fields_v = + is_no_extra_fields>>::value; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/is_no_field_names_v.hpp b/build-config/reflect-cpp/include/rfl/internal/is_no_field_names_v.hpp new file mode 100644 index 0000000..9c0cbee --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/is_no_field_names_v.hpp @@ -0,0 +1,25 @@ +#ifndef RFL_INTERNAL_ISNOFIELDNAMES_HPP_ +#define RFL_INTERNAL_ISNOFIELDNAMES_HPP_ + +#include + +#include "../NoFieldNames.hpp" + +namespace rfl::internal { + +template +class is_no_field_names; + +template +class is_no_field_names : public std::false_type {}; + +template <> +class is_no_field_names : public std::true_type {}; + +template +constexpr bool is_no_field_names_v = + is_no_field_names>>::value; + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/is_no_optionals_v.hpp b/build-config/reflect-cpp/include/rfl/internal/is_no_optionals_v.hpp new file mode 100644 index 0000000..e2e2bc1 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/is_no_optionals_v.hpp @@ -0,0 +1,27 @@ +#ifndef RFL_INTERNAL_ISNOOPTIONALS_HPP_ +#define RFL_INTERNAL_ISNOOPTIONALS_HPP_ + +#include + +#include "../NoOptionals.hpp" + +namespace rfl { +namespace internal { + +template +class is_no_optionals; + +template +class is_no_optionals : public std::false_type {}; + +template <> +class is_no_optionals : public std::true_type {}; + +template +constexpr bool is_no_optionals_v = + is_no_optionals>>::value; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/is_pattern.hpp b/build-config/reflect-cpp/include/rfl/internal/is_pattern.hpp new file mode 100644 index 0000000..676d029 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/is_pattern.hpp @@ -0,0 +1,28 @@ +#ifndef RFL_INTERNAL_ISPATTERN_HPP_ +#define RFL_INTERNAL_ISPATTERN_HPP_ + +#include + +#include "../Pattern.hpp" +#include "StringLiteral.hpp" + +namespace rfl { +namespace internal { + +template +class is_pattern; + +template +class is_pattern : public std::false_type {}; + +template +class is_pattern> : public std::true_type {}; + +template +constexpr bool is_pattern_v = + is_pattern>>::value; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/is_rename.hpp b/build-config/reflect-cpp/include/rfl/internal/is_rename.hpp new file mode 100644 index 0000000..45642bf --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/is_rename.hpp @@ -0,0 +1,28 @@ +#ifndef RFL_INTERNAL_ISRENAME_HPP_ +#define RFL_INTERNAL_ISRENAME_HPP_ + +#include + +#include "../Rename.hpp" +#include "StringLiteral.hpp" + +namespace rfl { +namespace internal { + +template +class is_rename; + +template +class is_rename : public std::false_type {}; + +template +class is_rename> : public std::true_type {}; + +template +constexpr bool is_rename_v = + is_rename>>::value; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/is_skip.hpp b/build-config/reflect-cpp/include/rfl/internal/is_skip.hpp new file mode 100644 index 0000000..d3357d0 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/is_skip.hpp @@ -0,0 +1,26 @@ +#ifndef RFL_INTERNAL_ISSKIP_HPP_ +#define RFL_INTERNAL_ISSKIP_HPP_ + +#include + +#include "Skip.hpp" + +namespace rfl::internal { + +template +class is_skip; + +template +class is_skip : public std::false_type {}; + +template +class is_skip> + : public std::true_type {}; + +template +constexpr bool is_skip_v = + is_skip>>::value; + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/is_underlying_enums_v.hpp b/build-config/reflect-cpp/include/rfl/internal/is_underlying_enums_v.hpp new file mode 100644 index 0000000..f0570e9 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/is_underlying_enums_v.hpp @@ -0,0 +1,27 @@ +#ifndef RFL_INTERNAL_ISUNDERLYINGENUMS_HPP_ +#define RFL_INTERNAL_ISUNDERLYINGENUMS_HPP_ + +#include + +#include "../UnderlyingEnums.hpp" + +namespace rfl { +namespace internal { + +template +class is_underlying_enums; + +template +class is_underlying_enums : public std::false_type {}; + +template <> +class is_underlying_enums : public std::true_type {}; + +template +constexpr bool is_underlying_enums_v = + is_underlying_enums>>::value; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/is_validator.hpp b/build-config/reflect-cpp/include/rfl/internal/is_validator.hpp new file mode 100644 index 0000000..e8374f0 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/is_validator.hpp @@ -0,0 +1,28 @@ +#ifndef RFL_INTERNAL_ISVALIDATOR_HPP_ +#define RFL_INTERNAL_ISVALIDATOR_HPP_ + +#include + +#include "../Validator.hpp" +#include "StringLiteral.hpp" + +namespace rfl { +namespace internal { + +template +class is_validator; + +template +class is_validator : public std::false_type {}; + +template +class is_validator> : public std::true_type {}; + +template +constexpr bool is_validator_v = + is_validator>>::value; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/is_variant.hpp b/build-config/reflect-cpp/include/rfl/internal/is_variant.hpp new file mode 100644 index 0000000..f79f1d7 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/is_variant.hpp @@ -0,0 +1,26 @@ +#ifndef RFL_INTERNAL_ISVARIANT_HPP_ +#define RFL_INTERNAL_ISVARIANT_HPP_ + +#include +#include + +namespace rfl { +namespace internal { + +template +class is_variant; + +template +class is_variant : public std::false_type {}; + +template +class is_variant> : public std::true_type {}; + +template +constexpr bool is_variant_v = + is_variant>>::value; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/lit_name.hpp b/build-config/reflect-cpp/include/rfl/internal/lit_name.hpp new file mode 100644 index 0000000..352b8f3 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/lit_name.hpp @@ -0,0 +1,23 @@ +#ifndef RFL_INTERNAL_LIT_NAME_HPP_ +#define RFL_INTERNAL_LIT_NAME_HPP_ + +#include "../Literal.hpp" + +namespace rfl { +namespace internal { + +template +struct lit_name; + +template +struct lit_name> { + constexpr static auto name_ = _name; +}; + +template +constexpr auto lit_name_v = lit_name::name_; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/make_tag.hpp b/build-config/reflect-cpp/include/rfl/internal/make_tag.hpp new file mode 100644 index 0000000..6c5d12d --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/make_tag.hpp @@ -0,0 +1,34 @@ +#ifndef RFL_INTERNAL_MAKE_TAG_HPP_ +#define RFL_INTERNAL_MAKE_TAG_HPP_ + +#include "../Literal.hpp" +#include "../field_names_t.hpp" +#include "../named_tuple_t.hpp" +#include "../to_view.hpp" +#include "StringLiteral.hpp" +#include "get_type_name.hpp" +#include "has_reflection_type_v.hpp" +#include "has_tag_v.hpp" +#include "remove_namespaces.hpp" + +namespace rfl::internal { + +template +static inline auto make_tag(const T& _t) noexcept { + if constexpr (internal::has_reflection_type_v) { + return make_tag<_discriminator>(_t.reflection()); + } else if constexpr (named_tuple_t::Names::template contains< + _discriminator>()) { + return *to_view(_t).template get<_discriminator>(); + } else if constexpr (internal::has_tag_v) { + using LiteralType = typename T::Tag; + return LiteralType::template name_of<0>(); + } else { + return rfl::Literal< + internal::remove_namespaces()>()>(); + } +} + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/move_and_flatten_field_tuple.hpp b/build-config/reflect-cpp/include/rfl/internal/move_and_flatten_field_tuple.hpp new file mode 100644 index 0000000..a943ef8 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/move_and_flatten_field_tuple.hpp @@ -0,0 +1,35 @@ +#ifndef RFL_INTERNAL_MOVE_AND_FLATTEN_FIELD_TUPLE_HPP_ +#define RFL_INTERNAL_MOVE_AND_FLATTEN_FIELD_TUPLE_HPP_ + +#include "../Tuple.hpp" +#include "../tuple_cat.hpp" +#include "is_flatten_field.hpp" +#include "move_to_field_tuple.hpp" + +namespace rfl { +namespace internal { + +template +auto move_and_flatten_field_tuple(FieldTuple&& _t) { + const auto get_one = [&](std::integral_constant) { + using T = tuple_element_t<_i, std::remove_cvref_t>; + if constexpr (is_flatten_field_v) { + return move_and_flatten_field_tuple( + move_to_field_tuple(std::move(rfl::get<_i>(_t).value_))); + } else { + return rfl::make_tuple(std::move(rfl::get<_i>(_t))); + } + }; + + constexpr auto size = rfl::tuple_size_v>; + + return [&](std::integer_sequence) { + return rfl::tuple_cat(get_one(std::integral_constant{})...); + } + (std::make_integer_sequence()); +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/move_field_tuple_to_named_tuple.hpp b/build-config/reflect-cpp/include/rfl/internal/move_field_tuple_to_named_tuple.hpp new file mode 100644 index 0000000..05c035a --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/move_field_tuple_to_named_tuple.hpp @@ -0,0 +1,32 @@ +#ifndef RFL_INTERNAL_MOVE_FIELD_TUPLE_TO_NAMED_TUPLE_HPP_ +#define RFL_INTERNAL_MOVE_FIELD_TUPLE_TO_NAMED_TUPLE_HPP_ + +#include + +#include "../Field.hpp" +#include "../Tuple.hpp" +#include "has_flatten_fields.hpp" +#include "move_and_flatten_field_tuple.hpp" + +namespace rfl { +namespace internal { + +template +auto move_field_tuple_to_named_tuple(FieldTuple&& _field_tuple) { + const auto ft_to_nt = [](Fields&&... _fields) { + return make_named_tuple(std::move(_fields)...); + }; + + if constexpr (!has_flatten_fields>()) { + return rfl::apply(ft_to_nt, std::move(_field_tuple)); + } else { + auto flattened_tuple = + move_and_flatten_field_tuple(std::move(_field_tuple)); + return rfl::apply(ft_to_nt, std::move(flattened_tuple)); + } +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/move_from_named_tuple.hpp b/build-config/reflect-cpp/include/rfl/internal/move_from_named_tuple.hpp new file mode 100644 index 0000000..617bcb1 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/move_from_named_tuple.hpp @@ -0,0 +1,93 @@ +#ifndef RFL_MOVE_FROM_NAMED_TUPLE_HPP_ +#define RFL_MOVE_FROM_NAMED_TUPLE_HPP_ + +#include + +#include "../Tuple.hpp" +#include "../named_tuple_t.hpp" +#include "is_field.hpp" +#include "is_named_tuple.hpp" +#include "nt_to_ptr_named_tuple.hpp" +#include "ptr_field_tuple_t.hpp" + +namespace rfl { +namespace internal { + +template +auto make_ptr_fields(PtrNamedTupleType& _n) { + const auto get_one = [&](std::integral_constant) { + using Field = std::remove_cvref_t>; + using T = std::remove_cvref_t>; + if constexpr (is_named_tuple_v) { + using SubPtrNamedTupleType = + typename std::invoke_result), + T>::type; + return SubPtrNamedTupleType(_n).fields(); + } else if constexpr (is_flatten_field::value) { + using SubPtrFieldTupleType = std::remove_cvref_t>; + return make_ptr_fields(_n); + } else { + return _n.template get_field(); + } + }; + + constexpr auto size = + rfl::tuple_size_v>; + + return [&](std::integer_sequence) { + return rfl::make_tuple(get_one(std::integral_constant{})...); + } + (std::make_integer_sequence()); +} + +template +auto move_from_ptr_fields(Pointers& _ptrs) { + const auto get_one = [&](std::integral_constant) { + using FieldType = tuple_element_t<_i, std::remove_cvref_t>; + if constexpr (is_field_v) { + return rfl::make_field( + std::move(*rfl::get<_i>(_ptrs).value())); + } else { + using PtrFieldTupleType = std::remove_cvref_t>; + using U = std::remove_cvref_t::Type>>; + return move_from_ptr_fields(rfl::get<_i>(_ptrs)); + } + }; + + constexpr auto size = rfl::tuple_size_v>; + + return [&](std::integer_sequence) { + return T{std::move(get_one(std::integral_constant{}))...}; + } + (std::make_integer_sequence()); +} + +/// Creates a struct of type T from a named tuple by moving the underlying +/// fields. +template +T move_from_named_tuple(NamedTupleType&& _n) { + using RequiredType = std::remove_cvref_t>; + + if constexpr (is_named_tuple_v>) { + return std::move(_n); + + } else if constexpr (std::is_same, + RequiredType>()) { + auto ptr_named_tuple = nt_to_ptr_named_tuple(_n); + + using PtrFieldTupleType = std::remove_cvref_t>; + + auto pointers = make_ptr_fields(ptr_named_tuple); + + return move_from_ptr_fields(pointers); + + } else { + return move_from_named_tuple(RequiredType(std::move(_n))); + } +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/move_from_tuple.hpp b/build-config/reflect-cpp/include/rfl/internal/move_from_tuple.hpp new file mode 100644 index 0000000..0905a56 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/move_from_tuple.hpp @@ -0,0 +1,135 @@ +#ifndef RFL_MOVE_FROM_TUPLE_HPP_ +#define RFL_MOVE_FROM_TUPLE_HPP_ + +#include + +#include "../Tuple.hpp" +#include "../tuple_cat.hpp" +#include "Array.hpp" +#include "is_flatten_field.hpp" +#include "is_named_tuple.hpp" +#include "ptr_tuple_t.hpp" +#include "tup_to_ptr_tuple.hpp" +#include "tuple_t.hpp" + +namespace rfl { +namespace internal { + +template +constexpr int calc_flattened_size() { + if constexpr (_i == rfl::tuple_size_v) { + return 0; + } else { + using T = std::remove_pointer_t>; + if constexpr (is_flatten_field_v) { + return calc_flattened_size>() + + calc_flattened_size(); + } else { + return 1 + calc_flattened_size(); + } + } +} + +// TODO: Non-recursive implementation +template +auto unflatten_ptr_tuple(PtrTupleType& _t, Args... _args) { + constexpr auto i = sizeof...(Args); + + constexpr auto size = rfl::tuple_size_v>; + + if constexpr (i == size) { + return rfl::make_tuple(_args...); + } else { + using T = std::remove_cvref_t< + std::remove_pointer_t>>; + + if constexpr (is_flatten_field_v) { + using SubTargetTupleType = + ptr_tuple_t>; + + constexpr int flattened_size = calc_flattened_size(); + + return unflatten_ptr_tuple( + _t, _args..., + unflatten_ptr_tuple(_t)); + + } else { + return unflatten_ptr_tuple( + _t, _args..., std::get<_j>(_t)); + } + } +} + +template +auto move_from_pointers(Pointers& _ptrs, Args&&... _args) { + constexpr auto i = sizeof...(Args); + if constexpr (i == rfl::tuple_size_v>) { + return std::remove_cvref_t{std::move(_args)...}; + } else { + using FieldType = tuple_element_t>; + + if constexpr (std::is_pointer_v) { + return move_from_pointers(_ptrs, std::move(_args)..., + std::move(*std::get(_ptrs))); + + } else { + using PtrTupleType = ptr_tuple_t>; + + using U = std::remove_cvref_t>::Type>; + + return move_from_pointers(_ptrs, std::move(_args)..., + move_from_pointers(std::get(_ptrs))); + } + } +} + +template +auto flatten_array(T* _v) { + return rfl::make_tuple(_v); +} + +template +auto flatten_array(std::array* _arr) { + const auto fct = [](auto&... _v) { + return rfl::tuple_cat(flatten_array(&_v)...); + }; + return std::apply(fct, *_arr); +} + +template +auto make_tuple_from_element(T _v) { + return rfl::make_tuple(_v); +} + +template +auto make_tuple_from_element(Array* _arr) { + return flatten_array(&(_arr->arr_)); +} + +auto flatten_c_arrays(const auto& _tup) { + const auto fct = [](auto... _v) { + return rfl::tuple_cat(make_tuple_from_element(_v)...); + }; + return rfl::apply(fct, _tup); +} + +/// Creates a struct of type T from a tuple by moving the underlying +/// fields. +template +auto move_from_tuple(TupleType&& _t) { + auto ptr_tuple = tup_to_ptr_tuple(_t); + + using TargetTupleType = tuple_t>; + + auto pointers = + flatten_c_arrays(unflatten_ptr_tuple(ptr_tuple)); + + return move_from_pointers(pointers); +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/move_to_field_tuple.hpp b/build-config/reflect-cpp/include/rfl/internal/move_to_field_tuple.hpp new file mode 100644 index 0000000..be647e6 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/move_to_field_tuple.hpp @@ -0,0 +1,45 @@ +#ifndef RFL_INTERNAL_MOVE_TO_FIELD_TUPLE_HPP_ +#define RFL_INTERNAL_MOVE_TO_FIELD_TUPLE_HPP_ + +#include + +#include "../Tuple.hpp" +#include "../field_names_t.hpp" +#include "Array.hpp" +#include "bind_to_tuple.hpp" +#include "has_fields.hpp" +#include "is_empty.hpp" +#include "is_named_tuple.hpp" +#include "wrap_in_fields.hpp" + +namespace rfl { +namespace internal { + +template +auto move_to_field_tuple(OriginalStruct&& _t) { + using T = std::remove_cvref_t; + if constexpr (is_named_tuple_v) { + return _t.fields(); + } else if constexpr (has_fields()) { + return bind_to_tuple(_t, [](auto _ptr) { return std::move(*_ptr); }); + } else if constexpr (is_empty()) { + return rfl::Tuple(); + } else { + using FieldNames = field_names_t; + const auto fct = [](T* _ptr) { + using Type = std::remove_cvref_t; + if constexpr (std::is_array_v) { + return Array(*_ptr); + } else { + return std::move(*_ptr); + } + }; + auto tup = bind_to_tuple(_t, fct); + return wrap_in_fields(std::move(tup)); + } +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/no_duplicate_field_names.hpp b/build-config/reflect-cpp/include/rfl/internal/no_duplicate_field_names.hpp new file mode 100644 index 0000000..4e3f90d --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/no_duplicate_field_names.hpp @@ -0,0 +1,55 @@ +#ifndef RFL_INTERNAL_NO_DUPLICATE_FIELD_NAMES_HPP_ +#define RFL_INTERNAL_NO_DUPLICATE_FIELD_NAMES_HPP_ + +#include "../Tuple.hpp" + +namespace rfl { +namespace internal { + +namespace no_duplicate_field_names_helpers { + +template +constexpr inline void compare_two_fields() { + if constexpr (_j < _i) { + using FieldType1 = std::remove_cvref_t>; + using FieldType2 = std::remove_cvref_t>; + + constexpr auto field_name_i = FieldType1::name_; + constexpr auto field_name_j = FieldType2::name_; + + constexpr bool no_duplicate = (field_name_i != field_name_j); + + static_assert(no_duplicate, + "Duplicate field names are not allowed in either named " + "tuples or Literals."); + } +} + +template +constexpr inline void iterate_over_j(std::integer_sequence) { + (compare_two_fields(), ...); +} + +template +constexpr inline void iterate_over_i(std::integer_sequence) { + (iterate_over_j(std::make_integer_sequence()), ...); +} +} // namespace no_duplicate_field_names_helpers + +template +constexpr inline bool no_duplicate_field_names() { + constexpr auto num_fields = rfl::tuple_size_v; + + if constexpr (num_fields <= 1) { + return true; + } else { + no_duplicate_field_names_helpers::iterate_over_i( + std::make_integer_sequence()); + return true; + } +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/nt_to_ptr_named_tuple.hpp b/build-config/reflect-cpp/include/rfl/internal/nt_to_ptr_named_tuple.hpp new file mode 100644 index 0000000..641cbd0 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/nt_to_ptr_named_tuple.hpp @@ -0,0 +1,54 @@ +#ifndef RFL_INTERNAL_NT_TO_PTR_NAMED_TUPLE_HPP_ +#define RFL_INTERNAL_NT_TO_PTR_NAMED_TUPLE_HPP_ + +#include "../Field.hpp" +#include "../Tuple.hpp" +#include "../make_named_tuple.hpp" + +namespace rfl { +namespace internal { + +/// Generates a named tuple that contains pointers to the original values in +/// the struct from a named tuple. +template +auto nt_to_ptr_named_tuple(NamedTupleType& _nt) { + using Fields = typename NamedTupleType::Fields; + + const auto get_one = [&](std::integral_constant) { + using FieldType = tuple_element_t<_i, Fields>; + using T = std::remove_cvref_t; + return Field(&rfl::get<_i>(_nt.values())); + }; + + constexpr auto num_fields = rfl::tuple_size_v; + + return [&](std::integer_sequence) { + return make_named_tuple(get_one(std::integral_constant{})...); + } + (std::make_integer_sequence()); +} + +/// Generates a named tuple that contains pointers to the original values in +/// the struct from a named tuple. +template +auto nt_to_ptr_named_tuple(const NamedTupleType& _nt) { + using Fields = typename NamedTupleType::Fields; + + const auto get_one = [&](std::integral_constant) { + using FieldType = tuple_element_t<_i, Fields>; + using T = std::remove_cvref_t; + return Field(&rfl::get<_i>(_nt.values())); + }; + + constexpr auto num_fields = rfl::tuple_size_v; + + return [&](std::integer_sequence) { + return make_named_tuple(get_one(std::integral_constant{})...); + } + (std::make_integer_sequence()); +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/nth_element.hpp b/build-config/reflect-cpp/include/rfl/internal/nth_element.hpp new file mode 100644 index 0000000..281e596 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/nth_element.hpp @@ -0,0 +1,43 @@ +#ifndef RFL_INTERNAL_NTH_ELEMENT_HPP_ +#define RFL_INTERNAL_NTH_ELEMENT_HPP_ + +#include + +namespace rfl::internal { + +template +struct ElementWrapper { + T t_; +}; + +template +constexpr auto operator|(const ElementWrapper& _e1, + const ElementWrapper& _e2) { + if constexpr (_i1 == N) { + return _e1; + } else { + return _e2; + } +} + +template +constexpr auto find_matching_element(const Head& _head, const Tail&... _tail) { + return (_head | ... | _tail); +}; + +template +constexpr auto wrap_elements(Ts... _ts, std::integer_sequence) { + return find_matching_element(ElementWrapper{_ts}...).t_; +} + +template +constexpr auto nth_element(Ts... _ts) { + static_assert(N >= 0, "N out of bounds."); + static_assert(N < sizeof...(Ts), "N out of bounds."); + return wrap_elements( + _ts..., std::make_integer_sequence()); +} + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/nth_element_t.hpp b/build-config/reflect-cpp/include/rfl/internal/nth_element_t.hpp new file mode 100644 index 0000000..016a121 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/nth_element_t.hpp @@ -0,0 +1,29 @@ +#ifndef RFL_INTERNAL_NTH_ELEMENT_T_HPP_ +#define RFL_INTERNAL_NTH_ELEMENT_T_HPP_ + +#include "nth_element.hpp" + +namespace rfl::internal { + +#if defined(__clang__) + +template +using nth_element_t = __type_pack_element; + +#else + +template +struct TypeWrapper { + using Type = T; +}; + +template +using nth_element_t = + typename std::invoke_result_t...>), + TypeWrapper...>::Type; + +#endif + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/num_fields.hpp b/build-config/reflect-cpp/include/rfl/internal/num_fields.hpp new file mode 100644 index 0000000..39de8b4 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/num_fields.hpp @@ -0,0 +1,216 @@ +#ifndef RFL_INTERNAL_NUM_FIELDS_HPP_ +#define RFL_INTERNAL_NUM_FIELDS_HPP_ + +/* +We infer the number of fields using by figuring out how many fields +we need to construct it. This is done by implementing the constructible +concept, see below. + +However, there is a problem with C arrays. Suppose you have a struct +like this: + +struct A{ + int arr[3]; +}; + +Then, the struct can be initialized like this: + +const auto a = A{1, 2, 3}; + +This is a problem, because a naive logic would believe that A +has three fields, when in fact it has only one. + +That is why we use the constructible concept to get the maximum +possible number of fields and then try to subdivide them into arrays +in order to figure out which of these fields is in fact an array. + +Basically, for every field there is, we try to squeeze as many variables into +the potential array as we can without missing variables in subsequent fields. +This is the purpose of get_nested_array_size(). +*/ + +#include +#include +#include + +#if __GNUC__ +#ifndef __clang__ +#pragma GCC system_header +#endif +#endif + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wundefined-var-template" +#pragma clang diagnostic ignored "-Wundefined-inline" +#endif + +namespace rfl { +namespace internal { + +template +struct any_empty_base { + any_empty_base(std::size_t); + template + requires( + std::is_empty_v> && + std::is_base_of_v, + std::remove_cv_t> && + !std::is_same_v, std::remove_cv_t>) + constexpr operator Base&() const noexcept; +}; + +template +struct any_base { + any_base(std::size_t); + template + requires( + std::is_base_of_v, + std::remove_cv_t> && + !std::is_same_v, std::remove_cv_t>) + constexpr operator Base&() const noexcept; +}; + +struct any { + any(std::size_t); + template + constexpr operator T() const noexcept; +}; + +template +struct CountFieldsHelper { + template + static consteval bool constructible() { + return [](std::index_sequence) { + return requires { T{any(is)...}; }; + }(std::make_index_sequence()); + } + + template + static consteval bool constructible_with_nested() { + return []( + std::index_sequence, std::index_sequence, + std::index_sequence) { + return requires { T{any(i)..., {any(j)...}, any(k)...}; }; + }(std::make_index_sequence(), std::make_index_sequence(), + std::make_index_sequence()); + } + + template + static consteval std::size_t count_max_args_in_agg_init() { + static_assert(n <= static_cast(sizeof(T))); + if constexpr (constructible() && !constructible()) { + return n; + } else { + return count_max_args_in_agg_init(); + } + } + + template + static consteval std::size_t get_nested_array_size() { + if constexpr (size < 1) { + return 1; + } else if constexpr (constructible_with_nested() && + !constructible_with_nested()) { + return size; + } else { + return get_nested_array_size(); + } + } + + template + static consteval std::size_t find_the_sole_non_empty_base_index() { + static_assert(index < max_args); + constexpr auto check = []( + std::index_sequence, + std::index_sequence) { + return requires { + T{any_empty_base(l)..., any_base(0), any_empty_base(r)...}; + }; + }; + + if constexpr (check(std::make_index_sequence(), + std::make_index_sequence())) { + return index; + } else { + return find_the_sole_non_empty_base_index(); + } + } + + template + static consteval std::size_t get_nested_base_field_count() { + static_assert(size <= sizeof(T)); + if constexpr (constructible_with_nested() && + !constructible_with_nested()) { + return size; + } else { + return get_nested_base_field_count(); + } + } + + template + static consteval bool has_n_base_param() { + constexpr auto right_len = max_arg_num >= n ? max_arg_num - n : 0; + return [](std::index_sequence, + std::index_sequence) { + return requires { T{any_base(l)..., any(r)...}; }; + }(std::make_index_sequence(), std::make_index_sequence()); + } + + template + static consteval std::size_t base_param_num() { + if constexpr (!has_n_base_param()) { + return index; + } else { + return base_param_num(); + } + } + + template + static consteval std::size_t constructible_no_brace_elision() { + static_assert(index <= max); + if constexpr (index == max) { + return 0; + } else { + return 1 + + constructible_no_brace_elision< + index + get_nested_array_size(), max>(); + } + } + + static consteval std::size_t count_fields() { + constexpr std::size_t max_agg_args = count_max_args_in_agg_init(); +#if defined(REFLECT_CPP_C_ARRAYS_OR_INHERITANCE) || \ + defined(REFLECTCPP_C_ARRAYS_OR_INHERITANCE) + constexpr std::size_t no_brace_ellison_args = + constructible_no_brace_elision<0, max_agg_args>(); + constexpr std::size_t base_args = base_param_num(); + if constexpr (no_brace_ellison_args == 0 && base_args == 0) { + // Empty struct + return 0; + } else if constexpr (base_args == no_brace_ellison_args) { + // Special case when the derived class is empty. + // In such cases the filed number is the fields in base class. + // Note that there should be only one base class in this case. + return get_nested_base_field_count< + find_the_sole_non_empty_base_index()>(); + } else { + return no_brace_ellison_args - base_args; + } +#else + return max_agg_args; +#endif + } +}; + +template +constexpr std::size_t num_fields = CountFieldsHelper::count_fields(); + +} // namespace internal +} // namespace rfl + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/processed_t.hpp b/build-config/reflect-cpp/include/rfl/internal/processed_t.hpp new file mode 100644 index 0000000..1e6250c --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/processed_t.hpp @@ -0,0 +1,29 @@ +#ifndef RFL_INTERNAL_PROCESSED_T_HPP_ +#define RFL_INTERNAL_PROCESSED_T_HPP_ + +#include + +#include "../Processors.hpp" +#include "ptr_named_tuple_t.hpp" +#include "remove_ptrs_nt.hpp" + +namespace rfl::internal { + +template +struct Processed; + +template +struct Processed> { + using PtrNamedTupleType = ptr_named_tuple_t; + using type = typename remove_ptrs_nt< + std::invoke_result_t::template process< + StructType, PtrNamedTupleType>), + PtrNamedTupleType>>::NamedTupleType; +}; + +template +using processed_t = typename Processed::type; + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/ptr_cast.hpp b/build-config/reflect-cpp/include/rfl/internal/ptr_cast.hpp new file mode 100644 index 0000000..9efba7a --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/ptr_cast.hpp @@ -0,0 +1,22 @@ +#ifndef RFL_INTERNAL_PTRCAST_HPP_ +#define RFL_INTERNAL_PTRCAST_HPP_ + +namespace rfl::internal { + +/// Normally, we would use std::launder(reinterpret_cast<...>(...)), +/// but there are weird issues on GCC 12 under certain compiler settings, +/// so we are using this workaround instead. + +template +inline T1 ptr_cast(T2* _ptr) { + return static_cast(static_cast(_ptr)); +} + +template +inline T1 ptr_cast(const T2* _ptr) { + return static_cast(static_cast(_ptr)); +} + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/ptr_field_tuple_t.hpp b/build-config/reflect-cpp/include/rfl/internal/ptr_field_tuple_t.hpp new file mode 100644 index 0000000..9b20a9b --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/ptr_field_tuple_t.hpp @@ -0,0 +1,15 @@ +#ifndef RFL_INTERNAL_PTR_NAMED_TUPLE_T_HPP_ +#define RFL_INTERNAL_PTR_NAMED_TUPLE_T_HPP_ + +#include "to_ptr_field_tuple.hpp" + +namespace rfl { +namespace internal { + +template +using ptr_field_tuple_t = decltype(to_ptr_field_tuple(std::declval())); + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/ptr_named_tuple_t.hpp b/build-config/reflect-cpp/include/rfl/internal/ptr_named_tuple_t.hpp new file mode 100644 index 0000000..f8c88ef --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/ptr_named_tuple_t.hpp @@ -0,0 +1,19 @@ +#ifndef RFL_INTERNAL_PTR_FIELD_TUPLE_T_HPP_ +#define RFL_INTERNAL_PTR_FIELD_TUPLE_T_HPP_ + +#include + +//#include "is_named_tuple.hpp"//Not here +#include "to_ptr_named_tuple.hpp" + +namespace rfl { +namespace internal { + +template +using ptr_named_tuple_t = + std::invoke_result_t), T>; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/ptr_tuple_t.hpp b/build-config/reflect-cpp/include/rfl/internal/ptr_tuple_t.hpp new file mode 100644 index 0000000..1a11965 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/ptr_tuple_t.hpp @@ -0,0 +1,15 @@ +#ifndef RFL_INTERNAL_PTR_TUPLE_T_HPP_ +#define RFL_INTERNAL_PTR_TUPLE_T_HPP_ + +#include "to_ptr_tuple.hpp" + +namespace rfl { +namespace internal { + +template +using ptr_tuple_t = decltype(to_ptr_tuple(std::declval())); + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/remove_fields.hpp b/build-config/reflect-cpp/include/rfl/internal/remove_fields.hpp new file mode 100644 index 0000000..c0ec676 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/remove_fields.hpp @@ -0,0 +1,82 @@ +#ifndef RFL_INTERNAL_REMOVEFIELDS_HPP_ +#define RFL_INTERNAL_REMOVEFIELDS_HPP_ + +#include + +#include "../NamedTuple.hpp" +#include "../Tuple.hpp" +#include "../define_named_tuple.hpp" +#include "StringLiteral.hpp" + +namespace rfl { +namespace internal { + +/// Recursively builds a new NamedTuple type from the FieldTypes, leaving out +/// the field signified by _name. +template +struct remove_single_field; + +/// Special case - _i == 0 +template +struct remove_single_field<_OldNamedTupleType, _name, _NewNamedTupleType, 0> { + using type = _NewNamedTupleType; +}; + +/// General case. +template +struct remove_single_field { + using OldNamedTupleType = std::remove_cvref_t<_OldNamedTupleType>; + + constexpr static int num_fields = + rfl::tuple_size_v; + + using FieldType = std::remove_cvref_t< + tuple_element_t>; + + using NewNamedTupleType = + std::conditional_t<_name == FieldType::name_, _NewNamedTupleType, + define_named_tuple_t<_NewNamedTupleType, FieldType>>; + + using type = typename remove_single_field::type; +}; + +/// Recursively removes all of the fields signified by _head and _tail from the +/// NamedTupleType. +template +struct remove_fields; + +/// Special case - only head is left. +template +struct remove_fields<_NamedTupleType, _head> { + using NamedTupleType = std::remove_cvref_t<_NamedTupleType>; + + constexpr static int num_fields = + rfl::tuple_size_v; + + using type = typename remove_single_field, + num_fields>::type; +}; + +/// General case. +template +struct remove_fields { + using NamedTupleType = std::remove_cvref_t<_NamedTupleType>; + + constexpr static int num_fields = + rfl::tuple_size_v; + + using NewNamedTupleType = + typename remove_single_field, + num_fields>::type; + + using type = typename remove_fields::type; +}; + +} // namespace internal +} // namespace rfl + +#endif // RFL_REMOVEFIELDS_HPP_ diff --git a/build-config/reflect-cpp/include/rfl/internal/remove_namespaces.hpp b/build-config/reflect-cpp/include/rfl/internal/remove_namespaces.hpp new file mode 100644 index 0000000..ac2eb9d --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/remove_namespaces.hpp @@ -0,0 +1,29 @@ +#ifndef RFL_INTERNAL_REMOVE_NAMESPACES_HPP_ +#define RFL_INTERNAL_REMOVE_NAMESPACES_HPP_ + +#include +#include + +#include "StringLiteral.hpp" + +namespace rfl { +namespace internal { + +template +consteval auto remove_namespaces() { + constexpr auto name = _name.string_view(); + constexpr size_t pos = name.find_last_of(":"); + if constexpr (pos == std::string_view::npos) { + return _name; + } + constexpr auto substr = name.substr(pos + 1); + const auto to_str_lit = [&](std::index_sequence) { + return StringLiteral{substr[Ns]...}; + }; + return to_str_lit(std::make_index_sequence{}); +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/remove_ptrs_nt.hpp b/build-config/reflect-cpp/include/rfl/internal/remove_ptrs_nt.hpp new file mode 100644 index 0000000..cc503aa --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/remove_ptrs_nt.hpp @@ -0,0 +1,34 @@ +#ifndef RFL_INTERNAL_REMOVE_PTRS_NT_HPP_ +#define RFL_INTERNAL_REMOVE_PTRS_NT_HPP_ + +#include + +#include "../Field.hpp" +#include "../NamedTuple.hpp" +#include "StringLiteral.hpp" +#include "wrap_in_rfl_array_t.hpp" + +namespace rfl::internal { + +template +struct remove_ptr; + +template +struct remove_ptr> { + using FieldType = + Field<_name, internal::wrap_in_rfl_array_t< + std::remove_cvref_t>>>; +}; + +template +struct remove_ptrs_nt; + +template +struct remove_ptrs_nt> { + using NamedTupleType = + NamedTuple::FieldType...>; +}; + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/remove_ptrs_tup.hpp b/build-config/reflect-cpp/include/rfl/internal/remove_ptrs_tup.hpp new file mode 100644 index 0000000..9425765 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/remove_ptrs_tup.hpp @@ -0,0 +1,25 @@ +#ifndef RFL_INTERNAL_REMOVE_PTRS_TUP_HPP_ +#define RFL_INTERNAL_REMOVE_PTRS_TUP_HPP_ + +#include + +#include "../Tuple.hpp" +#include "../to_named_tuple.hpp" +#include "ptr_tuple_t.hpp" + +namespace rfl { +namespace internal { + +template +struct remove_ptrs_tup; + +template +struct remove_ptrs_tup> { + using TupleType = + rfl::Tuple>...>; +}; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/remove_rename.hpp b/build-config/reflect-cpp/include/rfl/internal/remove_rename.hpp new file mode 100644 index 0000000..09321e3 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/remove_rename.hpp @@ -0,0 +1,32 @@ +#ifndef RFL_INTERNAL_REMOVERENAME_HPP_ +#define RFL_INTERNAL_REMOVERENAME_HPP_ + +#include + +#include "../Rename.hpp" +#include "StringLiteral.hpp" + +namespace rfl { +namespace internal { + +template +struct remove_rename; + +template +struct remove_rename { + using Type = T; +}; + +template +struct remove_rename> { + using Type = _Type; +}; + +template +using remove_rename_t = + typename remove_rename>>::Type; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/strings/strings.hpp b/build-config/reflect-cpp/include/rfl/internal/strings/strings.hpp new file mode 100644 index 0000000..35ec5d0 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/strings/strings.hpp @@ -0,0 +1,31 @@ +#ifndef RFL_INTERNAL_STRINGS_STRINGS_HPP_ +#define RFL_INTERNAL_STRINGS_STRINGS_HPP_ + +#include +#include + +#include "../../common.hpp" + +namespace rfl::internal::strings { + +/// Joins a series of strings. +RFL_API std::string join(const std::string& _delimiter, + const std::vector& _strings); + +/// Replace all occurences of _from with _to. +RFL_API std::string replace_all(const std::string& _str, const std::string& _from, + const std::string& _to); + +/// Splits _str along _delimiter. +RFL_API std::vector split(const std::string& _str, + const std::string& _delimiter); + +/// Transforms the string to camel case. +RFL_API std::string to_camel_case(const std::string& _str); + +/// Transforms the string to pascal case. +RFL_API std::string to_pascal_case(const std::string& _str); + +} // namespace rfl::internal::strings + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/tag_t.hpp b/build-config/reflect-cpp/include/rfl/internal/tag_t.hpp new file mode 100644 index 0000000..4ce5e0d --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/tag_t.hpp @@ -0,0 +1,16 @@ +#ifndef RFL_INTERNAL_TAG_T_HPP_ +#define RFL_INTERNAL_TAG_T_HPP_ + +#include + +#include "StringLiteral.hpp" +#include "make_tag.hpp" + +namespace rfl::internal { + +template +using tag_t = std::invoke_result_t), T>; + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/to_flattened_ptr_tuple.hpp b/build-config/reflect-cpp/include/rfl/internal/to_flattened_ptr_tuple.hpp new file mode 100644 index 0000000..2287d94 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/to_flattened_ptr_tuple.hpp @@ -0,0 +1,44 @@ +#ifndef RFL_INTERNAL_TO_FLATTENED_PTR_TUPLE_HPP_ +#define RFL_INTERNAL_TO_FLATTENED_PTR_TUPLE_HPP_ + +#include "../Tuple.hpp" +#include "../tuple_cat.hpp" +#include "has_flatten_fields.hpp" +#include "is_flatten_field.hpp" +#include "to_ptr_tuple.hpp" + +namespace rfl { +namespace internal { + +template +auto flatten_ptr_tuple(PtrTuple&& _t) { + if constexpr (!has_flatten_fields()) { + return std::forward(_t); + } else { + const auto get_one = [&](std::integral_constant) { + using T = tuple_element_t<_i, std::remove_cvref_t>; + if constexpr (is_flatten_field_v) { + return flatten_ptr_tuple(to_ptr_tuple(rfl::get<_i>(_t)->get())); + } else { + return rfl::make_tuple(rfl::get<_i>(_t)); + } + }; + + constexpr auto size = rfl::tuple_size_v>; + + return [&](std::integer_sequence) { + return rfl::tuple_cat(get_one(std::integral_constant{})...); + } + (std::make_integer_sequence()); + } +} + +template +auto to_flattened_ptr_tuple(T&& _t) { + return flatten_ptr_tuple(to_ptr_tuple(_t)); +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/to_ptr_field.hpp b/build-config/reflect-cpp/include/rfl/internal/to_ptr_field.hpp new file mode 100644 index 0000000..0db97cc --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/to_ptr_field.hpp @@ -0,0 +1,41 @@ +#ifndef RFL_INTERNAL_TOPTRFIELD_HPP_ +#define RFL_INTERNAL_TOPTRFIELD_HPP_ + +#include + +#include "../Field.hpp" +#include "../Flatten.hpp" +#include "../always_false.hpp" +#include "StringLiteral.hpp" + +namespace rfl { +namespace internal { + +template +inline auto to_ptr_field(Field<_name, Type>& _field) { + using T = std::remove_reference_t; + return Field<_name, T*>(&_field.value_); +} + +template +inline auto to_ptr_field(const Field<_name, Type>& _field) { + using T = std::remove_cvref_t; + return Field<_name, const T*>(&_field.value_); +} + +template +inline auto to_ptr_field(Flatten& _field) { + using T = std::remove_reference_t; + return Flatten(&_field.value_); +} + +template +inline auto to_ptr_field(const Flatten& _field) { + using T = std::remove_cvref_t; + return Flatten(&_field.value_); +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/to_ptr_field_tuple.hpp b/build-config/reflect-cpp/include/rfl/internal/to_ptr_field_tuple.hpp new file mode 100644 index 0000000..e8bd354 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/to_ptr_field_tuple.hpp @@ -0,0 +1,39 @@ +#ifndef RFL_INTERNAL_TO_PTR_FIELD_TUPLE_HPP_ +#define RFL_INTERNAL_TO_PTR_FIELD_TUPLE_HPP_ + +#include + +#include "../field_names_t.hpp" +#include "bind_to_tuple.hpp" +#include "has_fields.hpp" +#include "is_empty.hpp" +#include "is_named_tuple.hpp" +#include "nt_to_ptr_named_tuple.hpp" +#include "to_ptr_field.hpp" +#include "wrap_in_fields.hpp" + +namespace rfl { +namespace internal { + +template +auto to_ptr_field_tuple(T& _t) { + if constexpr (std::is_pointer_v>) { + return to_ptr_field_tuple(*_t); + } else if constexpr (is_named_tuple_v) { + return nt_to_ptr_named_tuple(_t).fields(); + } else if constexpr (has_fields()) { + return bind_to_tuple(_t, [](auto* _ptr) { return to_ptr_field(*_ptr); }); + } else if constexpr (is_empty()) { + return rfl::Tuple(); + } else { + using FieldNames = field_names_t; + auto tup = + bind_to_tuple(_t, [](auto* _ptr) { return to_ptr_field(*_ptr); }); + return wrap_in_fields(std::move(tup)); + } +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/to_ptr_named_tuple.hpp b/build-config/reflect-cpp/include/rfl/internal/to_ptr_named_tuple.hpp new file mode 100644 index 0000000..eeb25fd --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/to_ptr_named_tuple.hpp @@ -0,0 +1,80 @@ +#ifndef RFL_INTERNAL_TO_PTR_NAMED_TUPLE_HPP_ +#define RFL_INTERNAL_TO_PTR_NAMED_TUPLE_HPP_ + + +#include "../Tuple.hpp" +#include "../always_false.hpp" +#include "../field_names_t.hpp" +#include "../make_named_tuple.hpp" +#include "copy_flattened_tuple_to_named_tuple.hpp" +#include "has_fields.hpp" +#include "has_flatten_fields.hpp" +#include "is_empty.hpp" +#include "is_field.hpp" +#include "is_named_tuple.hpp" +#include "to_flattened_ptr_tuple.hpp" +#include "to_ptr_field_tuple.hpp" + +namespace rfl { +namespace internal { + +template +auto flatten_ptr_field_tuple(PtrFieldTuple& _t) { + const auto get_one = [&](std::integral_constant) { + using T = tuple_element_t<_i, std::remove_cvref_t>; + if constexpr (internal::is_flatten_field::value) { + auto subtuple = internal::to_ptr_field_tuple(*rfl::get<_i>(_t).get()); + return flatten_ptr_field_tuple(subtuple); + } else { + return rfl::make_tuple(rfl::get<_i>(_t)); + } + }; + + constexpr auto size = rfl::tuple_size_v>; + + return [&](std::integer_sequence) { + return rfl::tuple_cat(get_one(std::integral_constant{})...); + } + (std::make_integer_sequence()); +} + +template +auto field_tuple_to_named_tuple(PtrFieldTuple& _ptr_field_tuple) { + const auto ft_to_nt = [](Fields&&... _fields) { + return make_named_tuple(_fields...); + }; + + if constexpr (!has_flatten_fields>()) { + return rfl::apply(ft_to_nt, std::move(_ptr_field_tuple)); + } else { + const auto flattened_tuple = flatten_ptr_field_tuple(_ptr_field_tuple); + return rfl::apply(ft_to_nt, flattened_tuple); + } +} + +/// Generates a named tuple that contains pointers to the original values in +/// the struct. +template +auto to_ptr_named_tuple(T&& _t) { + if constexpr (has_fields>()) { + if constexpr (std::is_pointer_v>) { + return to_ptr_named_tuple(*_t); + } else if constexpr (is_named_tuple_v>) { + return nt_to_ptr_named_tuple(_t); + } else { + auto ptr_field_tuple = to_ptr_field_tuple(_t); + return field_tuple_to_named_tuple(ptr_field_tuple); + } + } else if constexpr (is_empty()) { + return rfl::NamedTuple<>(); + } else { + using FieldNames = rfl::field_names_t; + auto flattened_ptr_tuple = to_flattened_ptr_tuple(_t); + return copy_flattened_tuple_to_named_tuple(flattened_ptr_tuple); + } +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/to_ptr_tuple.hpp b/build-config/reflect-cpp/include/rfl/internal/to_ptr_tuple.hpp new file mode 100644 index 0000000..076a5e5 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/to_ptr_tuple.hpp @@ -0,0 +1,23 @@ +#ifndef RFL_INTERNAL_TO_PTR_TUPLE_HPP_ +#define RFL_INTERNAL_TO_PTR_TUPLE_HPP_ + +#include + +#include "bind_to_tuple.hpp" + +namespace rfl { +namespace internal { + +template +auto to_ptr_tuple(T& _t) { + if constexpr (std::is_pointer_v>) { + return to_ptr_tuple(*_t); + } else { + return bind_to_tuple(_t); + } +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/to_std_array.hpp b/build-config/reflect-cpp/include/rfl/internal/to_std_array.hpp new file mode 100644 index 0000000..509416c --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/to_std_array.hpp @@ -0,0 +1,57 @@ +#ifndef RFL_INTERNAL_TO_STD_ARRAY_HPP_ +#define RFL_INTERNAL_TO_STD_ARRAY_HPP_ + +#include +#include +#include + +namespace rfl::internal { + +template +struct StdArrayType { + using Type = T; +}; + +template +struct StdArrayType { + using Type = + std::array>::Type, _n>; + using ValueType = std::remove_cvref_t; + constexpr static size_t size = _n; +}; + +template +using to_std_array_t = typename StdArrayType::Type; + +template +auto to_std_array(T&& _t) { + using Type = std::remove_cvref_t; + if constexpr (std::is_array_v) { + constexpr size_t n = StdArrayType::size; + const auto fct = [&](std::index_sequence<_i...>) { + return to_std_array_t({to_std_array( + std::forward::ValueType>(_t[_i]))...}); + }; + return fct(std::make_index_sequence()); + } else { + return std::forward(_t); + } +} + +template +auto to_std_array(const T& _t) { + using Type = std::remove_cvref_t; + if constexpr (std::is_array_v) { + constexpr size_t n = StdArrayType::size; + const auto fct = [&](std::index_sequence<_i...>) { + return to_std_array_t({to_std_array(_t[_i])...}); + }; + return fct(std::make_index_sequence()); + } else { + return _t; + } +} + +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/transform_snake_case.hpp b/build-config/reflect-cpp/include/rfl/internal/transform_snake_case.hpp new file mode 100644 index 0000000..cf7360d --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/transform_snake_case.hpp @@ -0,0 +1,55 @@ +#ifndef RFL_INTERNAL_TRANSFORMSNAKECASE_HPP_ +#define RFL_INTERNAL_TRANSFORMSNAKECASE_HPP_ + +#include "StringLiteral.hpp" + +namespace rfl::internal { + +/// Capitalizes a lower-case character. +template +consteval char to_upper() { + if constexpr (c >= 'a' && c <= 'z') { + return c + ('A' - 'a'); + } else { + return c; + } +} + +template +consteval char to_lower() { + if constexpr (c >= 'A' && c <= 'Z') { + return c - ('A' - 'a'); + } else { + return c; + } +} + +/// Transforms the field name from snake case to camel case. +template +consteval auto transform_snake_case() { + if constexpr (_i == _name.arr_.size()) { + return StringLiteral(chars...); + + } else if constexpr (_name.arr_[_i] == '_') { + return transform_snake_case<_name, true, _i + 1, chars...>(); + + } else if constexpr (_name.arr_[_i] == '\0') { + return transform_snake_case<_name, false, _name.arr_.size(), chars...>(); + + } else if constexpr (_capitalize) { + return transform_snake_case<_name, false, _i + 1, chars..., + to_upper<_name.arr_[_i]>()>(); + + } else if constexpr (sizeof...(chars) == 0) { + return transform_snake_case<_name, false, _i + 1, + to_lower<_name.arr_[_i]>()>(); + + } else { + return transform_snake_case<_name, false, _i + 1, chars..., + _name.arr_[_i]>(); + } +} +} // namespace rfl::internal + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/tup_to_ptr_tuple.hpp b/build-config/reflect-cpp/include/rfl/internal/tup_to_ptr_tuple.hpp new file mode 100644 index 0000000..3e8bfdb --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/tup_to_ptr_tuple.hpp @@ -0,0 +1,25 @@ +#ifndef RFL_INTERNAL_TUP_TO_PTR_TUPLE_HPP_ +#define RFL_INTERNAL_TUP_TO_PTR_TUPLE_HPP_ + +#include "../Field.hpp" +#include "../Tuple.hpp" +#include "../apply.hpp" +#include "../make_named_tuple.hpp" + +namespace rfl { +namespace internal { + +/// Generates a named tuple that contains pointers to the original values in +/// the struct from a tuple. +template +auto tup_to_ptr_tuple(TupleType& _t) { + const auto to_ptr = [](auto&... _fields) { + return rfl::make_tuple(&_fields...); + }; + return rfl::apply(to_ptr, _t); +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/tuple/accumulate_sizes.hpp b/build-config/reflect-cpp/include/rfl/internal/tuple/accumulate_sizes.hpp new file mode 100644 index 0000000..b33347c --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/tuple/accumulate_sizes.hpp @@ -0,0 +1,38 @@ +#ifndef RFL_INTERNAL_TUPLE_ACCUMULATE_SIZES_HPP_ +#define RFL_INTERNAL_TUPLE_ACCUMULATE_SIZES_HPP_ + +#include + +namespace rfl::internal::tuple { + +template +struct SizeWrapper {}; + +template +struct Sizes { + static consteval auto to_array() { + return std::array({_is..., _last}); + } +}; + +template +consteval auto operator+(const Sizes<_last, _is...>& /*_sizes*/, + const SizeWrapper& /*_w*/) { + if constexpr (_last % alignof(T) == 0) { + constexpr auto last_new = _last + sizeof(T); + return Sizes{}; + } else { + constexpr auto last_corrected = _last + alignof(T) - (_last % alignof(T)); + constexpr auto last_new = last_corrected + sizeof(T); + return Sizes{}; + } +} + +template +consteval auto accumulate_sizes() { + return (Sizes<0>{} + ... + SizeWrapper{}).to_array(); +} + +} // namespace rfl::internal::tuple + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/tuple/apply.hpp b/build-config/reflect-cpp/include/rfl/internal/tuple/apply.hpp new file mode 100644 index 0000000..18e38ee --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/tuple/apply.hpp @@ -0,0 +1,30 @@ +#ifndef RFL_INTERNAL_TUPLE_APPLY_HPP_ +#define RFL_INTERNAL_TUPLE_APPLY_HPP_ + +#include + +#include "../../Tuple.hpp" + +namespace rfl::internal::tuple { + +template +auto apply(F&& _f, const rfl::Tuple& _tup, + std::integer_sequence) { + return _f(rfl::get<_is>(_tup)...); +} + +template +auto apply(F&& _f, rfl::Tuple& _tup, + std::integer_sequence) { + return _f(rfl::get<_is>(_tup)...); +} + +template +auto apply(F&& _f, rfl::Tuple&& _tup, + std::integer_sequence) { + return _f(std::move(rfl::get<_is>(_tup))...); +} + +} // namespace rfl::internal::tuple + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/tuple/calculate_positions.hpp b/build-config/reflect-cpp/include/rfl/internal/tuple/calculate_positions.hpp new file mode 100644 index 0000000..416d345 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/tuple/calculate_positions.hpp @@ -0,0 +1,38 @@ +#ifndef RFL_INTERNAL_TUPLE_CALCULATE_POSITIONS_HPP_ +#define RFL_INTERNAL_TUPLE_CALCULATE_POSITIONS_HPP_ + +#include + +namespace rfl::internal::tuple { + +template +struct PositionWrapper {}; + +template +struct Positions { + static consteval auto to_array() { + return std::array({_is..., _last}); + } +}; + +template +consteval auto operator+(const Positions<_last, _is...>&, + const PositionWrapper&) { + if constexpr (_last % alignof(T) == 0) { + constexpr auto last_new = _last + sizeof(T); + return Positions{}; + } else { + constexpr auto last_corrected = _last + alignof(T) - (_last % alignof(T)); + constexpr auto last_new = last_corrected + sizeof(T); + return Positions{}; + } +} + +template +consteval auto calculate_positions() { + return (Positions<0>{} + ... + PositionWrapper{}).to_array(); +} + +} // namespace rfl::internal::tuple + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/tuple/concat.hpp b/build-config/reflect-cpp/include/rfl/internal/tuple/concat.hpp new file mode 100644 index 0000000..3020a00 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/tuple/concat.hpp @@ -0,0 +1,56 @@ +#ifndef RFL_INTERNAL_TUPLE_CONCAT_HPP_ +#define RFL_INTERNAL_TUPLE_CONCAT_HPP_ + +#include + +#include "../../Tuple.hpp" + +namespace rfl::internal::tuple { + +template +struct TupleWrapper { + rfl::Tuple tuple_; +}; + +template +auto wrap_tuple(const rfl::Tuple& _tuple) { + return TupleWrapper{_tuple}; +} + +template +auto wrap_tuple(rfl::Tuple&& _tuple) { + return TupleWrapper{std::forward >(_tuple)}; +} + +template +auto concat_two(rfl::Tuple&& _t1, rfl::Tuple&& _t2, + std::integer_sequence, + std::integer_sequence) { + return rfl::Tuple(std::move(rfl::get<_is>(_t1))..., + std::move(rfl::get<_js>(_t2))...); +} + +template +auto operator+(TupleWrapper&& _t1, TupleWrapper&& _t2) { + return TupleWrapper{ + .tuple_ = + concat_two(std::move(_t1.tuple_), std::move(_t2.tuple_), + std::make_integer_sequence(), + std::make_integer_sequence())}; +} + +template +auto concat(const Head& _head, const Tail&... _tail) { + return (wrap_tuple(_head) + ... + wrap_tuple(_tail)); +} + +template +auto concat(Head&& _head, Tail&&... _tail) { + return (wrap_tuple(std::forward(_head)) + ... + + wrap_tuple(std::forward(_tail))) + .tuple_; +} + +} // namespace rfl::internal::tuple + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/tuple/make_from_tuple.hpp b/build-config/reflect-cpp/include/rfl/internal/tuple/make_from_tuple.hpp new file mode 100644 index 0000000..93e362f --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/tuple/make_from_tuple.hpp @@ -0,0 +1,24 @@ +#ifndef RFL_INTERNAL_TUPLE_MAKE_FROM_TUPLE_HPP_ +#define RFL_INTERNAL_TUPLE_MAKE_FROM_TUPLE_HPP_ + +#include + +#include "../../Tuple.hpp" + +namespace rfl::internal::tuple { + +template +T make_from_tuple(const rfl::Tuple& _t1, + std::integer_sequence) { + return T{rfl::get<_is>(_t1)...}; +} + +template +T make_from_tuple(rfl::Tuple&& _t1, + std::integer_sequence) { + return T{std::move(rfl::get<_is>(_t1))...}; +} + +} // namespace rfl::internal::tuple + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/tuple_t.hpp b/build-config/reflect-cpp/include/rfl/internal/tuple_t.hpp new file mode 100644 index 0000000..2d09c07 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/tuple_t.hpp @@ -0,0 +1,17 @@ +#ifndef RFL_INTERNAL_TUPLE_T_HPP_ +#define RFL_INTERNAL_TUPLE_T_HPP_ + +#include "ptr_tuple_t.hpp" +#include "remove_ptrs_tup.hpp" +#include "../to_named_tuple.hpp" + +namespace rfl { +namespace internal { + +template +using tuple_t = typename remove_ptrs_tup>::TupleType; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/variant/find_max_size.hpp b/build-config/reflect-cpp/include/rfl/internal/variant/find_max_size.hpp new file mode 100644 index 0000000..c43ed66 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/variant/find_max_size.hpp @@ -0,0 +1,29 @@ +#ifndef RFL_INTERNAL_VARIANT_FIND_MAX_SIZE_HPP_ +#define RFL_INTERNAL_VARIANT_FIND_MAX_SIZE_HPP_ + +namespace rfl::internal::variant { + +template +struct SizeWrapper { + using Type = T; + static constexpr unsigned long size_ = sizeof(T); +}; + +template +consteval auto operator|(const SizeWrapper& _s1, + const SizeWrapper& _s2) { + if constexpr (sizeof(T2) > sizeof(T1)) { + return _s2; + } else { + return _s1; + } +} + +template +consteval auto find_max_size() { + return (SizeWrapper{} | ... | SizeWrapper{}); +} + +} // namespace rfl::internal::variant + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/variant/is_alternative_type.hpp b/build-config/reflect-cpp/include/rfl/internal/variant/is_alternative_type.hpp new file mode 100644 index 0000000..af8e952 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/variant/is_alternative_type.hpp @@ -0,0 +1,19 @@ +#ifndef RFL_INTERNAL_VARIANT_IS_ALTERNATIVE_TYPE_HPP_ +#define RFL_INTERNAL_VARIANT_IS_ALTERNATIVE_TYPE_HPP_ + +#include + +#include "../element_index.hpp" + +namespace rfl::internal::variant { + +template +static constexpr bool is_alternative_type() { + return internal::element_index, + std::remove_cvref_t...>() != + -1; +} + +} // namespace rfl::internal::variant + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/variant/is_convertible_to.hpp b/build-config/reflect-cpp/include/rfl/internal/variant/is_convertible_to.hpp new file mode 100644 index 0000000..8121bf7 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/variant/is_convertible_to.hpp @@ -0,0 +1,17 @@ +#ifndef RFL_INTERNAL_VARIANT_IS_CONVERTIBLE_TO_HPP_ +#define RFL_INTERNAL_VARIANT_IS_CONVERTIBLE_TO_HPP_ + +#include + +#include "../element_index.hpp" + +namespace rfl::internal::variant { + +template +static constexpr bool is_convertible_to() { + return std::disjunction_v...>; +} + +} // namespace rfl::internal::variant + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/variant/result_t.hpp b/build-config/reflect-cpp/include/rfl/internal/variant/result_t.hpp new file mode 100644 index 0000000..a906c5a --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/variant/result_t.hpp @@ -0,0 +1,16 @@ +#ifndef RFL_INTERNAL_VARIANT_RESULT_T_HPP_ +#define RFL_INTERNAL_VARIANT_RESULT_T_HPP_ + +#include + +#include "../nth_element_t.hpp" + +namespace rfl::internal::variant { + +template +using result_t = std::remove_cv_t, internal::nth_element_t<0, AlternativeTypes...>&>>; + +} // namespace rfl::internal::variant + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/wrap_in_fields.hpp b/build-config/reflect-cpp/include/rfl/internal/wrap_in_fields.hpp new file mode 100644 index 0000000..f536779 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/wrap_in_fields.hpp @@ -0,0 +1,47 @@ +#ifndef RFL_INTERNAL_WRAP_IN_FIELDS_HPP_ +#define RFL_INTERNAL_WRAP_IN_FIELDS_HPP_ + +#include + +#include "../Field.hpp" +#include "../Tuple.hpp" +#include "flattened_ptr_tuple_t.hpp" +#include "is_flatten_field.hpp" +#include "lit_name.hpp" + +namespace rfl { +namespace internal { + +// TODO: Non-recursive implementation +template +auto wrap_in_fields(auto&& _tuple, Fields&&... _fields) { + constexpr auto size = + rfl::tuple_size_v>; + constexpr auto i = sizeof...(_fields); + if constexpr (i == size) { + return rfl::make_tuple(std::move(_fields)...); + } else { + auto value = std::move(std::get(_tuple)); + using Type = std::remove_cvref_t>; + if constexpr (is_flatten_field_v) { + // The problem here is that the FieldNames are already flattened, but this + // is not, so we need to determine how many field names to skip. + constexpr auto n_skip = rfl::tuple_size_v< + std::remove_cvref_t>>; + return wrap_in_fields( + std::move(_tuple), std::move(_fields)..., std::move(value)); + } else { + const auto name_literal = FieldNames::template name_of(); + auto new_field = rfl::make_field< + lit_name_v>>( + std::move(value)); + return wrap_in_fields( + std::move(_tuple), std::move(_fields)..., std::move(new_field)); + } + } +} + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/internal/wrap_in_rfl_array_t.hpp b/build-config/reflect-cpp/include/rfl/internal/wrap_in_rfl_array_t.hpp new file mode 100644 index 0000000..2378d57 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/internal/wrap_in_rfl_array_t.hpp @@ -0,0 +1,28 @@ +#ifndef RFL_INTERNAL_WRAP_IN_RFL_ARRAY_T_ +#define RFL_INTERNAL_WRAP_IN_RFL_ARRAY_T_ + +#include + +#include "Array.hpp" + +namespace rfl { +namespace internal { + +template +struct wrap_in_rfl_array { + using type = T; +}; + +template +requires std::is_array_v +struct wrap_in_rfl_array { + using type = Array; +}; + +template +using wrap_in_rfl_array_t = typename wrap_in_rfl_array::type; + +} // namespace internal +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/io/load_bytes.hpp b/build-config/reflect-cpp/include/rfl/io/load_bytes.hpp new file mode 100644 index 0000000..84bd21f --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/io/load_bytes.hpp @@ -0,0 +1,29 @@ +#ifndef RFL_IO_LOAD_BYTES_HPP_ +#define RFL_IO_LOAD_BYTES_HPP_ + +#include +#include +#include +#include + +#include "../Result.hpp" + +namespace rfl { +namespace io { + +inline Result> load_bytes(const std::string& _fname) { + std::ifstream input(_fname, std::ios::binary); + if (input.is_open()) { + std::istreambuf_iterator begin(input), end; + const auto bytes = std::vector(begin, end); + input.close(); + return bytes; + } else { + return error("File '" + _fname + "' not found!"); + } +} + +} // namespace io +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/io/load_string.hpp b/build-config/reflect-cpp/include/rfl/io/load_string.hpp new file mode 100644 index 0000000..8718632 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/io/load_string.hpp @@ -0,0 +1,28 @@ +#ifndef RFL_IO_LOAD_STRING_HPP_ +#define RFL_IO_LOAD_STRING_HPP_ + +#include +#include + +#include "../Result.hpp" + +namespace rfl { +namespace io { + +inline Result load_string(const std::string& _fname) { + std::ifstream infile(_fname); + if (infile.is_open()) { + auto r = std::string(std::istreambuf_iterator(infile), + std::istreambuf_iterator()); + infile.close(); + return r; + } else { + return error("Unable to open file '" + _fname + + "' or file could not be found."); + } +} + +} // namespace io +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/io/save_bytes.hpp b/build-config/reflect-cpp/include/rfl/io/save_bytes.hpp new file mode 100644 index 0000000..0c5fc20 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/io/save_bytes.hpp @@ -0,0 +1,29 @@ +#ifndef RFL_IO_SAVE_BYTES_HPP_ +#define RFL_IO_SAVE_BYTES_HPP_ + +#include +#include +#include + +#include "../Result.hpp" + +namespace rfl { +namespace io { + +template +Result save_bytes(const std::string& _fname, const T& _obj, + const WriteFunction& _write) { + try { + std::ofstream output(_fname, std::ios::out | std::ios::binary); + _write(_obj, output); + output.close(); + } catch (std::exception& e) { + return error(e.what()); + } + return Nothing{}; +} + +} // namespace io +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/io/save_string.hpp b/build-config/reflect-cpp/include/rfl/io/save_string.hpp new file mode 100644 index 0000000..f7c7e6e --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/io/save_string.hpp @@ -0,0 +1,29 @@ +#ifndef RFL_IO_SAVE_STRING_HPP_ +#define RFL_IO_SAVE_STRING_HPP_ + +#include +#include + +#include "../Result.hpp" + +namespace rfl { +namespace io { + +template +Result save_string(const std::string& _fname, const T& _obj, + const WriteFunction& _write) { + try { + std::ofstream outfile; + outfile.open(_fname); + _write(_obj, outfile); + outfile.close(); + } catch (std::exception& e) { + return error(e.what()); + } + return Nothing{}; +} + +} // namespace io +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/json.hpp b/build-config/reflect-cpp/include/rfl/json.hpp new file mode 100644 index 0000000..cac6b0e --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/json.hpp @@ -0,0 +1,14 @@ +#ifndef RFL_JSON_HPP_ +#define RFL_JSON_HPP_ + +#include "../rfl.hpp" +#include "json/Parser.hpp" +#include "json/Reader.hpp" +#include "json/Writer.hpp" +#include "json/load.hpp" +#include "json/read.hpp" +#include "json/save.hpp" +#include "json/to_schema.hpp" +#include "json/write.hpp" + +#endif diff --git a/build-config/reflect-cpp/include/rfl/json/Parser.hpp b/build-config/reflect-cpp/include/rfl/json/Parser.hpp new file mode 100644 index 0000000..9de1755 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/json/Parser.hpp @@ -0,0 +1,15 @@ +#ifndef RFL_JSON_PARSER_HPP_ +#define RFL_JSON_PARSER_HPP_ + +#include "../parsing/Parser.hpp" +#include "Reader.hpp" +#include "Writer.hpp" + +namespace rfl::json { + +template +using Parser = parsing::Parser; + +} // namespace rfl::json + +#endif diff --git a/build-config/reflect-cpp/include/rfl/json/Reader.hpp b/build-config/reflect-cpp/include/rfl/json/Reader.hpp new file mode 100644 index 0000000..b358e71 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/json/Reader.hpp @@ -0,0 +1,164 @@ +#ifndef RFL_JSON_READER_HPP_ +#define RFL_JSON_READER_HPP_ + +#if __has_include() +#include +#else +#include "../thirdparty/yyjson.h" +#endif + +#include +#include +#include +#include +#include + +#include "../Result.hpp" +#include "../always_false.hpp" + +namespace rfl { +namespace json { + +struct Reader { + struct YYJSONInputArray { + YYJSONInputArray(yyjson_val* _val) : val_(_val) {} + yyjson_val* val_; + }; + + struct YYJSONInputObject { + YYJSONInputObject(yyjson_val* _val) : val_(_val) {} + yyjson_val* val_; + }; + + struct YYJSONInputVar { + YYJSONInputVar() : val_(nullptr) {} + YYJSONInputVar(yyjson_val* _val) : val_(_val) {} + yyjson_val* val_; + }; + + using InputArrayType = YYJSONInputArray; + using InputObjectType = YYJSONInputObject; + using InputVarType = YYJSONInputVar; + + template + static constexpr bool has_custom_constructor = + (requires(InputVarType var) { T::from_json_obj(var); }); + + rfl::Result get_field_from_array( + const size_t _idx, const InputArrayType _arr) const noexcept { + const auto var = InputVarType(yyjson_arr_get(_arr.val_, _idx)); + if (!var.val_) { + return error("Index " + std::to_string(_idx) + " of of bounds."); + } + return var; + } + + rfl::Result get_field_from_object( + const std::string& _name, const InputObjectType _obj) const noexcept { + const auto var = InputVarType(yyjson_obj_get(_obj.val_, _name.c_str())); + if (!var.val_) { + return error("Object contains no field named '" + _name + "'."); + } + return var; + } + + bool is_empty(const InputVarType _var) const noexcept { + return !_var.val_ || yyjson_is_null(_var.val_); + } + + template + std::optional read_array(const ArrayReader& _array_reader, + const InputArrayType& _arr) const noexcept { + yyjson_val* val; + yyjson_arr_iter iter; + yyjson_arr_iter_init(_arr.val_, &iter); + while ((val = yyjson_arr_iter_next(&iter))) { + const auto err = _array_reader.read(InputVarType(val)); + if (err) { + return err; + } + } + return std::nullopt; + } + + template + std::optional read_object(const ObjectReader& _object_reader, + const InputObjectType& _obj) const noexcept { + yyjson_obj_iter iter; + yyjson_obj_iter_init(_obj.val_, &iter); + yyjson_val* key; + while ((key = yyjson_obj_iter_next(&iter))) { + const auto name = std::string_view(yyjson_get_str(key)); + _object_reader.read(name, InputVarType(yyjson_obj_iter_get_val(key))); + } + return std::nullopt; + } + + template + rfl::Result to_basic_type(const InputVarType _var) const noexcept { + if constexpr (std::is_same, std::string>()) { + const auto r = yyjson_get_str(_var.val_); + if (r == NULL) { + return error("Could not cast to string."); + } + return std::string(r); + + } else if constexpr (std::is_same, bool>()) { + if (!yyjson_is_bool(_var.val_)) { + return error("Could not cast to boolean."); + } + return yyjson_get_bool(_var.val_); + + } else if constexpr (std::is_floating_point>()) { + if (!yyjson_is_num(_var.val_)) { + return error("Could not cast to double."); + } + return static_cast(yyjson_get_num(_var.val_)); + + } else if constexpr (std::is_unsigned>()) { + if (!yyjson_is_int(_var.val_)) { + return error("Could not cast to int."); + } + return static_cast(yyjson_get_uint(_var.val_)); + + } else if constexpr (std::is_integral>()) { + if (!yyjson_is_int(_var.val_)) { + return error("Could not cast to int."); + } + return static_cast(yyjson_get_sint(_var.val_)); + + } else { + static_assert(rfl::always_false_v, "Unsupported type."); + } + } + + rfl::Result to_array(const InputVarType _var) const noexcept { + if (!yyjson_is_arr(_var.val_)) { + return error("Could not cast to array!"); + } + return InputArrayType(_var.val_); + } + + rfl::Result to_object( + const InputVarType _var) const noexcept { + if (!yyjson_is_obj(_var.val_)) { + return error("Could not cast to object!"); + } + return InputObjectType(_var.val_); + } + + template + rfl::Result use_custom_constructor( + const InputVarType _var) const noexcept { + try { + return T::from_json_obj(_var); + } catch (std::exception& e) { + return error(e.what()); + } + } +}; + +} // namespace json +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/json/Writer.hpp b/build-config/reflect-cpp/include/rfl/json/Writer.hpp new file mode 100644 index 0000000..159c0e0 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/json/Writer.hpp @@ -0,0 +1,146 @@ +#ifndef RFL_JSON_WRITER_HPP_ +#define RFL_JSON_WRITER_HPP_ + +#if __has_include() +#include +#else +#include "../thirdparty/yyjson.h" +#endif + +#include +#include +#include +#include +#include + +// #include "../Result.hpp" +#include "../always_false.hpp" +#include "../common.hpp" + +namespace rfl { +namespace json { + +class RFL_API Writer { + public: + struct YYJSONOutputArray { + YYJSONOutputArray(yyjson_mut_val* _val) : val_(_val) {} + yyjson_mut_val* val_; + }; + + struct YYJSONOutputObject { + YYJSONOutputObject(yyjson_mut_val* _val) : val_(_val) {} + yyjson_mut_val* val_; + }; + + struct YYJSONOutputVar { + YYJSONOutputVar(yyjson_mut_val* _val) : val_(_val) {} + + YYJSONOutputVar(YYJSONOutputArray _arr) : val_(_arr.val_) {} + + YYJSONOutputVar(YYJSONOutputObject _obj) : val_(_obj.val_) {} + + yyjson_mut_val* val_; + }; + + using OutputArrayType = YYJSONOutputArray; + using OutputObjectType = YYJSONOutputObject; + using OutputVarType = YYJSONOutputVar; + + Writer(); + + ~Writer() = default; + + yyjson_mut_doc* doc() const { return doc_.get(); } + + OutputArrayType array_as_root(const size_t) const noexcept; + + OutputObjectType object_as_root(const size_t) const noexcept; + + OutputVarType null_as_root() const noexcept; + + template + OutputVarType value_as_root(const T& _var) const noexcept { + const auto val = from_basic_type(_var); + yyjson_mut_doc_set_root(doc(), val.val_); + return OutputVarType(val); + } + + OutputArrayType add_array_to_array(const size_t, + OutputArrayType* _parent) const; + + OutputArrayType add_array_to_object(const std::string_view& _name, + const size_t, + OutputObjectType* _parent) const; + + OutputObjectType add_object_to_array(const size_t, + OutputArrayType* _parent) const; + + OutputObjectType add_object_to_object(const std::string_view& _name, + const size_t, + OutputObjectType* _parent) const; + + template + OutputVarType add_value_to_array(const T& _var, + OutputArrayType* _parent) const { + const auto val = from_basic_type(_var); + const bool ok = yyjson_mut_arr_add_val(_parent->val_, val.val_); + if (!ok) { + throw std::runtime_error("Could not add value to array."); + } + return OutputVarType(val); + } + + template + OutputVarType add_value_to_object(const std::string_view& _name, + const T& _var, + OutputObjectType* _parent) const { + const auto val = from_basic_type(_var); + const bool ok = yyjson_mut_obj_add( + _parent->val_, yyjson_mut_strcpy(doc(), _name.data()), val.val_); + if (!ok) { + throw std::runtime_error("Could not add field '" + std::string(_name) + + "' to object."); + } + return OutputVarType(val); + } + + OutputVarType add_null_to_array(OutputArrayType* _parent) const; + + OutputVarType add_null_to_object(const std::string_view& _name, + OutputObjectType* _parent) const; + + void end_array(OutputArrayType*) const noexcept; + + void end_object(OutputObjectType*) const noexcept; + + private: + template + OutputVarType from_basic_type(const T& _var) const noexcept { + if constexpr (std::is_same, std::string>()) { + return OutputVarType(yyjson_mut_strcpy(doc(), _var.c_str())); + + } else if constexpr (std::is_same, bool>()) { + return OutputVarType(yyjson_mut_bool(doc(), _var)); + + } else if constexpr (std::is_floating_point>()) { + return OutputVarType(yyjson_mut_real(doc(), static_cast(_var))); + + } else if constexpr (std::is_unsigned>()) { + return OutputVarType(yyjson_mut_uint(doc(), static_cast(_var))); + + } else if constexpr (std::is_integral>()) { + return OutputVarType(yyjson_mut_int(doc(), static_cast(_var))); + + } else { + static_assert(rfl::always_false_v, "Unsupported type."); + } + } + + private: + std::shared_ptr doc_; +}; + +} // namespace json +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/json/load.hpp b/build-config/reflect-cpp/include/rfl/json/load.hpp new file mode 100644 index 0000000..9c8b122 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/json/load.hpp @@ -0,0 +1,22 @@ +#ifndef RFL_JSON_LOAD_HPP_ +#define RFL_JSON_LOAD_HPP_ + +#include "../Result.hpp" +#include "../io/load_string.hpp" +#include "read.hpp" + +namespace rfl { +namespace json { + +template +Result load(const std::string& _fname, const yyjson_read_flag _flag = 0) { + const auto read_string = [_flag](const auto& _str) { + return read(_str, _flag); + }; + return rfl::io::load_string(_fname).and_then(read_string); +} + +} // namespace json +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/json/read.hpp b/build-config/reflect-cpp/include/rfl/json/read.hpp new file mode 100644 index 0000000..3539616 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/json/read.hpp @@ -0,0 +1,64 @@ +#ifndef RFL_JSON_READ_HPP_ +#define RFL_JSON_READ_HPP_ + +#if __has_include() +#include +#else +#include "../thirdparty/yyjson.h" +#endif + +#include +#include + +#include "../Processors.hpp" +#include "../internal/wrap_in_rfl_array_t.hpp" +#include "Parser.hpp" +#include "Reader.hpp" + +namespace rfl { +namespace json { + +using InputObjectType = typename Reader::InputObjectType; +using InputVarType = typename Reader::InputVarType; + +/// Parses an object from a JSON var. +template +auto read(const InputVarType& _obj) { + const auto r = Reader(); + return Parser>::read(r, _obj); +} + +/// Parses an object from JSON using reflection. +template +Result> read( + const std::string_view _json_str, const yyjson_read_flag _flag = 0) { + if (_flag & YYJSON_READ_INSITU) { + return error("YYJSON_READ_INSITU is not supported"); + } + yyjson_read_err err; + // According to yyjson's doc, it's safe castaway constness as long as + // YYJSON_READ_INSITU is not set + yyjson_doc* doc = yyjson_read_opts(const_cast(_json_str.data()), + _json_str.size(), _flag, NULL, &err); + if (!doc) { + return error("Could not parse document: " + std::string(err.msg)); + } + yyjson_val* root = yyjson_doc_get_root(doc); + const auto r = Reader(); + auto res = Parser>::read(r, InputVarType(root)); + yyjson_doc_free(doc); + return res; +} + +/// Parses an object from a stringstream. +template +auto read(std::istream& _stream, const yyjson_read_flag _flag = 0) { + const auto json_str = std::string(std::istreambuf_iterator(_stream), + std::istreambuf_iterator()); + return read(json_str, _flag); +} + +} // namespace json +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/json/save.hpp b/build-config/reflect-cpp/include/rfl/json/save.hpp new file mode 100644 index 0000000..925df88 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/json/save.hpp @@ -0,0 +1,31 @@ +#ifndef RFL_JSON_SAVE_HPP_ +#define RFL_JSON_SAVE_HPP_ + +#if __has_include() +#include +#else +#include "../thirdparty/yyjson.h" +#endif + +#include + +#include "../Result.hpp" +#include "../io/save_string.hpp" +#include "write.hpp" + +namespace rfl { +namespace json { + +template +Result save(const std::string& _fname, const auto& _obj, + const yyjson_write_flag _flag = 0) { + const auto write_func = [_flag](const auto& _obj_ref, auto& _stream) -> auto& { + return write(_obj_ref, _stream, _flag); + }; + return rfl::io::save_string(_fname, _obj, write_func); +} + +} // namespace json +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/json/schema/JSONSchema.hpp b/build-config/reflect-cpp/include/rfl/json/schema/JSONSchema.hpp new file mode 100644 index 0000000..e8ca539 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/json/schema/JSONSchema.hpp @@ -0,0 +1,25 @@ +#ifndef RFL_JSON_SCHEMA_JSONSCHEMA_HPP_ +#define RFL_JSON_SCHEMA_JSONSCHEMA_HPP_ + +#include +#include + +#include "../../Flatten.hpp" +#include "../../Literal.hpp" +#include "../../Rename.hpp" +#include "Type.hpp" + +namespace rfl::json::schema { + +template +struct JSONSchema { + Rename<"$schema", Literal<"https://json-schema.org/draft/2020-12/schema">> + schema{}; + rfl::Rename<"$comment", std::optional> comment{}; + Flatten root{}; + rfl::Rename<"$defs", std::map> definitions{}; +}; + +} // namespace rfl::json::schema + +#endif diff --git a/build-config/reflect-cpp/include/rfl/json/schema/Type.hpp b/build-config/reflect-cpp/include/rfl/json/schema/Type.hpp new file mode 100644 index 0000000..32e0dcf --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/json/schema/Type.hpp @@ -0,0 +1,153 @@ +#ifndef RFL_JSON_SCHEMA_TYPE_HPP_ +#define RFL_JSON_SCHEMA_TYPE_HPP_ + +#include +#include +#include + +#include "../../Literal.hpp" +#include "../../Object.hpp" +#include "../../Ref.hpp" +#include "../../Rename.hpp" +#include "../../Variant.hpp" + +namespace rfl::json::schema { + +/// The JSON representation of internal::schema::Type. +struct Type { + struct Boolean { + std::optional description{}; + Literal<"boolean"> type{}; + }; + + struct Integer { + Literal<"integer"> type{}; + std::optional description{}; + }; + + struct Number { + Literal<"number"> type{}; + std::optional description{}; + }; + + struct String { + Literal<"string"> type{}; + std::optional description{}; + rfl::Rename<"minLength", std::optional> minSize{}; + rfl::Rename<"maxLength", std::optional> maxSize{}; + }; + + using NumericType = rfl::Variant; + + struct AllOf { + std::optional description{}; + std::vector allOf{}; + }; + + struct AnyOf { + std::optional description{}; + std::vector anyOf{}; + }; + + struct ExclusiveMaximum { + std::optional description{}; + rfl::Variant exclusiveMaximum{}; + std::string type{}; + }; + + struct ExclusiveMinimum { + std::optional description{}; + rfl::Variant exclusiveMinimum{}; + std::string type{}; + }; + + struct FixedSizeTypedArray { + Literal<"array"> type{}; + std::optional description{}; + rfl::Ref items{}; + size_t minItems{}; + size_t maxItems{}; + }; + + struct Maximum { + std::optional description{}; + rfl::Variant maximum{}; + std::string type{}; + }; + + struct Minimum { + std::optional description{}; + rfl::Variant minimum{}; + std::string type{}; + }; + + struct Null { + Literal<"null"> type{}; + std::optional description{}; + }; + + struct Object { + Literal<"object"> type{}; + std::optional description{}; + rfl::Object properties{}; + std::vector required{}; + std::shared_ptr additionalProperties{}; + }; + + struct OneOf { + std::optional description{}; + std::vector oneOf{}; + }; + + struct Reference { + Rename<"$ref", std::optional> ref{}; + std::optional description{}; + }; + + struct Regex { + Literal<"string"> type{}; + std::optional description{}; + std::string pattern{}; + }; + + struct StringEnum { + Literal<"string"> type{}; + std::optional description{}; + rfl::Rename<"enum", std::vector> values{}; + }; + + struct StringMap { + Literal<"object"> type{}; + std::optional description{}; + rfl::Ref additionalProperties{}; + }; + + struct Tuple { + Literal<"array"> type{}; + std::optional description{}; + std::vector prefixItems{}; + bool items = false; + }; + + struct TypedArray { + Literal<"array"> type{}; + std::optional description{}; + rfl::Ref items{}; + rfl::Rename<"minItems", std::optional> minSize{}; + rfl::Rename<"maxItems", std::optional> maxSize{}; + }; + + using ReflectionType = + rfl::Variant; + + const auto& reflection() const { return value; } + + ReflectionType value; +}; + +} // namespace rfl::json::schema + +#endif diff --git a/build-config/reflect-cpp/include/rfl/json/to_schema.hpp b/build-config/reflect-cpp/include/rfl/json/to_schema.hpp new file mode 100644 index 0000000..6630e57 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/json/to_schema.hpp @@ -0,0 +1,50 @@ +#ifndef RFL_JSON_TOSCHEMA_HPP_ +#define RFL_JSON_TOSCHEMA_HPP_ + +#if __has_include() +#include +#else +#include "../thirdparty/yyjson.h" +#endif + +#include + +// #include "../Literal.hpp" +#include "../Processors.hpp" +#include "../Variant.hpp" +// #include "../parsing/schema/Type.hpp" +// #include "../parsing/schema/ValidationType.hpp" +#include "../parsing/schema/make.hpp" +#include "Reader.hpp" +#include "Writer.hpp" +#include "schema/JSONSchema.hpp" +// #include "schema/Type.hpp" +// #include "write.hpp" +#include "../common.hpp" + +namespace rfl::json { + +template +struct TypeHelper {}; + +template +struct TypeHelper> { + using JSONSchemaType = rfl::Variant...>; +}; + +RFL_API std::string to_schema_internal_schema( + const parsing::schema::Definition& internal_schema, const yyjson_write_flag, + const bool _no_required, const std::string& comment = ""); + +/// Returns the JSON schema for a class. +template +std::string to_schema(const yyjson_write_flag _flag = 0, + const std::string& comment = "") { + using P = Processors; + const auto internal_schema = parsing::schema::make(); + return to_schema_internal_schema(internal_schema, _flag, + P::default_if_missing_, comment); +} +} // namespace rfl::json + +#endif diff --git a/build-config/reflect-cpp/include/rfl/json/write.hpp b/build-config/reflect-cpp/include/rfl/json/write.hpp new file mode 100644 index 0000000..e921eb5 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/json/write.hpp @@ -0,0 +1,67 @@ +#ifndef RFL_JSON_WRITE_HPP_ +#define RFL_JSON_WRITE_HPP_ + +#include +#if __has_include() +#include +#else +#include "../thirdparty/yyjson.h" +#endif + +#include +#include +#include + +#include "../Processors.hpp" +#include "../parsing/Parent.hpp" +#include "Parser.hpp" + +namespace rfl { +namespace json { + +/// Convenient alias for the YYJSON pretty flag +inline constexpr yyjson_write_flag pretty = YYJSON_WRITE_PRETTY; + +/// Returns a JSON string. +template +std::string write(const auto& _obj, const yyjson_write_flag _flag = 0) { + using T = std::remove_cvref_t; + using ParentType = parsing::Parent; + auto w = Writer(); + Parser>::write(w, _obj, typename ParentType::Root{}); + yyjson_write_err err; + const char* json_c_str = + yyjson_mut_write_opts(w.doc(), _flag, NULL, NULL, &err); + if (!json_c_str) { + throw std::runtime_error("An error occured while writing to JSON: " + + std::string(err.msg)); + } + const auto json_str = std::string(json_c_str); + free((void*)json_c_str); + return json_str; +} + +/// Writes a JSON into an ostream. +template +std::ostream& write(const auto& _obj, std::ostream& _stream, + const yyjson_write_flag _flag = 0) { + using T = std::remove_cvref_t; + using ParentType = parsing::Parent; + auto w = Writer(); + Parser>::write(w, _obj, typename ParentType::Root{}); + yyjson_write_err err; + const char* json_c_str = + yyjson_mut_write_opts(w.doc(), _flag, NULL, NULL, &err); + if (!json_c_str) { + throw std::runtime_error("An error occured while writing to JSON: " + + std::string(err.msg)); + } + _stream << json_c_str; + free((void*)json_c_str); + return _stream; +} + +} // namespace json +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/make_from_tuple.hpp b/build-config/reflect-cpp/include/rfl/make_from_tuple.hpp new file mode 100644 index 0000000..f2872d4 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/make_from_tuple.hpp @@ -0,0 +1,25 @@ +#ifndef RFL_MAKE_FROM_TUPLE_HPP_ +#define RFL_MAKE_FROM_TUPLE_HPP_ + +#include + +#include "Tuple.hpp" +#include "internal/tuple/make_from_tuple.hpp" + +namespace rfl { + +template +auto make_from_tuple(const rfl::Tuple& _tup) { + return internal::tuple::make_from_tuple( + _tup, std::make_integer_sequence()); +} + +template +auto make_from_tuple(rfl::Tuple&& _tup) { + return internal::tuple::make_from_tuple( + std::move(_tup), std::make_integer_sequence()); +} + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/make_named_tuple.hpp b/build-config/reflect-cpp/include/rfl/make_named_tuple.hpp new file mode 100644 index 0000000..aa78ce6 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/make_named_tuple.hpp @@ -0,0 +1,30 @@ +#ifndef RFL_MAKENAMEDTUPLE_HPP_ +#define RFL_MAKENAMEDTUPLE_HPP_ + +#include + +#include "NamedTuple.hpp" + +namespace rfl { + +/// Convenience constructor that doesn't require you +/// to explitly define the field types. +template +inline auto make_named_tuple(FieldTypes&&... _args) { + return NamedTuple...>( + std::forward(_args)...); +} + +/// Convenience constructor that doesn't require you +/// to explitly define the field types. +template +inline auto make_named_tuple(const FieldTypes&... _args) { + return NamedTuple(_args...); +} + +/// Explicit overload for creating empty named tuples. +inline auto make_named_tuple() { return NamedTuple<>(); } + +} // namespace rfl + +#endif // RFL_MAKENAMEDTUPLE_HPP_ diff --git a/build-config/reflect-cpp/include/rfl/name_t.hpp b/build-config/reflect-cpp/include/rfl/name_t.hpp new file mode 100644 index 0000000..b534e9d --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/name_t.hpp @@ -0,0 +1,14 @@ +#ifndef RFL_NAME_T_HPP_ +#define RFL_NAME_T_HPP_ + +#include + +namespace rfl { + +/// Convenience class to retrieve the name of a field. +template +using name_t = typename std::remove_cvref_t::Name; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/named_tuple_t.hpp b/build-config/reflect-cpp/include/rfl/named_tuple_t.hpp new file mode 100644 index 0000000..8e31100 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/named_tuple_t.hpp @@ -0,0 +1,25 @@ +#ifndef RFL_NAMED_TUPLE_T_HPP_ +#define RFL_NAMED_TUPLE_T_HPP_ + +#include +#include +#include + +#include "NamedTuple.hpp" +#include "Processors.hpp" +#include "internal/remove_ptrs_nt.hpp" +#include "to_named_tuple.hpp" +#include "view_t.hpp" + +namespace rfl { + +/// Generates the named tuple that is equivalent to the struct T. +/// This is the result you would expect from calling to_named_tuple(my_struct). +/// All fields of the struct must be an rfl::Field. +template +using named_tuple_t = + typename internal::remove_ptrs_nt>::NamedTupleType; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/num_fields.hpp b/build-config/reflect-cpp/include/rfl/num_fields.hpp new file mode 100644 index 0000000..a65c01a --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/num_fields.hpp @@ -0,0 +1,14 @@ +#ifndef RFL_NUM_FIELDS_HPP_ +#define RFL_NUM_FIELDS_HPP_ + +#include "internal/num_fields.hpp" + +namespace rfl { + +/// Returns the number of fields fields. +template +constexpr std::size_t num_fields = internal::num_fields; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/AreReaderAndWriter.hpp b/build-config/reflect-cpp/include/rfl/parsing/AreReaderAndWriter.hpp new file mode 100644 index 0000000..5089356 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/AreReaderAndWriter.hpp @@ -0,0 +1,16 @@ +#ifndef RFL_PARSING_AREREADERANDWRITER_HPP_ +#define RFL_PARSING_AREREADERANDWRITER_HPP_ + +#include "IsReader.hpp" +#include "IsWriter.hpp" + +namespace rfl { +namespace parsing { + +template +concept AreReaderAndWriter = IsReader && IsWriter; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/ArrayReader.hpp b/build-config/reflect-cpp/include/rfl/parsing/ArrayReader.hpp new file mode 100644 index 0000000..d3b67b2 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/ArrayReader.hpp @@ -0,0 +1,86 @@ +#ifndef RFL_PARSING_ARRAYREADER_HPP_ +#define RFL_PARSING_ARRAYREADER_HPP_ + +#include +#include +#include + +#include "../Result.hpp" +#include "../internal/is_array.hpp" +#include "Parser_base.hpp" + +namespace rfl::parsing { + +template +class ArrayReader { + private: + using InputVarType = typename R::InputVarType; + static constexpr size_t size_ = _size; + + public: + ArrayReader(const R* _r, std::array* _array) + : array_(_array), num_set_(0), r_(_r) {} + + ~ArrayReader() = default; + + std::optional check_size() const { + if (num_set_ != size_) { + return Error("Expected " + std::to_string(size_) + " elements, got " + + std::to_string(num_set_) + "."); + } + return std::nullopt; + } + + size_t num_set() const { return num_set_; } + + std::optional read(const InputVarType& _var) const { + if (num_set_ == size_) { + return Error("Expected " + std::to_string(size_) + + " elements, got at least " + std::to_string(size_ + 1) + + "."); + } + auto res = + Parser, ProcessorsType>::read(*r_, _var); + if (res) { + move_to(&((*array_)[num_set_]), &(*res)); + } else { + return Error("Failed to parse element " + std::to_string(num_set_) + + ": " + res.error().what()); + } + ++num_set_; + return std::optional(); + } + + private: + template + void move_to(Target* _t, Source* _s) const { + if constexpr (std::is_const_v) { + return move_to(const_cast*>(_t), _s); + } else if constexpr (!internal::is_array_v && + !std::is_array_v) { + ::new (_t) Target(std::move(*_s)); + } else if constexpr (internal::is_array_v) { + for (size_t i = 0; i < _s->arr_.size(); ++i) { + move_to(&((*_t)[i]), &(_s->arr_[i])); + } + } else { + for (size_t i = 0; i < _s->size(); ++i) { + move_to(&((*_t)[i]), &((*_s)[i])); + } + } + } + + private: + /// The underlying array. + std::array* array_; + + /// Indicates the current field + mutable size_t num_set_; + + /// The underlying reader. + const R* r_; +}; + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/CustomParser.hpp b/build-config/reflect-cpp/include/rfl/parsing/CustomParser.hpp new file mode 100644 index 0000000..2369c11 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/CustomParser.hpp @@ -0,0 +1,57 @@ +#ifndef RFL_PARSING_CUSTOMPARSER_HPP_ +#define RFL_PARSING_CUSTOMPARSER_HPP_ + +#include + +#include "../Tuple.hpp" +#include "../internal/has_to_class_method_v.hpp" +#include "../internal/to_ptr_field_tuple.hpp" +#include "Parser.hpp" +#include "schema/Type.hpp" + +namespace rfl { +namespace parsing { + +template +struct CustomParser { + using CustomParserHelperStruct = std::remove_cvref_t; + + static Result read(const R& _r, const auto& _var) noexcept { + const auto to_class = [](auto&& _h) -> Result { + try { + if constexpr (internal::has_to_class_method_v) { + return _h.to_class(); + } else { + auto ptr_field_tuple = internal::to_ptr_field_tuple(_h); + const auto class_from_ptrs = [](auto&... _ptrs) { + return OriginalClass(std::move(*_ptrs.value_)...); + }; + return rfl::apply(class_from_ptrs, ptr_field_tuple); + } + } catch (std::exception& e) { + return error(e.what()); + } + }; + return Parser::read(_r, + _var) + .and_then(to_class); + } + + template + static auto write(const W& _w, const OriginalClass& _p, const P& _parent) { + Parser::write( + _w, HelperStruct::from_class(_p), _parent); + } + + static schema::Type to_schema( + std::map* _definitions) { + return Parser::to_schema( + _definitions); + } +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/FieldVariantParser.hpp b/build-config/reflect-cpp/include/rfl/parsing/FieldVariantParser.hpp new file mode 100644 index 0000000..0990018 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/FieldVariantParser.hpp @@ -0,0 +1,84 @@ +#ifndef RFL_PARSING_FIELD_VARIANT_PARSER_HPP_ +#define RFL_PARSING_FIELD_VARIANT_PARSER_HPP_ + +#include +#include +#include + +#include "../Result.hpp" +#include "../Tuple.hpp" +#include "../Variant.hpp" +#include "../always_false.hpp" +#include "../visit.hpp" +#include "FieldVariantReader.hpp" +#include "Parser_base.hpp" +#include "schema/Type.hpp" + +namespace rfl { +namespace parsing { + +/// To be used when all options of the variants are rfl::Field. Essentially, +/// this is an externally tagged union. +template + requires AreReaderAndWriter> +struct FieldVariantParser { + using FieldVariantType = rfl::Variant; + using ResultType = Result; + + public: + using InputObjectType = typename R::InputObjectType; + using InputVarType = typename R::InputVarType; + + static ResultType read(const R& _r, const InputVarType& _var) noexcept { + static_assert( + internal::no_duplicate_field_names>(), + "Externally tagged variants cannot have duplicate field " + "names."); + + const auto to_result = [&](const auto _obj) -> ResultType { + auto field_variant = std::optional>(); + const auto reader = + FieldVariantReader( + &_r, &field_variant); + auto err = _r.read_object(reader, _obj); + if (err) { + return error(*err); + } + if (!field_variant) { + return error( + "Could not parse: Expected the object to have " + "exactly one field, but found more than one."); + } + return std::move(*field_variant); + }; + + return _r.to_object(_var).and_then(to_result); + } + + template + static void write(const W& _w, const rfl::Variant& _v, + const P& _parent) { + static_assert( + internal::no_duplicate_field_names>(), + "Externally tagged variants cannot have duplicate field " + "names."); + + _v.visit([&](const auto& _field) { + const auto named_tuple = make_named_tuple(internal::to_ptr_field(_field)); + using NamedTupleType = std::remove_cvref_t; + Parser::write(_w, named_tuple, + _parent); + }); + } + + static schema::Type to_schema( + std::map* _definitions, + [[maybe_unused]] std::vector _types = {}) { + using VariantType = rfl::Variant...>; + return Parser::to_schema(_definitions); + } +}; +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/FieldVariantReader.hpp b/build-config/reflect-cpp/include/rfl/parsing/FieldVariantReader.hpp new file mode 100644 index 0000000..8014fb5 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/FieldVariantReader.hpp @@ -0,0 +1,87 @@ +#ifndef RFL_PARSING_FIELDVARIANTREADER_HPP_ +#define RFL_PARSING_FIELDVARIANTREADER_HPP_ + +#include +#include +#include +#include +#include + +#include "../Result.hpp" +#include "../Variant.hpp" +#include "../internal/is_array.hpp" +#include "../internal/nth_element_t.hpp" +#include "Parser_base.hpp" + +namespace rfl::parsing { + +template +class FieldVariantReader { + private: + using InputVarType = typename R::InputVarType; + using FieldVariantType = rfl::Variant; + using ResultType = Result; + + public: + FieldVariantReader(const R* _r, + std::optional>* _field_variant) + : r_(_r), field_variant_(_field_variant) {} + + ~FieldVariantReader() = default; + + void read(const std::string_view& _disc_value, + const InputVarType& _var) const noexcept { + try_matching_fields( + _disc_value, _var, + std::make_integer_sequence()); + if (!*field_variant_) { + std::stringstream stream; + stream << "Could not parse rfl::Variant, could not match field named " + "'" + << _disc_value << "'."; + *field_variant_ = error(stream.str()); + } + } + + private: + template + void try_matching_fields(const std::string_view& _disc_value, + const InputVarType& _var, + std::integer_sequence) const noexcept { + (try_one<_is>(_disc_value, _var), ...); + } + + template + void try_one(const std::string_view& _disc_value, + const InputVarType& _var) const noexcept { + using FieldType = + std::remove_cvref_t>; + using ValueType = std::remove_cvref_t; + constexpr auto key = FieldType::name_.string_view(); + if (key == _disc_value) { + const auto to_variant = [](ValueType&& _val) { + return rfl::Variant(FieldType(std::move(_val))); + }; + const auto embellish_error = [&](const Error& _e) { + std::stringstream stream; + stream << "Could not parse rfl::Variant with field '" + << std::string(_disc_value) << "': " << _e.what(); + return Error(stream.str()); + }; + *field_variant_ = Parser::read(*r_, _var) + .transform(to_variant) + .transform_error(embellish_error); + } + } + + private: + /// The underlying reader. + const R* r_; + + /// The underlying field variant. + std::optional>* field_variant_; +}; + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/IsReader.hpp b/build-config/reflect-cpp/include/rfl/parsing/IsReader.hpp new file mode 100644 index 0000000..b80416f --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/IsReader.hpp @@ -0,0 +1,91 @@ +#ifndef RFL_PARSING_ISREADER_HPP_ +#define RFL_PARSING_ISREADER_HPP_ + +#include +#include +#include +#include +#include +#include + +#include "../Result.hpp" +#include "../internal/is_basic_type.hpp" +#include "../internal/wrap_in_rfl_array_t.hpp" +#include "SupportsTaggedUnions.hpp" +#include "schemaful/IsSchemafulReader.hpp" + +namespace rfl { +namespace parsing { + +template +struct MockArrayReader { + std::optional read(typename R::InputVarType&) const { + return std::nullopt; + } +}; + +template +struct MockObjectReader { + void read(const std::string_view&, typename R::InputVarType&) const {} +}; + +template +concept IsReader = + (SupportsTaggedUnions || schemaful::IsSchemafulReader) && + requires(R r, std::string name, + std::function fct, + MockArrayReader array_reader, MockObjectReader object_reader, + typename R::InputArrayType arr, typename R::InputObjectType obj, + typename R::InputVarType var, size_t idx) { + /// Any Reader needs to define the following: + /// + /// 1) An InputArrayType, which must be an array-like data structure. + /// 2) An InputObjectType, which must contain key-value pairs. + /// 3) An InputVarType, which must be able to represent either + /// InputArrayType, InputObjectType or a basic type (bool, integral, + /// floating point, std::string). + /// 4) A static constexpr bool has_custom_constructor, that determines + /// whether the class in question as a custom constructor, which might + /// be called something like from_json_obj(...). + + /// Determines whether a variable is empty (the NULL type). + { r.is_empty(var) } -> std::same_as; + + /// Iterates through an array and writes the contained vars into + /// an array reader. + { r.read_array(array_reader, arr) } -> std::same_as>; + + /// Iterates through an object and writes the key-value pairs into an + /// object reader. This is what we use to handle structs and named tuples, + /// making it a very important function. + { + r.read_object(object_reader, obj) + } -> std::same_as>; + + /// Transforms var to a basic type (bool, integral, + /// floating point, std::string) + { + r.template to_basic_type>(var) + } -> std::same_as>>; + + /// Casts var as an InputArrayType. + { + r.to_array(var) + } -> std::same_as>; + + /// Casts var as an InputObjectType. + { + r.to_object(var) + } -> std::same_as>; + + /// Uses the custom constructor, if it has been determined that T has one + /// (see above). + { + r.template use_custom_constructor>(var) + } -> std::same_as>>; + }; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/IsWriter.hpp b/build-config/reflect-cpp/include/rfl/parsing/IsWriter.hpp new file mode 100644 index 0000000..ff224b9 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/IsWriter.hpp @@ -0,0 +1,102 @@ +#ifndef RFL_PARSING_ISWRITER_HPP_ +#define RFL_PARSING_ISWRITER_HPP_ + +#include +#include +#include + +#include "../Result.hpp" + +namespace rfl { +namespace parsing { + +template +concept IsWriter = requires(W w, T t, std::string_view name, + std::string basic_value, + typename W::OutputArrayType arr, + typename W::OutputObjectType obj, + typename W::OutputVarType var, size_t size) { + /// Sets an empty array as the root element of the document. + /// Some serialization formats require you to pass the expected size in + /// advance. If you are not working with such a format, you can ignore the + /// parameter `size`. Returns the new array for further modification. + { w.array_as_root(size) } -> std::same_as; + + /// Sets an empty object as the root element of the document. + /// Some serialization formats require you to pass the expected size in + /// advance. If you are not working with such a format, you can ignore the + /// parameter `size`. + /// Returns the new object for further modification. + { w.object_as_root(size) } -> std::same_as; + + /// Sets a null as the root element of the document. Returns OutputVarType + /// containing the null value. + { w.null_as_root() } -> std::same_as; + + /// Sets a basic value (bool, numeric, string) as the root element of the + /// document. Returns an OutputVarType containing the new value. + { w.value_as_root(basic_value) } -> std::same_as; + + /// Adds an empty array to an existing array. Returns the new + /// array for further modification. + { + w.add_array_to_array(size, &arr) + } -> std::same_as; + + /// Adds an empty object to an existing array. Returns the new + /// object for further modification. + { + w.add_object_to_array(size, &arr) + } -> std::same_as; + + /// Adds an empty array to an existing object. The key or name of the field is + /// signified by `name`. Returns the new array for further modification. + { + w.add_array_to_object(name, size, &obj) + } -> std::same_as; + + /// Adds an empty object to an existing object. The key or name of the field + /// is signified by `name`. Returns the new object for further modification. + { + w.add_object_to_object(name, size, &obj) + } -> std::same_as; + + /// Adds a basic value (bool, numeric, string) to an array. Returns an + /// OutputVarType containing the new value. + { + w.add_value_to_array(basic_value, &arr) + } -> std::same_as; + + /// Adds a basic value (bool, numeric, string) to an existing object. The key + /// or name of the field is signified by `name`. Returns an + /// OutputVarType containing the new value. + { + w.add_value_to_object(name, basic_value, &obj) + } -> std::same_as; + + /// Adds a null value to an array. Returns an + /// OutputVarType containing the null value. + { w.add_null_to_array(&arr) } -> std::same_as; + + /// Adds a null value to an existing object. The key + /// or name of the field is signified by `name`. Returns an + /// OutputVarType containing the null value. + { + w.add_null_to_object(name, &obj) + } -> std::same_as; + + /// Signifies to the writer that we do not want to add any further elements to + /// this array. Some serialization formats require this. If you are working + /// with a serialization format that doesn't, just leave the function empty. + { w.end_array(&arr) } -> std::same_as; + + /// Signifies to the writer that we do not want to add any further elements to + /// this object. Some serialization formats require this. If you are working + /// with a serialization format that doesn't, just leave the function empty. + { w.end_object(&obj) } -> std::same_as; +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/MapParser.hpp b/build-config/reflect-cpp/include/rfl/parsing/MapParser.hpp new file mode 100644 index 0000000..03432c9 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/MapParser.hpp @@ -0,0 +1,162 @@ +#ifndef RFL_PARSING_MAPPARSER_HPP_ +#define RFL_PARSING_MAPPARSER_HPP_ + +#include +#include +#include + +#include "../Ref.hpp" +#include "../Result.hpp" +#include "../always_false.hpp" +#include "MapReader.hpp" +#include "Parent.hpp" +#include "Parser_base.hpp" +#include "schema/Type.hpp" +#include "schemaful/IsSchemafulReader.hpp" +#include "schemaful/IsSchemafulWriter.hpp" +#include "to_single_error_message.hpp" + +namespace rfl { +namespace parsing { + +template + requires AreReaderAndWriter +struct MapParser { + public: + using InputObjectType = typename R::InputObjectType; + using InputVarType = typename R::InputVarType; + + using KeyType = std::remove_cvref_t; + using ValueType = + std::remove_cvref_t; + + using ParentType = Parent; + + static Result read(const R& _r, const InputVarType& _var) noexcept { + const auto to_map = [&](auto obj) -> Result { + return make_map(_r, obj); + }; + if constexpr (schemaful::IsSchemafulReader) { + return _r.to_map(_var).and_then(to_map); + } else { + return _r.to_object(_var).and_then(to_map); + } + } + + template + static void write(const W& _w, const MapType& _m, const P& _parent) { + if constexpr (schemaful::IsSchemafulWriter) { + write_map(_w, _m, _parent); + } else { + write_object(_w, _m, _parent); + } + } + + static schema::Type to_schema( + std::map* _definitions) { + return schema::Type{schema::Type::StringMap{Ref::make( + Parser::to_schema(_definitions))}}; + } + + private: + static Result make_map(const R& _r, const auto& _obj_or_map) { + MapType map; + std::vector errors; + const auto map_reader = + MapReader(&_r, &map, &errors); + if constexpr (schemaful::IsSchemafulReader) { + const auto err = _r.read_map(map_reader, _obj_or_map); + if (err) { + return error(*err); + } + } else { + const auto err = _r.read_object(map_reader, _obj_or_map); + if (err) { + return error(*err); + } + } + if (errors.size() != 0) { + return error(to_single_error_message(errors)); + } + return map; + } + + template + static void write_map(const W& _w, const MapType& _m, const P& _parent) { + auto m = ParentType::add_map(_w, _m.size(), _parent); + + using ParentMapType = + typename ParentType::template Map; + + for (const auto& [k, v] : _m) { + if constexpr (internal::has_reflection_type_v) { + using ReflT = typename KeyType::ReflectionType; + + if constexpr (std::is_integral_v || + std::is_floating_point_v) { + const auto name = std::to_string(k.reflection()); + const auto new_parent = ParentMapType{name, &m}; + Parser, ProcessorsType>::write( + _w, v, new_parent); + } else { + const auto name = k.reflection(); + const auto new_parent = ParentMapType{name, &m}; + Parser, ProcessorsType>::write( + _w, v, new_parent); + } + + } else if constexpr (std::is_integral_v || + std::is_floating_point_v) { + const auto name = std::to_string(k); + const auto new_parent = ParentMapType{name, &m}; + Parser, ProcessorsType>::write( + _w, v, new_parent); + } else { + const auto new_parent = ParentMapType{k, &m}; + Parser, ProcessorsType>::write( + _w, v, new_parent); + } + } + _w.end_map(&m); + } + + template + static void write_object(const W& _w, const MapType& _m, const P& _parent) { + auto obj = ParentType::add_object(_w, _m.size(), _parent); + for (const auto& [k, v] : _m) { + if constexpr (internal::has_reflection_type_v) { + using ReflT = typename KeyType::ReflectionType; + + if constexpr (std::is_integral_v || + std::is_floating_point_v) { + const auto name = std::to_string(k.reflection()); + const auto new_parent = typename ParentType::Object{name, &obj}; + Parser, ProcessorsType>::write( + _w, v, new_parent); + } else { + const auto name = k.reflection(); + const auto new_parent = typename ParentType::Object{name, &obj}; + Parser, ProcessorsType>::write( + _w, v, new_parent); + } + + } else if constexpr (std::is_integral_v || + std::is_floating_point_v) { + const auto name = std::to_string(k); + const auto new_parent = typename ParentType::Object{name, &obj}; + Parser, ProcessorsType>::write( + _w, v, new_parent); + } else { + const auto new_parent = typename ParentType::Object{k, &obj}; + Parser, ProcessorsType>::write( + _w, v, new_parent); + } + } + _w.end_object(&obj); + } +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/MapReader.hpp b/build-config/reflect-cpp/include/rfl/parsing/MapReader.hpp new file mode 100644 index 0000000..6e932a6 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/MapReader.hpp @@ -0,0 +1,117 @@ +#ifndef RFL_PARSING_MAPREADER_HPP_ +#define RFL_PARSING_MAPREADER_HPP_ + +#include +#include +#include +#include +#include + +#include "../Result.hpp" +#include "../always_false.hpp" +#include "../internal/has_reflection_type_v.hpp" +#include "Parser_base.hpp" + +namespace rfl::parsing { + +template +class MapReader { + private: + using InputVarType = typename R::InputVarType; + using KeyType = std::remove_cvref_t; + using ValueType = + std::remove_cvref_t; + + public: + MapReader(const R* _r, MapType* _map, std::vector* _errors) + : r_(_r), map_(_map), errors_(_errors) {} + + ~MapReader() = default; + + void read(const std::string_view& _name, + const InputVarType& _var) const noexcept { + auto res = get_pair(_name, _var); + if (res) { + map_->emplace(std::move(*res)); + } else { + errors_->push_back(Error("Failed to parse field '" + std::string(_name) + + "': " + res.error().what())); + } + } + + private: + template + Result key_to_numeric(auto& _pair) const noexcept { + try { + if constexpr (std::is_integral_v && std::is_signed_v) { + return static_cast(std::stoll(_pair.first)); + } else if constexpr (std::is_integral_v && std::is_unsigned_v) { + return static_cast(std::stoull(_pair.first)); + } else if constexpr (std::is_floating_point_v) { + return static_cast(std::stod(_pair.first)); + } else { + static_assert(always_false_v, "Unsupported type"); + } + } catch (std::exception& e) { + return error(e.what()); + } + } + + Result> make_key(auto&& _pair) const noexcept { + static_assert(std::is_rvalue_reference_v, + "Expected an rvalue"); + const auto to_pair = + [&](auto&& _key) -> Result> { + try { + using K = decltype(_key); + return std::make_pair(KeyType(std::forward(_key)), + std::move(_pair.second)); + } catch (std::exception& e) { + return error(e.what()); + } + }; + + if constexpr (std::is_integral_v || + std::is_floating_point_v) { + return key_to_numeric(_pair).and_then(to_pair); + + } else if constexpr (internal::has_reflection_type_v) { + using ReflT = typename KeyType::ReflectionType; + + if constexpr (std::is_integral_v || + std::is_floating_point_v) { + return key_to_numeric(_pair).and_then(to_pair); + } else { + return to_pair(std::move(_pair.first)); + } + + } else { + return std::move(_pair); + } + } + + Result> get_pair( + const std::string_view& _name, const InputVarType& _var) const noexcept { + const auto to_pair = [&](ValueType&& _val) { + auto pair = std::make_pair(std::string(_name), std::move(_val)); + return make_key(std::move(pair)); + }; + return Parser, ProcessorsType>::read( + *r_, _var) + .and_then(to_pair); + } + + private: + /// The underlying reader. + const R* r_; + + /// The underlying map. + MapType* map_; + + /// Collects any errors we may have come across. + std::vector* errors_; +}; + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/NamedTupleParser.hpp b/build-config/reflect-cpp/include/rfl/parsing/NamedTupleParser.hpp new file mode 100644 index 0000000..7f423e0 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/NamedTupleParser.hpp @@ -0,0 +1,361 @@ +#ifndef RFL_PARSING_NAMEDTUPLEPARSER_HPP_ +#define RFL_PARSING_NAMEDTUPLEPARSER_HPP_ + +#include +#include +#include +#include +#include + +#include "../NamedTuple.hpp" +#include "../Result.hpp" +#include "../always_false.hpp" +#include "../internal/has_default_val_v.hpp" +#include "../internal/is_array.hpp" +#include "../internal/is_attribute.hpp" +#include "../internal/is_basic_type.hpp" +#include "../internal/is_default_val_v.hpp" +#include "../internal/is_extra_fields.hpp" +#include "../internal/is_skip.hpp" +#include "../internal/no_duplicate_field_names.hpp" +#include "../internal/nth_element_t.hpp" +#include "../internal/ptr_cast.hpp" +#include "../to_view.hpp" +#include "AreReaderAndWriter.hpp" +#include "Parent.hpp" +#include "Parser_base.hpp" +#include "ViewReader.hpp" +#include "ViewReaderWithDefault.hpp" +#include "ViewReaderWithDefaultAndStrippedFieldNames.hpp" +#include "ViewReaderWithStrippedFieldNames.hpp" +#include "call_destructors_where_necessary.hpp" +#include "is_empty.hpp" +#include "is_required.hpp" +#include "schema/Type.hpp" +#include "to_single_error_message.hpp" + +namespace rfl { +namespace parsing { + +template + requires AreReaderAndWriter> +struct NamedTupleParser { + using InputVarType = typename R::InputVarType; + + using ParentType = Parent; + + using NamedTupleType = NamedTuple; + + using ViewReaderType = std::conditional_t< + _no_field_names, + ViewReaderWithStrippedFieldNames, + ViewReader>; + + using ViewReaderWithDefaultType = std::conditional_t< + _no_field_names, + ViewReaderWithDefaultAndStrippedFieldNames, + ViewReaderWithDefault>; + + using InputObjectOrArrayType = + std::conditional_t<_no_field_names, typename R::InputArrayType, + typename R::InputObjectType>; + using OutputObjectOrArrayType = + std::conditional_t<_no_field_names, typename W::OutputArrayType, + typename W::OutputObjectType>; + + using SchemaType = std::conditional_t<_no_field_names, schema::Type::Tuple, + schema::Type::Object>; + + static constexpr size_t size_ = NamedTupleType::size(); + + static_assert(NamedTupleType::pos_extra_fields() == -1 || !_no_field_names, + "You cannot use the rfl::NoFieldNames processor if you are " + "including rfl::ExtraFields."); + + public: + /// The way this works is that we allocate space on the stack in this size of + /// the named tuple in which we then write the individual fields using + /// views and placement new. This is how we deal with the fact that some + /// fields might not be default-constructible. + static Result> read( + const R& _r, const InputVarType& _var) noexcept { + static_assert( + internal::no_duplicate_field_names()); + alignas(NamedTuple) unsigned char + buf[sizeof(NamedTuple)]; + auto ptr = internal::ptr_cast*>(&buf); + auto view = rfl::to_view(*ptr); + using ViewType = std::remove_cvref_t; + const auto [set, err] = + Parser::read_view(_r, _var, &view); + if (err) [[unlikely]] { + call_destructors_where_necessary(set, &view); + return error(*err); + } + auto res = Result>(std::move(*ptr)); + call_destructors_where_necessary(set, &view); + return res; + } + + /// Reads the data into a view assuming no default values. + static std::pair, + std::optional> + read_view(const R& _r, const InputVarType& _var, + NamedTuple* _view) noexcept { + static_assert( + internal::no_duplicate_field_names()); + if constexpr (_no_field_names) { + auto arr = _r.to_array(_var); + if (!arr) [[unlikely]] { + auto set = std::array{}; + return std::make_pair(set, arr.error()); + } + return read_object_or_array(_r, *arr, _view); + } else { + auto obj = _r.to_object(_var); + if (!obj) [[unlikely]] { + auto set = std::array{}; + return std::make_pair(set, obj.error()); + } + return read_object_or_array(_r, *obj, _view); + } + } + + /// Reads the data into a view assuming default values. + static std::optional read_view_with_default( + const R& _r, const InputVarType& _var, + NamedTuple* _view) noexcept { + static_assert( + internal::no_duplicate_field_names()); + if constexpr (_no_field_names) { + auto arr = _r.to_array(_var); + if (!arr) [[unlikely]] { + return arr.error(); + } + return read_object_or_array_with_default(_r, *arr, _view); + } else { + auto obj = _r.to_object(_var); + if (!obj) [[unlikely]] { + return obj.error(); + } + return read_object_or_array_with_default(_r, *obj, _view); + } + } + + template + static void write(const W& _w, const NamedTuple& _tup, + const P& _parent) { + if constexpr (_no_field_names) { + auto arr = ParentType::add_array(_w, _tup.num_fields(), _parent); + build_object(_w, _tup, &arr, std::make_integer_sequence()); + _w.end_array(&arr); + } else { + auto obj = ParentType::add_object(_w, _tup.num_fields(), _parent); + build_object(_w, _tup, &obj, std::make_integer_sequence()); + _w.end_object(&obj); + } + } + + static schema::Type to_schema( + std::map* _definitions) noexcept { + SchemaType schema; + build_schema(_definitions, &schema, + std::make_integer_sequence()); + return schema::Type{schema}; + } + + private: + template + static void add_field_to_object(const W& _w, + const NamedTuple& _tup, + OutputObjectOrArrayType* _ptr) { + using FieldType = internal::nth_element_t<_i, FieldTypes...>; + using ValueType = std::remove_cvref_t; + const auto value = rfl::get<_i>(_tup); + if constexpr (internal::is_extra_fields_v) { + for (const auto& [k, v] : *value) { + const auto new_parent = make_parent(k, _ptr); + Parser, ProcessorsType>::write( + _w, v, new_parent); + } + } else if constexpr (!_all_required && !_no_field_names && + !is_required()) { + constexpr auto name = FieldType::name_.string_view(); + const auto new_parent = make_parent(name, _ptr); + if (!is_empty(value)) { + if constexpr (internal::is_attribute_v) { + Parser::write( + _w, value, new_parent.as_attribute()); + } else { + Parser::write(_w, value, new_parent); + } + } + } else { + constexpr auto name = FieldType::name_.string_view(); + const auto new_parent = make_parent(name, _ptr); + if constexpr (internal::is_attribute_v) { + Parser::write( + _w, value, new_parent.as_attribute()); + } else { + Parser::write(_w, value, new_parent); + } + } + } + + template + static void add_field_to_schema( + std::map* _definitions, + SchemaType* _schema) noexcept { + using F = internal::nth_element_t<_i, FieldTypes...>; + using U = std::remove_cvref_t; + if constexpr (!internal::is_skip_v && !internal::is_extra_fields_v) { + auto s = Parser::to_schema(_definitions); + if constexpr (_no_field_names) { + _schema->types_.emplace_back(std::move(s)); + } else { + _schema->types_[std::string(F::name())] = std::move(s); + } + } + }; + + template + static void build_object(const W& _w, const NamedTuple& _tup, + OutputObjectOrArrayType* _ptr, + std::integer_sequence) { + (add_field_to_object<_is>(_w, _tup, _ptr), ...); + } + + template + static void build_schema(std::map* _definitions, + SchemaType* _schema, + std::integer_sequence) noexcept { + (add_field_to_schema<_is>(_definitions, _schema), ...); + + if constexpr (NamedTupleType::pos_extra_fields() != -1) { + using F = internal::nth_element_t; + using ExtraFieldsType = std::remove_cvref_t; + using U = std::remove_cvref_t; + _schema->additional_properties_ = std::make_shared( + Parser::to_schema(_definitions)); + } + } + + /// Generates error messages for when fields are missing. + template + static void handle_one_missing_field(const std::array& _found, + const NamedTupleType& _view, + std::array* _set, + std::vector* _errors) noexcept { + using FieldType = internal::nth_element_t<_i, FieldTypes...>; + using ValueType = std::remove_reference_t< + std::remove_pointer_t>; + + if (!std::get<_i>(_found)) { + constexpr bool is_required_field = + !internal::is_default_val_v && + !internal::is_extra_fields_v && + (_all_required || is_required()); + + if constexpr (is_required_field) { + constexpr auto current_name = + internal::nth_element_t<_i, FieldTypes...>::name(); + std::stringstream stream; + stream << "Field named '" << std::string(current_name) + << "' not found."; + _errors->emplace_back(Error(stream.str())); + + } else if constexpr (!internal::has_default_val_v) { + if constexpr (!std::is_const_v) { + ::new (rfl::get<_i>(_view)) ValueType(); + } else { + using NonConstT = std::remove_const_t; + ::new (const_cast(rfl::get<_i>(_view))) NonConstT(); + } + std::get<_i>(*_set) = true; + } + } + } + + /// Generates error messages for when fields are missing. + template + static void handle_missing_fields( + const std::array& _found, const NamedTupleType& _view, + std::array* _set, std::vector* _errors, + std::integer_sequence) noexcept { + (handle_one_missing_field<_is>(_found, _view, _set, _errors), ...); + } + + static auto make_parent(const std::string_view& _name, + OutputObjectOrArrayType* _ptr) { + if constexpr (_no_field_names) { + return typename ParentType::Array{_ptr}; + } else { + return typename ParentType::Object{_name, _ptr}; + } + } + + static std::pair, + std::optional> + read_object_or_array(const R& _r, const InputObjectOrArrayType& _obj_or_arr, + NamedTupleType* _view) noexcept { + auto found = std::array(); + found.fill(false); + auto set = std::array(); + set.fill(false); + std::vector errors; + const auto reader = ViewReaderType(&_r, _view, &found, &set, &errors); + if constexpr (_no_field_names) { + const auto err = _r.read_array(reader, _obj_or_arr); + if (err) { + return std::make_pair(set, err); + } + } else { + const auto err = _r.read_object(reader, _obj_or_arr); + if (err) { + return std::make_pair(set, err); + } + } + handle_missing_fields(found, *_view, &set, &errors, + std::make_integer_sequence()); + if (errors.size() != 0) { + return std::make_pair(set, to_single_error_message(errors)); + } + return std::make_pair(set, std::optional()); + } + + static std::optional read_object_or_array_with_default( + const R& _r, const InputObjectOrArrayType& _obj_or_arr, + NamedTupleType* _view) noexcept { + std::vector errors; + const auto reader = ViewReaderWithDefaultType(&_r, _view, &errors); + if constexpr (_no_field_names) { + const auto err = _r.read_array(reader, _obj_or_arr); + if (err) { + return err; + } + } else { + const auto err = _r.read_object(reader, _obj_or_arr); + if (err) { + return err; + } + } + if constexpr (internal::has_default_val_v && + !ProcessorsType::default_if_missing_) { + handle_missing_fields(reader.found(), *_view, nullptr, &errors, + std::make_integer_sequence()); + } + if (errors.size() != 0) { + return to_single_error_message(errors); + } + + return std::nullopt; + } +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parent.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parent.hpp new file mode 100644 index 0000000..c8d73be --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parent.hpp @@ -0,0 +1,221 @@ +#ifndef RFL_PARSING_PARENT_HPP_ +#define RFL_PARSING_PARENT_HPP_ + +#include +#include + +#include "../always_false.hpp" +#include "schemaful/IsSchemafulWriter.hpp" +#include "supports_attributes.hpp" + +namespace rfl::parsing { + +template +struct Parent { + using OutputArrayType = typename W::OutputArrayType; + using OutputObjectType = typename W::OutputObjectType; + using OutputVarType = typename W::OutputVarType; + + struct Array { + OutputArrayType* arr_; + }; + + // For schemaful formats only. + template + struct Map { + std::string_view name_; + T* map_; + }; + + struct Object { + std::string_view name_; + OutputObjectType* obj_; + bool is_attribute_ = false; + Object as_attribute() const { return Object{name_, obj_, true}; } + }; + + // For schemaful formats only. + template + struct Union { + size_t index_; + T* union_; + }; + + struct Root {}; + + template + static OutputArrayType add_array(const W& _w, const size_t _size, + const ParentType& _parent) { + using Type = std::remove_cvref_t; + if constexpr (std::is_same()) { + return _w.add_array_to_array(_size, _parent.arr_); + + } else if constexpr (std::is_same()) { + return _w.add_array_to_object(_parent.name_, _size, _parent.obj_); + + } else if constexpr (std::is_same()) { + return _w.array_as_root(_size); + + } else if constexpr (schemaful::IsSchemafulWriter) { + if constexpr (std::is_same>()) { + return _w.add_array_to_map(_parent.name_, _size, _parent.map_); + } else if constexpr (std::is_same>()) { + return _w.add_array_to_union(_parent.index_, _size, _parent.union_); + } else { + static_assert(always_false_v, "Unsupported option."); + } + + } else { + static_assert(always_false_v, "Unsupported option."); + } + } + + // For schemaful formats only. + template + static auto add_map(const W& _w, const size_t _size, + const ParentType& _parent) { + using Type = std::remove_cvref_t; + if constexpr (std::is_same()) { + return _w.add_map_to_array(_size, _parent.arr_); + + } else if constexpr (std::is_same>()) { + return _w.add_map_to_map(_parent.name_, _size, _parent.map_); + + } else if constexpr (std::is_same()) { + return _w.add_map_to_object(_parent.name_, _size, _parent.obj_); + + } else if constexpr (std::is_same>()) { + return _w.add_map_to_union(_parent.index_, _size, _parent.union_); + + } else if constexpr (std::is_same()) { + return _w.map_as_root(_size); + + } else { + static_assert(always_false_v, "Unsupported option."); + } + } + + template + static OutputObjectType add_object(const W& _w, const size_t _size, + const ParentType& _parent) { + using Type = std::remove_cvref_t; + if constexpr (std::is_same()) { + return _w.add_object_to_array(_size, _parent.arr_); + + } else if constexpr (std::is_same()) { + return _w.add_object_to_object(_parent.name_, _size, _parent.obj_); + + } else if constexpr (std::is_same()) { + return _w.object_as_root(_size); + + } else if constexpr (schemaful::IsSchemafulWriter) { + if constexpr (std::is_same>()) { + return _w.add_object_to_map(_parent.name_, _size, _parent.map_); + } else if constexpr (std::is_same>()) { + return _w.add_object_to_union(_parent.index_, _size, _parent.union_); + } else { + static_assert(always_false_v, "Unsupported option."); + } + + } else { + static_assert(always_false_v, "Unsupported option."); + } + } + + template + static OutputVarType add_null(const W& _w, const ParentType& _parent) { + using Type = std::remove_cvref_t; + if constexpr (std::is_same()) { + return _w.add_null_to_array(_parent.arr_); + + } else if constexpr (std::is_same()) { + if constexpr (supports_attributes>) { + return _w.add_null_to_object(_parent.name_, _parent.obj_, + _parent.is_attribute_); + } else { + return _w.add_null_to_object(_parent.name_, _parent.obj_); + } + + } else if constexpr (std::is_same()) { + return _w.null_as_root(); + + } else if constexpr (schemaful::IsSchemafulWriter) { + if constexpr (std::is_same>()) { + return _w.add_null_to_map(_parent.name_, _parent.map_); + } else if constexpr (std::is_same>()) { + return _w.add_null_to_union(_parent.index_, _parent.union_); + } else { + static_assert(always_false_v, "Unsupported option."); + } + + } else { + static_assert(always_false_v, "Unsupported option."); + } + } + + // For schemaful formats only. + template + static auto add_union(const W& _w, const ParentType& _parent) { + using Type = std::remove_cvref_t; + if constexpr (std::is_same()) { + return _w.add_union_to_array(_parent.arr_); + + } else if constexpr (std::is_same>()) { + return _w.add_union_to_map(_parent.name_, _parent.map_); + + } else if constexpr (std::is_same()) { + return _w.add_union_to_object(_parent.name_, _parent.obj_); + + } else if constexpr (std::is_same>()) { + return _w.add_union_to_union(_parent.index_, _parent.union_); + + } else if constexpr (std::is_same()) { + return _w.union_as_root(); + + } else { + static_assert(always_false_v, "Unsupported option."); + } + } + + template + static OutputVarType add_value(const W& _w, const T& _var, + const ParentType& _parent) { + using Type = std::remove_cvref_t; + if constexpr (std::is_same()) { + return _w.add_value_to_array(_var, _parent.arr_); + + } else if constexpr (std::is_same()) { + if constexpr (supports_attributes>) { + return _w.add_value_to_object(_parent.name_, _var, _parent.obj_, + _parent.is_attribute_); + } else { + return _w.add_value_to_object(_parent.name_, _var, _parent.obj_); + } + + } else if constexpr (std::is_same()) { + return _w.value_as_root(_var); + + } else if constexpr (schemaful::IsSchemafulWriter) { + if constexpr (std::is_same>()) { + return _w.add_value_to_map(_parent.name_, _var, _parent.map_); + } else if constexpr (std::is_same>()) { + return _w.add_value_to_union(_parent.index_, _var, _parent.union_); + } else { + static_assert(always_false_v, "Unsupported option."); + } + + } else { + static_assert(always_false_v, "Unsupported option."); + } + } +}; + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser.hpp new file mode 100644 index 0000000..0f7ef39 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser.hpp @@ -0,0 +1,37 @@ +#ifndef RFL_PARSING_PARSER_HPP_ +#define RFL_PARSING_PARSER_HPP_ + +#include "Parser_array.hpp" +#include "Parser_base.hpp" +#include "Parser_box.hpp" +#include "Parser_bytestring.hpp" +#include "Parser_c_array.hpp" +#include "Parser_default.hpp" +#include "Parser_default_val.hpp" +#include "Parser_duration.hpp" +#include "Parser_filepath.hpp" +#include "Parser_map_like.hpp" +#include "Parser_named_tuple.hpp" +#include "Parser_optional.hpp" +#include "Parser_pair.hpp" +#include "Parser_ptr.hpp" +#include "Parser_ref.hpp" +#include "Parser_reference_wrapper.hpp" +#include "Parser_rename.hpp" +#include "Parser_result.hpp" +#include "Parser_rfl_array.hpp" +#include "Parser_rfl_tuple.hpp" +#include "Parser_rfl_variant.hpp" +#include "Parser_shared_ptr.hpp" +#include "Parser_skip.hpp" +#include "Parser_span.hpp" +#include "Parser_string_view.hpp" +#include "Parser_tagged_union.hpp" +#include "Parser_tuple.hpp" +#include "Parser_unique_ptr.hpp" +#include "Parser_variant.hpp" +#include "Parser_vector_like.hpp" +#include "Parser_vectorstring.hpp" +#include "Parser_wstring.hpp" + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_array.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_array.hpp new file mode 100644 index 0000000..8b5bb4f --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_array.hpp @@ -0,0 +1,81 @@ +#ifndef RFL_PARSING_PARSER_ARRAY_HPP_ +#define RFL_PARSING_PARSER_ARRAY_HPP_ + +#include +#include +#include + +#include "../Ref.hpp" +#include "../Result.hpp" +#include "../always_false.hpp" +#include "../internal/ptr_cast.hpp" +#include "ArrayReader.hpp" +#include "Parent.hpp" +#include "Parser_base.hpp" +#include "call_destructors_on_array_where_necessary.hpp" +#include "schema/Type.hpp" + +namespace rfl { +namespace parsing { +template + requires AreReaderAndWriter> +struct Parser, ProcessorsType> { + public: + using InputArrayType = typename R::InputArrayType; + using InputVarType = typename R::InputVarType; + + using ParentType = Parent; + + static Result> read(const R& _r, + const InputVarType& _var) noexcept { + const auto parse = + [&](const InputArrayType& _arr) -> Result> { + alignas( + std::array) unsigned char buf[sizeof(std::array)]; + auto ptr = internal::ptr_cast*>(&buf); + const auto array_reader = + ArrayReader(&_r, ptr); + auto err = _r.read_array(array_reader, _arr); + if (err) { + call_destructors_on_array_where_necessary(array_reader.num_set(), ptr); + return error(*err); + } + err = array_reader.check_size(); + if (err) { + call_destructors_on_array_where_necessary(array_reader.num_set(), ptr); + return error(*err); + } + auto result = Result>(std::move(*ptr)); + call_destructors_on_array_where_necessary(array_reader.num_set(), ptr); + return result; + }; + + return _r.to_array(_var).and_then(parse); + } + + template + static void write(const W& _w, const std::array& _arr, + const P& _parent) { + auto arr = ParentType::add_array(_w, _size, _parent); + const auto new_parent = typename ParentType::Array{&arr}; + for (const auto& e : _arr) { + Parser, ProcessorsType>::write(_w, e, + new_parent); + } + _w.end_array(&arr); + } + + static schema::Type to_schema( + std::map* _definitions) { + using U = std::remove_cvref_t; + return schema::Type{schema::Type::FixedSizeTypedArray{ + .size_ = _size, + .type_ = Ref::make( + Parser::to_schema(_definitions))}}; + } +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_base.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_base.hpp new file mode 100644 index 0000000..abc0d0b --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_base.hpp @@ -0,0 +1,16 @@ +#ifndef RFL_PARSING_PARSER_BASE_HPP_ +#define RFL_PARSING_PARSER_BASE_HPP_ + +#include "AreReaderAndWriter.hpp" + +namespace rfl { +namespace parsing { + +template +requires AreReaderAndWriter +struct Parser; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_box.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_box.hpp new file mode 100644 index 0000000..56bf25a --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_box.hpp @@ -0,0 +1,45 @@ +#ifndef RFL_PARSING_PARSER_BOX_HPP_ +#define RFL_PARSING_PARSER_BOX_HPP_ + +#include +#include + +#include "../Box.hpp" +#include "../Result.hpp" +#include "Parser_base.hpp" +#include "schema/Type.hpp" + +namespace rfl { +namespace parsing { + +template + requires AreReaderAndWriter> +struct Parser, ProcessorsType> { + using InputVarType = typename R::InputVarType; + + static Result> read(const R& _r, + const InputVarType& _var) noexcept { + const auto to_box = [](auto&& _t) { + return Box::make(std::move(_t)); + }; + return Parser, ProcessorsType>::read(_r, _var) + .transform(to_box); + } + + template + static void write(const W& _w, const Box& _box, const P& _parent) { + Parser, ProcessorsType>::write(_w, *_box, + _parent); + } + + static schema::Type to_schema( + std::map* _definitions) { + return Parser, ProcessorsType>::to_schema( + _definitions); + } +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_bytestring.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_bytestring.hpp new file mode 100644 index 0000000..f932cb8 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_bytestring.hpp @@ -0,0 +1,38 @@ +#ifndef RFL_PARSING_PARSER_BYTESTRING_HPP_ +#define RFL_PARSING_PARSER_BYTESTRING_HPP_ + +#include + +#include "../Bytestring.hpp" +#include "../Result.hpp" +#include "Parent.hpp" +#include "Parser_base.hpp" +#include "schema/Type.hpp" + +namespace rfl::parsing { + +template + requires AreReaderAndWriter +struct Parser { + using InputVarType = typename R::InputVarType; + using ParentType = Parent; + + static Result read(const R& _r, + const InputVarType& _var) noexcept { + return _r.template to_basic_type(_var); + } + + template + static void write(const W& _w, const Bytestring& _b, const P& _parent) { + ParentType::add_value(_w, _b, _parent); + } + + static schema::Type to_schema( + [[maybe_unused]] std::map* _definitions) { + return schema::Type{schema::Type::Bytestring{}}; + } +}; + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_c_array.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_c_array.hpp new file mode 100644 index 0000000..58447a0 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_c_array.hpp @@ -0,0 +1,57 @@ +#ifndef RFL_PARSING_PARSER_C_ARRAY_HPP_ +#define RFL_PARSING_PARSER_C_ARRAY_HPP_ + +#include +#include + +#include "../Result.hpp" +#include "../always_false.hpp" +#include "../internal/Array.hpp" +#include "../internal/to_std_array.hpp" +#include "Parent.hpp" +#include "Parser_array.hpp" +#include "Parser_base.hpp" +#include "schema/Type.hpp" + +namespace rfl { +namespace parsing { + +template + requires AreReaderAndWriter +struct Parser { + public: + using InputArrayType = typename R::InputArrayType; + using InputVarType = typename R::InputVarType; + + using ParentType = Parent; + using CArray = T[_size]; + + static Result> read( + const R& _r, const InputVarType& _var) noexcept { + using StdArray = internal::to_std_array_t; + return Parser::read(_r, _var); + } + + template + static void write(const W& _w, const CArray& _arr, const P& _parent) { + auto arr = ParentType::add_array(_w, _size, _parent); + const auto new_parent = typename ParentType::Array{&arr}; + for (const auto& e : _arr) { + Parser, ProcessorsType>::write(_w, e, + new_parent); + } + _w.end_array(&arr); + } + + static schema::Type to_schema( + std::map* _definitions) { + using StdArray = internal::to_std_array_t; + return Parser, + ProcessorsType>::to_schema(_definitions); + } +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_default.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_default.hpp new file mode 100644 index 0000000..ced5e8d --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_default.hpp @@ -0,0 +1,321 @@ +#ifndef RFL_PARSING_PARSER_DEFAULT_HPP_ +#define RFL_PARSING_PARSER_DEFAULT_HPP_ + +#include +#include + +#include "../Result.hpp" +#include "../always_false.hpp" +#include "../enums.hpp" +#include "../from_named_tuple.hpp" +#include "../internal/has_default_val_v.hpp" +#include "../internal/has_reflection_method_v.hpp" +#include "../internal/has_reflection_type_v.hpp" +#include "../internal/has_reflector.hpp" +#include "../internal/is_basic_type.hpp" +#include "../internal/is_description.hpp" +#include "../internal/is_literal.hpp" +#include "../internal/is_underlying_enums_v.hpp" +#include "../internal/is_validator.hpp" +#include "../internal/processed_t.hpp" +#include "../internal/ptr_cast.hpp" +#include "../internal/to_ptr_named_tuple.hpp" +#include "../thirdparty/enchantum/enchantum.hpp" +#include "../to_view.hpp" +#include "AreReaderAndWriter.hpp" +#include "Parent.hpp" +#include "Parser_base.hpp" +#include "call_destructors_where_necessary.hpp" +#include "is_tagged_union_wrapper.hpp" +#include "make_type_name.hpp" +#include "schema/Type.hpp" +#include "schemaful/IsSchemafulReader.hpp" +#include "schemaful/IsSchemafulWriter.hpp" + +namespace rfl::parsing { + +/// Default case - anything that cannot be explicitly matched. +template + requires AreReaderAndWriter +struct Parser { + public: + using InputVarType = typename R::InputVarType; + + using ParentType = Parent; + + /// Expresses the variables as type T. + static Result read(const R& _r, const InputVarType& _var) noexcept { + if constexpr (internal::has_read_reflector) { + const auto wrap_in_t = [](auto&& _named_tuple) -> Result { + try { + using NT = decltype(_named_tuple); + return Reflector::to(std::forward(_named_tuple)); + } catch (std::exception& e) { + return error(e.what()); + } + }; + return Parser::ReflType, + ProcessorsType>::read(_r, _var) + .and_then(wrap_in_t); + + } else if constexpr (schemaful::IsSchemafulReader && + internal::is_literal_v) { + return _r.template to_basic_type(_var); + + } else if constexpr (R::template has_custom_constructor) { + return _r.template use_custom_constructor(_var); + + } else { + if constexpr (internal::has_reflection_type_v) { + using ReflectionType = std::remove_cvref_t; + const auto wrap_in_t = [](auto&& _named_tuple) -> Result { + try { + using NT = decltype(_named_tuple); + return T{std::forward(_named_tuple)}; + } catch (std::exception& e) { + return error(e.what()); + } + }; + return Parser::read(_r, _var) + .and_then(wrap_in_t); + + } else if constexpr (std::is_class_v && std::is_aggregate_v) { + if constexpr (ProcessorsType::default_if_missing_ || + internal::has_default_val_v) { + return read_struct_with_default(_r, _var); + } else { + return read_struct(_r, _var); + } + + } else if constexpr (std::is_enum_v) { + if constexpr (ProcessorsType::underlying_enums_ || + schemaful::IsSchemafulReader) { + static_assert(enchantum::ScopedEnum, + "The enum must be a scoped enum in order to retrieve " + "the underlying value."); + return _r.template to_basic_type>(_var) + .transform([](const auto _val) { return static_cast(_val); }); + } else { + return _r.template to_basic_type(_var).and_then( + rfl::string_to_enum); + } + + } else { + return _r.template to_basic_type>(_var); + } + } + } + + template + static void write(const W& _w, const T& _var, const P& _parent) { + if constexpr (internal::has_write_reflector) { + Parser::ReflType, ProcessorsType>::write( + _w, Reflector::from(_var), _parent); + + } else if constexpr (schemaful::IsSchemafulWriter && + internal::is_literal_v) { + ParentType::add_value(_w, _var, _parent); + + } else if constexpr (internal::has_reflection_type_v) { + using ReflectionType = std::remove_cvref_t; + if constexpr (internal::has_reflection_method_v) { + Parser::write( + _w, _var.reflection(), _parent); + } else { + const auto& [r] = _var; + Parser::write(_w, r, _parent); + } + + } else if constexpr (std::is_class_v && std::is_aggregate_v) { + const auto ptr_named_tuple = ProcessorsType::template process( + internal::to_ptr_named_tuple(_var)); + using PtrNamedTupleType = std::remove_cvref_t; + Parser::write( + _w, ptr_named_tuple, _parent); + + } else if constexpr (std::is_enum_v) { + if constexpr (ProcessorsType::underlying_enums_ || + schemaful::IsSchemafulWriter) { + const auto val = static_cast>(_var); + ParentType::add_value(_w, val, _parent); + } else { + const auto str = rfl::enum_to_string(_var); + ParentType::add_value(_w, str, _parent); + } + + } else { + ParentType::add_value(_w, _var, _parent); + } + } + + /// Generates a schema for the underlying type. + static schema::Type to_schema( + std::map* _definitions) { + using U = std::remove_cvref_t; + using Type = schema::Type; + if constexpr (std::is_same()) { + return Type{Type::Boolean{}}; + + } else if constexpr (std::is_same()) { + return Type{Type::Int32{}}; + + } else if constexpr (std::is_same()) { + return Type{Type::Int64{}}; + + } else if constexpr (std::is_same()) { + return Type{Type::UInt32{}}; + + } else if constexpr (std::is_same()) { + return Type{Type::UInt64{}}; + + } else if constexpr (std::is_integral()) { + return Type{Type::Integer{}}; + + } else if constexpr (std::is_same()) { + return Type{Type::Float{}}; + + } else if constexpr (std::is_floating_point_v) { + return Type{Type::Double{}}; + + } else if constexpr (std::is_same()) { + return Type{Type::String{}}; + + } else if constexpr (rfl::internal::is_description_v) { + return make_description(_definitions); + + } else if constexpr (std::is_enum_v) { + return make_enum(_definitions); + + } else if constexpr (std::is_class_v && std::is_aggregate_v) { + return make_reference(_definitions); + + } else if constexpr (internal::is_literal_v) { + return Type{Type::Literal{.values_ = U::strings()}}; + + } else if constexpr (internal::is_validator_v) { + return make_validated(_definitions); + + } else if constexpr (internal::has_reflection_type_v || + internal::has_read_reflector || + internal::has_write_reflector) { + return make_reference(_definitions); + + } else { + static_assert(rfl::always_false_v, "Unsupported type."); + } + } + + private: + template + static schema::Type make_description( + std::map* _definitions) { + using Type = schema::Type; + return Type{Type::Description{ + .description_ = typename U::Content().str(), + .type_ = + Ref::make(Parser, + ProcessorsType>::to_schema(_definitions))}}; + } + + template + static schema::Type make_enum( + std::map* _definitions) { + using Type = schema::Type; + if constexpr (ProcessorsType::underlying_enums_ || + schemaful::IsSchemafulReader) { + return Type{Type::Integer{}}; + } else if constexpr (enchantum::is_bitflag) { + return Type{Type::String{}}; + } else { + return Parser< + R, W, + typename decltype(internal::enums::get_enum_names())::Literal, + ProcessorsType>::to_schema(_definitions); + } + } + + template + static schema::Type make_reference( + std::map* _definitions) { + using Type = schema::Type; + const auto name = make_type_name(); + + if (_definitions->find(name) == _definitions->end()) { + (*_definitions)[name] = + Type{Type::Integer{}}; // Placeholder to avoid infinite loop. + + if constexpr (internal::has_reflection_type_v) { + (*_definitions)[name] = + Parser::to_schema( + _definitions); + + } else if constexpr (internal::has_read_reflector || + internal::has_write_reflector) { + (*_definitions)[name] = Parser::ReflType, + ProcessorsType>::to_schema(_definitions); + + } else { + using NamedTupleType = internal::processed_t; + (*_definitions)[name] = + Parser::to_schema( + _definitions); + } + } + return Type{Type::Reference{name}}; + } + + template + static schema::Type make_validated( + std::map* _definitions) { + using Type = schema::Type; + using ReflectionType = std::remove_cvref_t; + using ValidationType = std::remove_cvref_t; + return Type{Type::Validated{ + .type_ = Ref::make( + Parser::to_schema( + _definitions)), + .validation_ = ValidationType::template to_schema()}}; + } + + /// The way this works is that we allocate space on the stack in this size of + /// the struct in which we then write the individual fields using + /// views and placement new. This is how we deal with the fact that some + /// fields might not be default-constructible. + static Result read_struct(const R& _r, const InputVarType& _var) { + alignas(T) unsigned char buf[sizeof(T)]{}; + auto ptr = internal::ptr_cast(&buf); + auto view = ProcessorsType::template process(to_view(*ptr)); + using ViewType = std::remove_cvref_t; + const auto [set, err] = + Parser::read_view(_r, _var, &view); + if (err) [[unlikely]] { + call_destructors_where_necessary(set, &view); + return error(err->what()); + } + auto res = Result(std::move(*ptr)); + call_destructors_where_necessary(set, &view); + return res; + } + + /// This is actually more straight-forward than the standard case - we just + /// allocate a struct and then fill it. But it is less efficient and it + /// assumes that all values on the struct have a default constructor, so we + /// only use it when the DefaultIfMissing preprocessor is added. + static Result read_struct_with_default(const R& _r, + const InputVarType& _var) { + auto t = T{}; + auto view = ProcessorsType::template process(to_view(t)); + using ViewType = decltype(view); + const auto err = + Parser::read_view_with_default(_r, _var, + &view); + if (err) [[unlikely]] { + return error(*err); + } + return t; + } +}; + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_default_val.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_default_val.hpp new file mode 100644 index 0000000..38f4b35 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_default_val.hpp @@ -0,0 +1,46 @@ +#ifndef RFL_PARSING_PARSER_DEFAULTVAL_HPP_ +#define RFL_PARSING_PARSER_DEFAULTVAL_HPP_ + +#include +#include + +#include "../DefaultVal.hpp" +#include "AreReaderAndWriter.hpp" +#include "Parent.hpp" +#include "Parser_base.hpp" +#include "schema/Type.hpp" + +namespace rfl::parsing { + +template + requires AreReaderAndWriter> +struct Parser, ProcessorsType> { + using InputVarType = typename R::InputVarType; + + using ParentType = Parent; + + static Result> read(const R& _r, + const InputVarType& _var) noexcept { + return Parser, ProcessorsType>::read(_r, _var) + .transform([](auto&& _t) { + return DefaultVal(std::forward(_t)); + }); + } + + template + static void write(const W& _w, const DefaultVal& _d, const P& _parent) { + Parser, ProcessorsType>::write(_w, _d.value(), + _parent); + } + + static schema::Type to_schema( + std::map* _definitions) { + using U = std::remove_cvref_t; + return schema::Type{ + Parser::to_schema(_definitions)}; + } +}; + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_duration.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_duration.hpp new file mode 100644 index 0000000..4656444 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_duration.hpp @@ -0,0 +1,143 @@ +#ifndef RFL_PARSING_PARSER_DURATION_HPP_ +#define RFL_PARSING_PARSER_DURATION_HPP_ + +#include +#include +#include + +#include "../Literal.hpp" +#include "../Variant.hpp" +#include "../always_false.hpp" +#include "Parent.hpp" +#include "Parser_base.hpp" +#include "schema/Type.hpp" + +namespace rfl ::parsing { + +template + requires AreReaderAndWriter> +struct Parser, ProcessorsType> { + public: + using InputVarType = typename R::InputVarType; + + using ParentType = Parent; + + using DurationType = std::chrono::duration; + + using Unit = Literal<"nanoseconds", "microseconds", "milliseconds", "seconds", + "minutes", "hours", "days", "weeks", "months", "years">; + + using SupportedTypes = + Variant; + + struct RType { + int64_t count; + Unit unit; + }; + + static Result read(const R& _r, + const InputVarType& _var) noexcept { + return Parser::read(_r, _var) + .and_then(to_duration) + .transform([](auto&& _duration) { + return _duration.visit([](auto&& _d) -> DurationType { + return std::chrono::duration_cast(std::move(_d)); + }); + }); + } + + template + static void write(const W& _w, const DurationType& _d, const P& _parent) { + const auto r = + RType{.count = static_cast(_d.count()), .unit = make_unit()}; + return Parser::write(_w, r, _parent); + } + + static schema::Type to_schema( + std::map* _definitions) { + return Parser::to_schema(_definitions); + } + + private: + static Result to_duration(const RType& _r) { + switch (_r.unit.value()) { + case Unit::value_of<"nanoseconds">(): + return SupportedTypes(std::chrono::nanoseconds(_r.count)); + + case Unit::value_of<"microseconds">(): + return SupportedTypes(std::chrono::microseconds(_r.count)); + + case Unit::value_of<"milliseconds">(): + return SupportedTypes(std::chrono::milliseconds(_r.count)); + + case Unit::value_of<"seconds">(): + return SupportedTypes(std::chrono::seconds(_r.count)); + + case Unit::value_of<"minutes">(): + return SupportedTypes(std::chrono::minutes(_r.count)); + + case Unit::value_of<"hours">(): + return SupportedTypes(std::chrono::hours(_r.count)); + + case Unit::value_of<"days">(): + return SupportedTypes(std::chrono::days(_r.count)); + + case Unit::value_of<"weeks">(): + return SupportedTypes(std::chrono::weeks(_r.count)); + + case Unit::value_of<"months">(): + return SupportedTypes(std::chrono::months(_r.count)); + + case Unit::value_of<"years">(): + return SupportedTypes(std::chrono::years(_r.count)); + + default: + return error("Unsupported unit."); + } + } + + static auto make_unit() noexcept { + if constexpr (std::is_same_v) { + return Unit::make<"nanoseconds">(); + + } else if constexpr (std::is_same_v) { + return Unit::make<"microseconds">(); + + } else if constexpr (std::is_same_v) { + return Unit::make<"milliseconds">(); + + } else if constexpr (std::is_same_v) { + return Unit::make<"seconds">(); + + } else if constexpr (std::is_same_v) { + return Unit::make<"minutes">(); + + } else if constexpr (std::is_same_v) { + return Unit::make<"hours">(); + + } else if constexpr (std::is_same_v) { + return Unit::make<"days">(); + + } else if constexpr (std::is_same_v) { + return Unit::make<"weeks">(); + + } else if constexpr (std::is_same_v) { + return Unit::make<"months">(); + + } else if constexpr (std::is_same_v) { + return Unit::make<"years">(); + + } else { + static_assert(always_false_v, "Unsupported type."); + } + }; +}; + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_filepath.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_filepath.hpp new file mode 100644 index 0000000..a941441 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_filepath.hpp @@ -0,0 +1,50 @@ +#ifndef RFL_PARSING_PARSER_FILEPATH_HPP_ +#define RFL_PARSING_PARSER_FILEPATH_HPP_ + +#include +#include + +#include "../Result.hpp" +#include "Parser_base.hpp" +#include "schema/Type.hpp" + +namespace rfl { +namespace parsing { + +template + requires AreReaderAndWriter +struct Parser { + using InputVarType = typename R::InputVarType; + + /// Expresses the variables as type T. + static Result read(const R& _r, + const InputVarType& _var) noexcept { + const auto to_path = + [&](std::string&& _str) -> Result { + try { + return std::filesystem::path(_str); + } catch (std::exception& e) { + return error(e.what()); + } + }; + return Parser::read(_r, _var).and_then( + to_path); + } + + template + static void write(const W& _w, const std::filesystem::path& _p, + const P& _parent) { + return Parser::write(_w, _p.string(), + _parent); + } + + static schema::Type to_schema( + std::map* _definitions) { + return Parser::to_schema(_definitions); + } +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_map_like.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_map_like.hpp new file mode 100644 index 0000000..29c3ddc --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_map_like.hpp @@ -0,0 +1,47 @@ +#ifndef RFL_PARSING_PARSER_MAP_LIKE_HPP_ +#define RFL_PARSING_PARSER_MAP_LIKE_HPP_ + +#include +#include +#include + +#include "../ExtraFields.hpp" +#include "../Object.hpp" +#include "../Result.hpp" +#include "../always_false.hpp" +#include "MapParser.hpp" +#include "Parser_base.hpp" + +namespace rfl { +namespace parsing { + +template + requires AreReaderAndWriter> +struct Parser, ProcessorsType> + : public MapParser, ProcessorsType> {}; + +template + requires AreReaderAndWriter< + R, W, std::unordered_map> +struct Parser, + ProcessorsType> + : public MapParser< + R, W, std::unordered_map, + ProcessorsType> {}; + +template + requires AreReaderAndWriter> +struct Parser, ProcessorsType> + : public MapParser, ProcessorsType> {}; + +template + requires AreReaderAndWriter> +struct Parser, ProcessorsType> + : public MapParser, ProcessorsType> {}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_named_tuple.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_named_tuple.hpp new file mode 100644 index 0000000..3041e45 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_named_tuple.hpp @@ -0,0 +1,23 @@ +#ifndef RFL_PARSING_PARSER_NAMED_TUPLE_HPP_ +#define RFL_PARSING_PARSER_NAMED_TUPLE_HPP_ + +#include "NamedTupleParser.hpp" +#include "Parser_base.hpp" + +namespace rfl { +namespace parsing { + +template +requires AreReaderAndWriter> +struct Parser, ProcessorsType> + : public NamedTupleParser< + R, W, /*_ignore_empty_containers=*/false, + /*_all_required=*/ProcessorsType::all_required_, + /*_no_field_names=*/ProcessorsType::no_field_names_, ProcessorsType, + FieldTypes...> { +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_optional.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_optional.hpp new file mode 100644 index 0000000..d7f07f7 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_optional.hpp @@ -0,0 +1,83 @@ +#ifndef RFL_PARSING_PARSER_OPTIONAL_HPP_ +#define RFL_PARSING_PARSER_OPTIONAL_HPP_ + +#include +#include +#include + +#include "../Ref.hpp" +#include "../Result.hpp" +#include "../always_false.hpp" +#include "Parent.hpp" +#include "Parser_base.hpp" +#include "schema/Type.hpp" +#include "schemaful/IsSchemafulReader.hpp" +#include "schemaful/IsSchemafulWriter.hpp" +#include "schemaful/OptionalReader.hpp" + +namespace rfl { +namespace parsing { + +template + requires AreReaderAndWriter> +struct Parser, ProcessorsType> { + using InputVarType = typename R::InputVarType; + + using ParentType = Parent; + + static Result> read(const R& _r, + const InputVarType& _var) noexcept { + if constexpr (schemaful::IsSchemafulReader) { + using O = schemaful::OptionalReader, + ProcessorsType>; + const auto to_optional = [&](const auto& _u) -> Result> { + return _r.template read_union, O>(_u); + }; + return _r.to_union(_var).and_then(to_optional); + } else { + if (_r.is_empty(_var)) { + return std::optional(); + } + const auto to_opt = [](auto&& _t) { + return std::make_optional(std::forward(_t)); + }; + return Parser, ProcessorsType>::read(_r, + _var) + .transform(to_opt); + } + } + + template + static void write(const W& _w, const std::optional& _o, const P& _parent) { + if constexpr (schemaful::IsSchemafulWriter) { + auto u = ParentType::add_union(_w, _parent); + using UnionType = typename ParentType::template Union; + auto p = + UnionType{.index_ = static_cast(_o ? 0 : 1), .union_ = &u}; + if (_o) { + Parser, ProcessorsType>::write(_w, *_o, p); + } else { + ParentType::add_null(_w, p); + } + } else { + if (_o) { + Parser, ProcessorsType>::write(_w, *_o, + _parent); + } else { + ParentType::add_null(_w, _parent); + } + } + } + + static schema::Type to_schema( + std::map* _definitions) { + using U = std::remove_cvref_t; + return schema::Type{schema::Type::Optional{Ref::make( + Parser::to_schema(_definitions))}}; + } +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_pair.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_pair.hpp new file mode 100644 index 0000000..0cf2336 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_pair.hpp @@ -0,0 +1,52 @@ +#ifndef RFL_PARSING_PARSER_PAIR_HPP_ +#define RFL_PARSING_PARSER_PAIR_HPP_ + +#include +#include + +#include "../Ref.hpp" +#include "../Result.hpp" +#include "../always_false.hpp" +#include "Parser_base.hpp" +#include "schema/Type.hpp" + +namespace rfl { +namespace parsing { + +template + requires AreReaderAndWriter> +struct Parser, ProcessorsType> { + using InputVarType = typename R::InputVarType; + + /// Expresses the variables as type T. + static Result> read( + const R& _r, const InputVarType& _var) noexcept { + const auto to_pair = [&](auto&& _t) { + return std::make_pair(std::move(std::get<0>(_t)), + std::move(std::get<1>(_t))); + }; + return Parser, + ProcessorsType>::read(_r, _var) + .transform(to_pair); + } + + template + static void write(const W& _w, const std::pair& _p, + const P& _parent) { + const auto tup = std::make_tuple(&_p.first, &_p.second); + Parser, + ProcessorsType>::write(_w, tup, _parent); + } + + static schema::Type to_schema( + std::map* _definitions) { + return Parser, + ProcessorsType>::to_schema(_definitions); + } +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_ptr.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_ptr.hpp new file mode 100644 index 0000000..c709e1a --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_ptr.hpp @@ -0,0 +1,69 @@ +#ifndef RFL_PARSING_PARSER_PTR_HPP_ +#define RFL_PARSING_PARSER_PTR_HPP_ + +#include +#include + +#include "../Ref.hpp" +#include "../Result.hpp" +#include "../always_false.hpp" +#include "Parent.hpp" +#include "Parser_base.hpp" +#include "schema/Type.hpp" + +namespace rfl { +namespace parsing { + +template + requires AreReaderAndWriter +struct Parser { + using InputVarType = typename R::InputVarType; + + using ParentType = Parent; + + /// Expresses the variables as type T. + static Result read(const R& _r, const InputVarType& _var) noexcept { + if constexpr (!ProcessorsType::allow_raw_ptrs_) { + static_assert( + always_false_v, + "Reading into raw pointers is dangerous and " + "therefore unsupported by default. " + "Please consider using std::unique_ptr, rfl::Box, " + "std::shared_ptr, " + "rfl::Ref or std::optional instead. " + "If you absolutely must use raw pointers, " + "you can pass the rfl::AllowRawPtrs processor. " + "Please note that it is then YOUR responsibility " + "to delete the allocated memory. Please also refer " + "to the related documentation (in the section on processors)."); + return error("Unsupported."); + } else { + if (_r.is_empty(_var)) { + return nullptr; + } + return Parser::read(_r, _var).transform( + [](T&& _t) { return new T(std::move(_t)); }); + } + } + + template + static void write(const W& _w, const T* _ptr, const P& _parent) { + if (!_ptr) { + ParentType::add_null(_w, _parent); + return; + } + Parser, ProcessorsType>::write(_w, *_ptr, + _parent); + } + + static schema::Type to_schema( + std::map* _definitions) { + return Parser, ProcessorsType>::to_schema( + _definitions); + } +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_ref.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_ref.hpp new file mode 100644 index 0000000..452fef5 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_ref.hpp @@ -0,0 +1,43 @@ +#ifndef RFL_PARSING_PARSER_REF_HPP_ +#define RFL_PARSING_PARSER_REF_HPP_ + +#include +#include + +#include "../Ref.hpp" +#include "../Result.hpp" +#include "../always_false.hpp" +#include "Parser_base.hpp" +#include "schema/Type.hpp" + +namespace rfl { +namespace parsing { + +template + requires AreReaderAndWriter> +struct Parser, ProcessorsType> { + using InputVarType = typename R::InputVarType; + + static Result> read(const R& _r, const InputVarType& _var) noexcept { + const auto to_ref = [&](auto&& _t) { return Ref::make(std::move(_t)); }; + return Parser, ProcessorsType>::read(_r, _var) + .transform(to_ref); + } + + template + static void write(const W& _w, const Ref& _ref, const P& _parent) { + Parser, ProcessorsType>::write(_w, *_ref, + _parent); + } + + static schema::Type to_schema( + std::map* _definitions) { + return Parser, ProcessorsType>::to_schema( + _definitions); + } +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_reference_wrapper.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_reference_wrapper.hpp new file mode 100644 index 0000000..840de08 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_reference_wrapper.hpp @@ -0,0 +1,49 @@ +#ifndef RFL_PARSING_PARSER_REFERENCE_WRAPPER_HPP_ +#define RFL_PARSING_PARSER_REFERENCE_WRAPPER_HPP_ + +#include +#include +#include + +#include "../Result.hpp" +#include "../always_false.hpp" +#include "Parser_base.hpp" +#include "schema/Type.hpp" + +namespace rfl { +namespace parsing { + +template + requires AreReaderAndWriter> +struct Parser, ProcessorsType> { + using InputVarType = typename R::InputVarType; + + static Result> read(const R&, + const InputVarType&) noexcept { + static_assert(always_false_v, + "Reading into std::reference_wrapper is dangerous and " + "therefore unsupported. " + "Please consider using std::unique_ptr, rfl::Box, " + "std::shared_ptr, or" + "rfl::Ref instead."); + return error("Unsupported."); + } + + template + static void write(const W& _w, const std::reference_wrapper _ref, + const P& _p) { + Parser, ProcessorsType>::write(_w, _ref.get(), + _p); + } + + static schema::Type to_schema( + std::map* _definitions) { + return Parser, ProcessorsType>::to_schema( + _definitions); + } +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_rename.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_rename.hpp new file mode 100644 index 0000000..a79846d --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_rename.hpp @@ -0,0 +1,49 @@ +#ifndef RFL_PARSING_PARSER_RENAME_HPP_ +#define RFL_PARSING_PARSER_RENAME_HPP_ + +#include +#include + +#include "../Rename.hpp" +#include "../Result.hpp" +#include "../always_false.hpp" +#include "../internal/StringLiteral.hpp" +#include "Parser_base.hpp" +#include "schema/Type.hpp" + +namespace rfl { +namespace parsing { + +template + requires AreReaderAndWriter> +struct Parser, ProcessorsType> { + using InputVarType = typename R::InputVarType; + + static Result> read(const R& _r, + const InputVarType& _var) noexcept { + const auto to_rename = [](auto&& _t) { + return Rename<_name, T>(std::move(_t)); + }; + return Parser, ProcessorsType>::read(_r, _var) + .transform(to_rename); + } + + template + static void write(const W& _w, const Rename<_name, T>& _rename, + const P& _parent) { + Parser, ProcessorsType>::write( + _w, _rename.value(), _parent); + } + + static schema::Type to_schema( + std::map* _definitions) { + return Parser, ProcessorsType>::to_schema( + _definitions); + } +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_result.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_result.hpp new file mode 100644 index 0000000..0b5085f --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_result.hpp @@ -0,0 +1,68 @@ +#ifndef RFL_PARSING_PARSER_RESULT_HPP_ +#define RFL_PARSING_PARSER_RESULT_HPP_ + +#include +#include + +#include "../Field.hpp" +#include "../NamedTuple.hpp" +#include "../Result.hpp" +#include "../always_false.hpp" +#include "../internal/StringLiteral.hpp" +#include "Parent.hpp" +#include "Parser_base.hpp" +#include "schema/Type.hpp" + +namespace rfl { +namespace parsing { + +template + requires AreReaderAndWriter> +struct Parser, ProcessorsType> { + using InputVarType = typename R::InputVarType; + + using ErrorType = NamedTuple>; + using VariantType = std::variant, ErrorType>; + + static Result> read(const R& _r, + const InputVarType& _var) noexcept { + const auto handle = [](auto&& _t) -> Result { + using Type = std::remove_cvref_t; + if constexpr (std::is_same()) { + return error(_t.template get<"error">()); + } else { + return std::forward>(_t); + } + }; + + const auto to_res = [&](VariantType&& _v) -> Result { + return std::visit(handle, std::forward(_v)); + }; + + return Result>( + Parser::read(_r, _var).transform( + to_res)); + } + + template + static void write(const W& _w, const Result& _r, const P& _parent) { + if (_r) { + Parser, ProcessorsType>::write( + _w, _r.value(), _parent); + } else { + Parser::write( + _w, ErrorType(make_field<"error">(_r.error().what())), _parent); + } + } + + static schema::Type to_schema( + std::map* _definitions) { + return Parser, ProcessorsType>::to_schema( + _definitions); + } +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_rfl_array.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_rfl_array.hpp new file mode 100644 index 0000000..9e5c470 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_rfl_array.hpp @@ -0,0 +1,46 @@ +#ifndef RFL_PARSING_PARSER_RFL_ARRAY_HPP_ +#define RFL_PARSING_PARSER_RFL_ARRAY_HPP_ + +#include + +#include "../Result.hpp" +#include "../always_false.hpp" +#include "../internal/Array.hpp" +#include "../internal/to_std_array.hpp" +#include "Parser_array.hpp" +#include "Parser_base.hpp" +#include "schema/Type.hpp" + +namespace rfl { +namespace parsing { + +template + requires AreReaderAndWriter> +struct Parser, ProcessorsType> { + public: + using InputArrayType = typename R::InputArrayType; + using InputVarType = typename R::InputVarType; + + using StdArray = internal::to_std_array_t; + + static Result> read(const R& _r, + const InputVarType& _var) noexcept { + return Parser::read(_r, _var); + } + + template + static void write(const W& _w, const internal::Array& _arr, + const P& _parent) { + Parser::write(_w, _arr.arr_, _parent); + } + + static schema::Type to_schema( + std::map* _definitions) { + return Parser::to_schema(_definitions); + } +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_rfl_tuple.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_rfl_tuple.hpp new file mode 100644 index 0000000..d536cc4 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_rfl_tuple.hpp @@ -0,0 +1,22 @@ +#ifndef RFL_PARSING_PARSER_RFL_TUPLE_HPP_ +#define RFL_PARSING_PARSER_RFL_TUPLE_HPP_ + +#include "../Tuple.hpp" +#include "Parser_base.hpp" +#include "TupleParser.hpp" + +namespace rfl { +namespace parsing { + +template +requires AreReaderAndWriter> +struct Parser, ProcessorsType> + : public TupleParser> { +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_rfl_variant.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_rfl_variant.hpp new file mode 100644 index 0000000..8c5dd2f --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_rfl_variant.hpp @@ -0,0 +1,217 @@ +#ifndef RFL_PARSING_PARSER_RFL_VARIANT_HPP_ +#define RFL_PARSING_PARSER_RFL_VARIANT_HPP_ + +#include +#include + +#include "../Result.hpp" +#include "../Variant.hpp" +#include "../always_false.hpp" +#include "../internal/all_fields.hpp" +#include "../internal/nth_element_t.hpp" +#include "FieldVariantParser.hpp" +#include "Parent.hpp" +#include "Parser_base.hpp" +#include "VariantAlternativeWrapper.hpp" +#include "schema/Type.hpp" +#include "schemaful/IsSchemafulReader.hpp" +#include "schemaful/IsSchemafulWriter.hpp" +#include "schemaful/VariantReader.hpp" +#include "to_single_error_message.hpp" + +namespace rfl::parsing { + +template + requires AreReaderAndWriter> +class Parser, ProcessorsType> { + using ParentType = Parent; + + public: + using InputVarType = typename R::InputVarType; + + static Result> read( + const R& _r, const InputVarType& _var) noexcept { + if constexpr (internal::all_fields>()) { + if constexpr (schemaful::IsSchemafulReader) { + using WrappedType = rfl::Variant...>; + return Parser::read(_r, _var) + .transform( + [](auto&& _variant) -> rfl::Variant { + return std::move(_variant).visit([](auto&& _named_tuple) { + return rfl::Variant(std::move( + std::move(_named_tuple).fields().template get<0>())); + }); + }); + + } else { + return FieldVariantParser::read(_r, _var); + } + + } else if constexpr (schemaful::IsSchemafulReader) { + using V = schemaful::VariantReader, + ProcessorsType, AlternativeTypes...>; + return _r.to_union(_var).and_then([&](const auto& _u) { + return _r.template read_union, V>(_u); + }); + + } else if constexpr (ProcessorsType::add_tags_to_variants_ || + ProcessorsType::add_namespaced_tags_to_variants_) { + constexpr bool remove_namespaces = ProcessorsType::add_tags_to_variants_; + using FieldVariantType = rfl::Variant< + VariantAlternativeWrapper...>; + const auto from_field_variant = + [](auto&& _field) -> rfl::Variant { + return std::move(_field.value()); + }; + return Parser::read(_r, _var) + .transform([&](FieldVariantType&& _f) { + return _f.visit(from_field_variant); + }); + + } else { + std::optional> result; + std::vector errors; + errors.reserve(sizeof...(AlternativeTypes)); + read_variant( + _r, _var, &result, &errors, + std::make_integer_sequence()); + if (result) { + return std::move(*result); + } else { + return error( + to_single_error_message(errors, + "Could not parse the variant. Each of the " + "possible alternatives failed " + "for the following reasons: ", + 100000)); + } + } + } + + template + static void write(const W& _w, + const rfl::Variant& _variant, + const P& _parent) { + if constexpr (internal::all_fields>()) { + if constexpr (schemaful::IsSchemafulWriter) { + using WrappedType = rfl::Variant< + NamedTuple>...>; + const auto to_wrapped = [](const auto& _variant) -> WrappedType { + return _variant.visit([](const auto& _field) -> WrappedType { + return make_named_tuple(internal::to_ptr_field(_field)); + }); + }; + Parser::write( + _w, to_wrapped(_variant), _parent); + + } else { + FieldVariantParser::write( + _w, _variant, _parent); + } + + } else if constexpr (schemaful::IsSchemafulWriter) { + return rfl::visit( + [&](const auto& _v) { + using Type = std::remove_cvref_t; + auto u = ParentType::add_union(_w, _parent); + using UnionType = typename ParentType::template Union; + auto p = UnionType{.index_ = static_cast(_variant.index()), + .union_ = &u}; + Parser::write(_w, _v, p); + }, + _variant); + + } else if constexpr (ProcessorsType::add_tags_to_variants_ || + ProcessorsType::add_namespaced_tags_to_variants_) { + constexpr bool remove_namespaces = ProcessorsType::add_tags_to_variants_; + using FieldVariantType = + rfl::Variant...>; + const auto to_field_variant = + [](const T& _t) -> FieldVariantType { + return VariantAlternativeWrapper(&_t); + }; + Parser::write( + _w, _variant.visit(to_field_variant), _parent); + + } else { + const auto handle = [&](const auto& _v) { + using Type = std::remove_cvref_t; + Parser::write(_w, _v, _parent); + }; + return rfl::visit(handle, _variant); + } + } + + static schema::Type to_schema( + std::map* _definitions) { + if constexpr (internal::all_fields>()) { + return FieldVariantParser::to_schema(_definitions); + + } else if constexpr (ProcessorsType::add_tags_to_variants_ || + ProcessorsType::add_namespaced_tags_to_variants_) { + constexpr bool remove_namespaces = ProcessorsType::add_tags_to_variants_; + using FieldVariantType = rfl::Variant< + VariantAlternativeWrapper...>; + return Parser::to_schema( + _definitions); + + } else { + std::vector types; + build_schema( + _definitions, &types, + std::make_integer_sequence()); + return schema::Type{schema::Type::AnyOf{.types_ = std::move(types)}}; + } + } + + private: + template + static void add_to_schema(std::map* _definitions, + std::vector* _types) noexcept { + using AltType = + std::remove_cvref_t>; + _types->push_back( + Parser::to_schema(_definitions)); + } + + template + static void build_schema(std::map* _definitions, + std::vector* _types, + std::integer_sequence) noexcept { + (add_to_schema<_is>(_definitions, _types), ...); + } + + template + static void read_one_alternative( + const R& _r, const InputVarType& _var, + std::optional>* _result, + std::vector* _errors) noexcept { + if (!*_result) { + using AltType = + std::remove_cvref_t>; + auto res = Parser::read(_r, _var); + if (res) { + *_result = std::move(*res); + } else { + _errors->emplace_back(std::move(res.error())); + } + } + } + + template + static void read_variant( + const R& _r, const InputVarType& _var, + std::optional>* _result, + std::vector* _errors, + std::integer_sequence) noexcept { + (read_one_alternative<_is>(_r, _var, _result, _errors), ...); + } +}; + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_shared_ptr.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_shared_ptr.hpp new file mode 100644 index 0000000..e7dcba0 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_shared_ptr.hpp @@ -0,0 +1,79 @@ +#ifndef RFL_PARSING_PARSER_SHARED_PTR_HPP_ +#define RFL_PARSING_PARSER_SHARED_PTR_HPP_ + +#include +#include +#include + +#include "../Ref.hpp" +#include "../Result.hpp" +#include "../always_false.hpp" +#include "Parent.hpp" +#include "Parser_base.hpp" +#include "schema/Type.hpp" +#include "schemaful/IsSchemafulReader.hpp" +#include "schemaful/IsSchemafulWriter.hpp" +#include "schemaful/SharedPtrReader.hpp" + +namespace rfl::parsing { + +template + requires AreReaderAndWriter> +struct Parser, ProcessorsType> { + using InputVarType = typename R::InputVarType; + + using ParentType = Parent; + + static Result> read(const R& _r, + const InputVarType& _var) noexcept { + if constexpr (schemaful::IsSchemafulReader) { + using S = schemaful::SharedPtrReader, + ProcessorsType>; + const auto to_shared = [&](const auto& _u) -> Result> { + return _r.template read_union, S>(_u); + }; + return _r.to_union(_var).and_then(to_shared); + } else { + if (_r.is_empty(_var)) { + return std::shared_ptr(); + } + return Parser, ProcessorsType>::read(_r, + _var) + .transform([](T&& _t) { return std::make_shared(std::move(_t)); }); + } + } + + template + static void write(const W& _w, const std::shared_ptr& _s, + const P& _parent) noexcept { + if constexpr (schemaful::IsSchemafulWriter) { + auto u = ParentType::add_union(_w, _parent); + using UnionType = typename ParentType::template Union; + auto p = + UnionType{.index_ = static_cast(_s ? 0 : 1), .union_ = &u}; + if (_s) { + Parser, ProcessorsType>::write(_w, *_s, p); + } else { + ParentType::add_null(_w, p); + } + } else { + if (_s) { + Parser, ProcessorsType>::write(_w, *_s, + _parent); + } else { + ParentType::add_null(_w, _parent); + } + } + } + + static schema::Type to_schema( + std::map* _definitions) { + using U = std::remove_cvref_t; + return schema::Type{schema::Type::Optional{Ref::make( + Parser::to_schema(_definitions))}}; + } +}; + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_skip.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_skip.hpp new file mode 100644 index 0000000..b5346c7 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_skip.hpp @@ -0,0 +1,66 @@ +#ifndef RFL_PARSING_PARSER_SKIP_HPP_ +#define RFL_PARSING_PARSER_SKIP_HPP_ + +#include +#include + +#include "../Result.hpp" +#include "../always_false.hpp" +#include "../internal/Skip.hpp" +#include "Parent.hpp" +#include "Parser_base.hpp" +#include "schema/Type.hpp" + +namespace rfl { +namespace parsing { + +template + requires AreReaderAndWriter< + R, W, internal::Skip> +struct Parser, + ProcessorsType> { + using InputVarType = typename R::InputVarType; + using ParentType = Parent; + + static Result> + read(const R& _r, const InputVarType& _var) noexcept { + if constexpr (_skip_deserialization) { + return internal::Skip( + std::remove_cvref_t()); + } else { + const auto to_skip = [&](auto&& _t) { + return internal::Skip( + std::move(_t)); + }; + return Parser, ProcessorsType>::read(_r, + _var) + .transform(to_skip); + } + } + + template + static void write(const W& _w, + const internal::Skip& _skip, + const P& _parent) { + if constexpr (_skip_serialization) { + ParentType::add_null(_w, _parent); + } else { + Parser, ProcessorsType>::write( + _w, _skip.value(), _parent); + } + } + + static schema::Type to_schema( + std::map* _definitions) { + return Parser, ProcessorsType>::to_schema( + _definitions); + } +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_span.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_span.hpp new file mode 100644 index 0000000..2593821 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_span.hpp @@ -0,0 +1,77 @@ +#ifndef RFL_PARSING_PARSER_SPAN_HPP_ +#define RFL_PARSING_PARSER_SPAN_HPP_ + +#include +#include +#include +#include +#include +#include + +#include "../Result.hpp" +#include "../always_false.hpp" +#include "Parent.hpp" +#include "Parser_base.hpp" +#include "schema/Type.hpp" + +namespace rfl::parsing { + +template + requires AreReaderAndWriter> +struct Parser, ProcessorsType> { + using InputVarType = typename R::InputVarType; + using ParentType = Parent; + + static Result> read(const R& _r, + const InputVarType& _var) noexcept { + if constexpr (!ProcessorsType::allow_raw_ptrs_) { + static_assert( + always_false_v, + "Reading into std::span is dangerous and " + "therefore unsupported. " + "Please consider using std::vector instead or wrapping " + "std::vector in rfl::Box or rfl::Ref." + "If you absolutely must use std::span, " + "you can pass the rfl::AllowRawPtrs processor. " + "Please note that it is then YOUR responsibility " + "to delete the allocated memory. Please also refer " + "to the related documentation (in the section on processors)."); + return error("Unsupported."); + } else { + return Parser>, + ProcessorsType>::read(_r, _var) + .and_then([](std::vector&& _vec) -> Result> { + using Type = std::remove_cvref_t; + Type* data = new (std::nothrow) Type[_vec.size()]; + if (!data) { + return error("Failed to allocate memory for std::span."); + } + for (size_t i = 0; i < _vec.size(); ++i) { + data[i] = std::move(_vec[i]); + } + return std::span(data, data + _vec.size()); + }); + } + } + + template + static void write(const W& _w, const std::span& _span, const P& _parent) { + auto arr = ParentType::add_array(_w, _span.size(), _parent); + const auto new_parent = typename ParentType::Array{&arr}; + for (const auto& v : _span) { + Parser, ProcessorsType>::write(_w, v, + new_parent); + } + _w.end_array(&arr); + } + + static schema::Type to_schema( + std::map* _definitions) { + return Parser>, + ProcessorsType>::to_schema(_definitions); + } +}; + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_string_view.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_string_view.hpp new file mode 100644 index 0000000..d09273d --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_string_view.hpp @@ -0,0 +1,62 @@ +#ifndef RFL_PARSING_PARSER_STRING_VIEW_HPP_ +#define RFL_PARSING_PARSER_STRING_VIEW_HPP_ + +#include +#include +#include +#include + +#include "../Result.hpp" +#include "../always_false.hpp" +#include "Parser_base.hpp" +#include "schema/Type.hpp" + +namespace rfl { +namespace parsing { + +template + requires AreReaderAndWriter +struct Parser { + using InputVarType = typename R::InputVarType; + + static Result read(const R& _r, + const InputVarType& _var) noexcept { + if constexpr (!ProcessorsType::allow_raw_ptrs_) { + static_assert( + always_false_v, + "Reading into std::string_view is dangerous and " + "therefore unsupported. " + "Please consider using std::string instead or wrapping " + "std::string in rfl::Box or rfl::Ref." + "If you absolutely must use std::string_view, " + "you can pass the rfl::AllowRawPtrs processor. " + "Please note that it is then YOUR responsibility " + "to delete the allocated memory. Please also refer " + "to the related documentation (in the section on processors)."); + return error("Unsupported."); + } else { + return Parser::read(_r, _var) + .transform([](std::string&& str) { + char* data = + new char[str.size() + 1]; // +1 for the null terminator + std::memcpy(data, str.data(), str.size() + 1); + return std::string_view(data, str.size()); + }); + } + } + + template + static void write(const W& _w, const std::string_view& _str, const P& _p) { + Parser::write(_w, std::string(_str), _p); + } + + static schema::Type to_schema( + std::map* _definitions) { + return Parser::to_schema(_definitions); + } +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_tagged_union.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_tagged_union.hpp new file mode 100644 index 0000000..8821dc5 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_tagged_union.hpp @@ -0,0 +1,240 @@ +#ifndef RFL_PARSING_PARSER_TAGGED_UNION_HPP_ +#define RFL_PARSING_PARSER_TAGGED_UNION_HPP_ + +#include +#include +#include + +#include "../Result.hpp" +#include "../TaggedUnion.hpp" +#include "../always_false.hpp" +#include "../internal/strings/strings.hpp" +#include "../named_tuple_t.hpp" +#include "../visit.hpp" +#include "Parser_base.hpp" +#include "TaggedUnionWrapper.hpp" +#include "is_tagged_union_wrapper.hpp" +#include "schema/Type.hpp" +#include "schemaful/IsSchemafulReader.hpp" +#include "schemaful/IsSchemafulWriter.hpp" +#include "tagged_union_wrapper_no_ptr.hpp" + +namespace rfl::parsing { + +template + requires AreReaderAndWriter> +struct Parser, + ProcessorsType> { + using ResultType = Result>; + + public: + using InputObjectType = typename R::InputObjectType; + using InputVarType = typename R::InputVarType; + + constexpr static bool no_field_names_ = ProcessorsType::no_field_names_; + + using InputObjectOrArrayType = + std::conditional_t; + + static ResultType read(const R& _r, const InputVarType& _var) noexcept { + if constexpr (schemaful::IsSchemafulReader) { + return Parser, ProcessorsType>::read( + _r, _var) + .transform([](auto&& _variant) { + return TaggedUnion<_discriminator, AlternativeTypes...>( + std::move(_variant)); + }); + + } else { + const auto get_disc = + [&_r](InputObjectOrArrayType _obj_or_arr) -> Result { + return get_discriminator(_r, _obj_or_arr); + }; + + const auto to_result = + [&_r, _var](const std::string& _disc_value) -> ResultType { + return find_matching_alternative( + _r, _disc_value, _var, + std::make_integer_sequence()); + }; + + if constexpr (no_field_names_) { + return _r.to_array(_var).and_then(get_disc).and_then(to_result); + } else { + return _r.to_object(_var).and_then(get_disc).and_then(to_result); + } + } + } + + template + static void write( + const W& _w, + const TaggedUnion<_discriminator, AlternativeTypes...>& _tagged_union, + const P& _parent) { + if constexpr (schemaful::IsSchemafulWriter) { + Parser, ProcessorsType>::write( + _w, _tagged_union.variant(), _parent); + } else { + rfl::visit([&](const auto& _val) { write_wrapped(_w, _val, _parent); }, + _tagged_union.variant()); + } + } + + static schema::Type to_schema( + std::map* _definitions) noexcept { + if constexpr (schemaful::IsSchemafulReader && + schemaful::IsSchemafulWriter) { + return Parser, + ProcessorsType>::to_schema(_definitions); + } else { + using VariantType = std::variant), AlternativeTypes>...>; + return Parser::to_schema(_definitions); + } + } + + private: + template + static ResultType find_matching_alternative( + const R& _r, const std::string& _disc_value, const InputVarType& _var, + std::integer_sequence) noexcept { + using PossibleTags = + possible_tags_t>; + static_assert(!PossibleTags::has_duplicates(), + "Duplicate tags are not allowed inside tagged unions."); + ResultType res = error(""); + bool match_found = false; + (set_if_disc_value_matches<_is>(_r, _disc_value, _var, &res, &match_found), + ...); + if (match_found) [[likely]] { + return res; + } else { + const auto names = PossibleTags::names(); + std::stringstream stream; + stream << "Could not parse tagged union, could not match " + << _discriminator.str() << " '" << _disc_value + << "'. The following tags are allowed: " + << internal::strings::join(", ", names); + return error(stream.str()); + } + } + + template + static void set_if_disc_value_matches(const R& _r, + const std::string& _disc_value, + const InputVarType& _var, + ResultType* _result, + bool* _match_found) { + using AlternativeType = std::remove_cvref_t< + std::variant_alternative_t<_i, std::variant>>; + + if (!*_match_found && contains_disc_value(_disc_value)) { + const auto get_fields = [](auto&& _val) -> AlternativeType { + if constexpr (is_tagged_union_wrapper_v) { + return std::move(_val.fields()); + } else { + return std::move(_val); + } + }; + + const auto to_tagged_union = [](auto&& _val) { + return TaggedUnion<_discriminator, AlternativeTypes...>( + std::move(_val)); + }; + + const auto embellish_error = [&](auto&& _e) { + std::stringstream stream; + stream << "Could not parse tagged union with " + "discrimininator " + << _discriminator.str() << " '" << _disc_value + << "': " << _e.what(); + return Error(stream.str()); + }; + + if constexpr (no_field_names_) { + using T = tagged_union_wrapper_no_ptr_t), AlternativeType>>; + *_result = Parser::read(_r, _var) + .transform(get_fields) + .transform(to_tagged_union) + .transform_error(embellish_error); + } else { + *_result = Parser::read(_r, _var) + .transform(to_tagged_union) + .transform_error(embellish_error); + } + + *_match_found = true; + } + } + + /// Retrieves the discriminator from an object + static Result get_discriminator( + const R& _r, const InputObjectOrArrayType& _obj_or_arr) noexcept { + const auto to_type = [&_r](auto _var) { + return _r.template to_basic_type(_var); + }; + + const auto embellish_error = [](const auto&) { + std::stringstream stream; + stream << "Could not parse tagged union: Could not find field '" + << _discriminator.str() << "' or type of field was not a string."; + return Error(stream.str()); + }; + + if constexpr (no_field_names_) { + return _r.get_field_from_array(0, _obj_or_arr) + .and_then(to_type) + .transform_error(embellish_error); + } else { + return _r.get_field_from_object(_discriminator.str(), _obj_or_arr) + .and_then(to_type) + .transform_error(embellish_error); + } + } + + /// Determines whether the discriminating literal contains the value + /// retrieved from the object. + template + static inline bool contains_disc_value( + const std::string& _disc_value) noexcept { + return internal::tag_t<_discriminator, T>::contains(_disc_value); + } + + /// Writes a wrapped version of the original object, which contains the tag. + template + static void write_wrapped(const W& _w, const T& _val, const P& _parent) { + const auto wrapped = wrap_if_necessary(_val); + Parser, ProcessorsType>::write( + _w, wrapped, _parent); + } + + /// Generates a wrapped version of the original object, which contains the + /// tag, if the object doesn't already contain the wrap. + template + static auto wrap_if_necessary(const T& _val) { + if constexpr (named_tuple_t::Names::template contains< + _discriminator>()) { + return _val; + } else { + const auto tag = internal::make_tag<_discriminator, T>(_val); + using TagType = std::remove_cvref_t; + if constexpr (internal::has_fields>()) { + using WrapperType = + TaggedUnionWrapperWithFields; + return WrapperType{.tag = tag, .fields = &_val}; + } else { + using WrapperType = + TaggedUnionWrapperNoFields; + return WrapperType{.tag = tag, .fields = &_val}; + } + } + } +}; + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_tuple.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_tuple.hpp new file mode 100644 index 0000000..b4b592b --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_tuple.hpp @@ -0,0 +1,23 @@ +#ifndef RFL_PARSING_PARSER_TUPLE_HPP_ +#define RFL_PARSING_PARSER_TUPLE_HPP_ + +#include + +#include "Parser_base.hpp" +#include "TupleParser.hpp" + +namespace rfl { +namespace parsing { + +template +requires AreReaderAndWriter> +struct Parser, ProcessorsType> + : public TupleParser> { +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_unique_ptr.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_unique_ptr.hpp new file mode 100644 index 0000000..344fdb3 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_unique_ptr.hpp @@ -0,0 +1,81 @@ +#ifndef RFL_PARSING_PARSER_UNIQUE_PTR_HPP_ +#define RFL_PARSING_PARSER_UNIQUE_PTR_HPP_ + +#include +#include +#include + +#include "../Ref.hpp" +#include "../Result.hpp" +#include "../always_false.hpp" +#include "Parent.hpp" +#include "Parser_base.hpp" +#include "schema/Type.hpp" +#include "schemaful/IsSchemafulReader.hpp" +#include "schemaful/IsSchemafulWriter.hpp" +#include "schemaful/UniquePtrReader.hpp" + +namespace rfl { +namespace parsing { + +template + requires AreReaderAndWriter> +struct Parser, ProcessorsType> { + using InputVarType = typename R::InputVarType; + + using ParentType = Parent; + + static Result> read(const R& _r, + const InputVarType& _var) noexcept { + if constexpr (schemaful::IsSchemafulReader) { + using S = schemaful::UniquePtrReader, + ProcessorsType>; + const auto to_unique = [&](const auto& _u) -> Result> { + return _r.template read_union, S>(_u); + }; + return _r.to_union(_var).and_then(to_unique); + } else { + if (_r.is_empty(_var)) { + return std::unique_ptr(); + } + return Parser, ProcessorsType>::read(_r, + _var) + .transform([](T&& _t) { return std::make_unique(std::move(_t)); }); + } + } + + template + static void write(const W& _w, const std::unique_ptr& _s, + const P& _parent) { + if constexpr (schemaful::IsSchemafulWriter) { + auto u = ParentType::add_union(_w, _parent); + using UnionType = typename ParentType::template Union; + auto p = + UnionType{.index_ = static_cast(_s ? 0 : 1), .union_ = &u}; + if (_s) { + Parser, ProcessorsType>::write(_w, *_s, p); + } else { + ParentType::add_null(_w, p); + } + } else { + if (_s) { + Parser, ProcessorsType>::write(_w, *_s, + _parent); + } else { + ParentType::add_null(_w, _parent); + } + } + } + + static schema::Type to_schema( + std::map* _definitions) { + using U = std::remove_cvref_t; + return schema::Type{schema::Type::Optional{Ref::make( + Parser::to_schema(_definitions))}}; + } +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_variant.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_variant.hpp new file mode 100644 index 0000000..2bfa3e8 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_variant.hpp @@ -0,0 +1,244 @@ +#ifndef RFL_PARSING_PARSER_VARIANT_HPP_ +#define RFL_PARSING_PARSER_VARIANT_HPP_ + +#include +#include +#include +#include + +#include "../NamedTuple.hpp" +#include "../Ref.hpp" +#include "../Result.hpp" +#include "../Variant.hpp" +#include "../always_false.hpp" +#include "../internal/all_fields.hpp" +#include "../internal/to_ptr_field.hpp" +#include "FieldVariantParser.hpp" +#include "Parent.hpp" +#include "Parser_base.hpp" +#include "VariantAlternativeWrapper.hpp" +#include "schema/Type.hpp" +#include "schemaful/IsSchemafulReader.hpp" +#include "schemaful/IsSchemafulWriter.hpp" +#include "schemaful/VariantReader.hpp" +#include "to_single_error_message.hpp" + +namespace rfl::parsing { + +template + requires AreReaderAndWriter> +class Parser, ProcessorsType> { + template + using ptr_field_t = + decltype(internal::to_ptr_field(std::declval())); + + using ParentType = Parent; + + public: + using InputVarType = typename R::InputVarType; + + static Result> read( + const R& _r, const InputVarType& _var) noexcept { + if constexpr (internal::all_fields>()) { + if constexpr (schemaful::IsSchemafulReader) { + using WrappedType = rfl::Variant...>; + return Parser::read(_r, _var) + .transform( + [](auto&& _variant) -> std::variant { + return std::move(_variant).visit([](auto&& _named_tuple) { + return std::variant(std::move( + std::move(_named_tuple).fields().template get<0>())); + }); + }); + + } else { + const auto wrap = [](auto&& _v) { + return std::variant(std::move(_v)); + }; + const auto to_std_variant = [&](auto&& _v) { + return rfl::visit(wrap, std::move(_v)); + }; + return FieldVariantParser::read(_r, _var) + .transform(to_std_variant); + } + + } else if constexpr (schemaful::IsSchemafulReader) { + using V = + schemaful::VariantReader, + ProcessorsType, AlternativeTypes...>; + return _r.to_union(_var).and_then([&](const auto& _u) { + return _r.template read_union, V>(_u); + }); + + } else if constexpr (ProcessorsType::add_tags_to_variants_ || + ProcessorsType::add_namespaced_tags_to_variants_) { + constexpr bool remove_namespaces = ProcessorsType::add_tags_to_variants_; + using FieldVariantType = rfl::Variant< + VariantAlternativeWrapper...>; + const auto from_field_variant = + [](auto&& _field) -> std::variant { + return std::move(_field.value()); + }; + return Parser::read(_r, _var) + .transform([&](FieldVariantType&& _f) { + return _f.visit(from_field_variant); + }); + + } else { + std::optional> result; + std::vector errors; + errors.reserve(sizeof...(AlternativeTypes)); + read_variant( + _r, _var, &result, &errors, + std::make_integer_sequence()); + if (result) { + return std::move(*result); + } else { + return error( + to_single_error_message(errors, + "Could not parse the variant. Each of the " + "possible alternatives failed " + "for the following reasons: ", + 100000)); + } + } + } + + template + static void write(const W& _w, + const std::variant& _variant, + const P& _parent) { + if constexpr (internal::all_fields>()) { + if constexpr (schemaful::IsSchemafulWriter) { + using WrappedType = rfl::Variant< + NamedTuple>...>; + const auto to_wrapped = [](const auto& _variant) -> WrappedType { + return std::visit( + [](const auto& _field) -> WrappedType { + return make_named_tuple(internal::to_ptr_field(_field)); + }, + _variant); + }; + Parser::write( + _w, to_wrapped(_variant), _parent); + + } else { + const auto wrap = [](const auto& _v) { + return rfl::Variant...>( + internal::to_ptr_field(_v)); + }; + const auto to_rfl_variant = [&](const auto& _v) { + return std::visit(wrap, _v); + }; + FieldVariantParser< + R, W, ProcessorsType, + ptr_field_t...>::write(_w, + to_rfl_variant(_variant), + _parent); + } + + } else if constexpr (schemaful::IsSchemafulWriter) { + return std::visit( + [&](const auto& _v) { + using Type = std::remove_cvref_t; + auto u = ParentType::add_union(_w, _parent); + using UnionType = typename ParentType::template Union; + auto p = UnionType{.index_ = static_cast(_variant.index()), + .union_ = &u}; + Parser::write(_w, _v, p); + }, + _variant); + + } else if constexpr (ProcessorsType::add_tags_to_variants_ || + ProcessorsType::add_namespaced_tags_to_variants_) { + constexpr bool remove_namespaces = ProcessorsType::add_tags_to_variants_; + using FieldVariantType = + rfl::Variant...>; + const auto to_field_variant = + [](const T& _t) -> FieldVariantType { + return VariantAlternativeWrapper(&_t); + }; + Parser::write( + _w, std::visit(to_field_variant, _variant), _parent); + + } else { + const auto handle = [&](const auto& _v) { + using Type = std::remove_cvref_t; + Parser::write(_w, _v, _parent); + }; + return std::visit(handle, _variant); + } + } + + static schema::Type to_schema( + std::map* _definitions) { + if constexpr (internal::all_fields>()) { + return FieldVariantParser::to_schema(_definitions); + + } else if constexpr (ProcessorsType::add_tags_to_variants_ || + ProcessorsType::add_namespaced_tags_to_variants_) { + constexpr bool remove_namespaces = ProcessorsType::add_tags_to_variants_; + using FieldVariantType = rfl::Variant< + VariantAlternativeWrapper...>; + return Parser::to_schema( + _definitions); + + } else { + std::vector types; + build_schema( + _definitions, &types, + std::make_integer_sequence()); + return schema::Type{schema::Type::AnyOf{.types_ = std::move(types)}}; + } + } + + private: + template + static void add_to_schema(std::map* _definitions, + std::vector* _types) noexcept { + using U = std::remove_cvref_t< + std::variant_alternative_t<_i, std::variant>>; + _types->push_back(Parser::to_schema(_definitions)); + } + + template + static void build_schema(std::map* _definitions, + std::vector* _types, + std::integer_sequence) noexcept { + (add_to_schema<_is>(_definitions, _types), ...); + } + + template + static void read_one_alternative( + const R& _r, const InputVarType& _var, + std::optional>* _result, + std::vector* _errors) noexcept { + if (!*_result) { + using AltType = + std::remove_cvref_t>; + auto res = Parser::read(_r, _var); + if (res) { + _result->emplace(std::move(*res)); + } else { + _errors->emplace_back(std::move(res.error())); + } + } + } + + template + static void read_variant( + const R& _r, const InputVarType& _var, + std::optional>* _result, + std::vector* _errors, + std::integer_sequence) noexcept { + (read_one_alternative<_is>(_r, _var, _result, _errors), ...); + } +}; + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_vector_like.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_vector_like.hpp new file mode 100644 index 0000000..8141215 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_vector_like.hpp @@ -0,0 +1,103 @@ +#ifndef RFL_PARSING_PARSER_VECTOR_LIKE_HPP_ +#define RFL_PARSING_PARSER_VECTOR_LIKE_HPP_ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../Result.hpp" +#include "../always_false.hpp" +#include "Parser_base.hpp" +#include "VectorParser.hpp" + +namespace rfl { +namespace parsing { + +template + requires AreReaderAndWriter> +struct Parser, ProcessorsType> + : public VectorParser, ProcessorsType> {}; + +template + requires AreReaderAndWriter> +struct Parser, ProcessorsType> + : public VectorParser, ProcessorsType> {}; + +template + requires AreReaderAndWriter> +struct Parser, ProcessorsType> + : public VectorParser, ProcessorsType> {}; + +template + requires AreReaderAndWriter> +struct Parser, ProcessorsType> + : public VectorParser, ProcessorsType> {}; + +template + requires AreReaderAndWriter> +struct Parser, ProcessorsType> + : public VectorParser, ProcessorsType> {}; + +template + requires AreReaderAndWriter> +struct Parser, ProcessorsType> + : public VectorParser, ProcessorsType> {}; + +template + requires AreReaderAndWriter> +struct Parser, ProcessorsType> + : public VectorParser, ProcessorsType> {}; + +template + requires AreReaderAndWriter< + R, W, std::unordered_map> +struct Parser, + ProcessorsType> + : public VectorParser, + ProcessorsType> {}; + +template + requires AreReaderAndWriter< + R, W, std::unordered_multiset> +struct Parser, + ProcessorsType> + : public VectorParser, + ProcessorsType> {}; + +template + requires AreReaderAndWriter< + R, W, std::unordered_multimap> +struct Parser, + ProcessorsType> + : public VectorParser, ProcessorsType> { +}; + +template + requires AreReaderAndWriter> +struct Parser, + ProcessorsType> + : public VectorParser, + ProcessorsType> {}; + +template + requires AreReaderAndWriter> +struct Parser, ProcessorsType> + : public VectorParser, ProcessorsType> {}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_vectorstring.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_vectorstring.hpp new file mode 100644 index 0000000..c4cbfd9 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_vectorstring.hpp @@ -0,0 +1,38 @@ +#ifndef RFL_PARSING_PARSER_VECTORSRING_HPP_ +#define RFL_PARSING_PARSER_VECTORSRING_HPP_ + +#include + +#include "../Result.hpp" +#include "../Vectorstring.hpp" +#include "Parent.hpp" +#include "Parser_base.hpp" +#include "schema/Type.hpp" + +namespace rfl::parsing { + +template + requires AreReaderAndWriter +struct Parser { + using InputVarType = typename R::InputVarType; + using ParentType = Parent; + + static Result read(const R& _r, + const InputVarType& _var) noexcept { + return _r.template to_basic_type(_var); + } + + template + static void write(const W& _w, const Vectorstring& _b, const P& _parent) { + ParentType::add_value(_w, _b, _parent); + } + + static schema::Type to_schema( + [[maybe_unused]] std::map* _definitions) { + return schema::Type{schema::Type::Vectorstring{}}; + } +}; + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/Parser_wstring.hpp b/build-config/reflect-cpp/include/rfl/parsing/Parser_wstring.hpp new file mode 100644 index 0000000..73ee2c4 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/Parser_wstring.hpp @@ -0,0 +1,81 @@ +#ifndef RFL_PARSING_PARSER_WSTRING_HPP_ +#define RFL_PARSING_PARSER_WSTRING_HPP_ + +#include + +#include "../Result.hpp" +#include "../always_false.hpp" +#include "Parent.hpp" +#include "Parser_base.hpp" +#include "schema/Type.hpp" + +namespace rfl { +namespace parsing { + +template + requires AreReaderAndWriter +struct Parser { + public: + using InputVarType = typename R::InputVarType; + + using ParentType = Parent; + + static Result read(const R& _r, + const InputVarType& _var) noexcept { + if (_r.is_empty(_var)) { + return std::wstring(); + } + + auto inStr = Parser::read(_r, _var); + if (!inStr) { + return Result(error(inStr.error())); + } + // if (auto err = inStr.error(); err.has_value()) { + // return Result(err.value()); + // } + + std::mbstate_t state = std::mbstate_t(); + auto val = inStr.value(); + + std::wstring outStr(val.size() * 2, L'\0'); + + // Explicitly set the size so we don't empty it when we truncate + outStr.resize(val.size() * 2); + + auto* ptr = val.c_str(); + + // Add 1 for null terminator + auto len = std::mbsrtowcs(outStr.data(), &ptr, val.size(), &state); + outStr.resize(len); // Truncate the extra bytes + + return Result(outStr); + } + + template + static void write(const W& _w, const std::wstring& _str, const P& _parent) { + if (_str.empty()) { + ParentType::add_value(_w, std::string(), _parent); + return; + } + + std::mbstate_t state = std::mbstate_t(); + std::string outStr(_str.size(), '\0'); + outStr.resize(_str.size()); + + auto* ptr = _str.c_str(); + auto len = std::wcsrtombs(outStr.data(), &ptr, _str.size(), &state); + outStr.resize(len); + + ParentType::add_value(_w, outStr, _parent); + } + + static schema::Type to_schema( + std::map* _definitions) { + return Parser::to_schema(_definitions); + } +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/SupportsTaggedUnions.hpp b/build-config/reflect-cpp/include/rfl/parsing/SupportsTaggedUnions.hpp new file mode 100644 index 0000000..971e41b --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/SupportsTaggedUnions.hpp @@ -0,0 +1,30 @@ +#ifndef RFL_PARSING_SUPPORTSTAGGEDUNIONS_HPP_ +#define RFL_PARSING_SUPPORTSTAGGEDUNIONS_HPP_ + +#include +#include + +#include "../Result.hpp" +#include "../internal/is_basic_type.hpp" +#include "../internal/wrap_in_rfl_array_t.hpp" + +namespace rfl::parsing { + +template +concept SupportsTaggedUnions = requires( + R r, std::string name, typename R::InputArrayType arr, + typename R::InputObjectType obj, typename R::InputVarType var, size_t idx) { + /// Retrieves a particular field from an array. + { + r.get_field_from_array(idx, arr) + } -> std::same_as>; + + /// Retrieves a particular field from an object. + { + r.get_field_from_object(name, obj) + } -> std::same_as>; +}; + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/TaggedUnionWrapper.hpp b/build-config/reflect-cpp/include/rfl/parsing/TaggedUnionWrapper.hpp new file mode 100644 index 0000000..2335f8e --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/TaggedUnionWrapper.hpp @@ -0,0 +1,37 @@ +#ifndef RFL_PARSING_TAGGEDUNIONWRAPPER_HPP_ +#define RFL_PARSING_TAGGEDUNIONWRAPPER_HPP_ + +#include + +#include "../Field.hpp" +#include "../Flatten.hpp" +#include "../Rename.hpp" +#include "../internal/StringLiteral.hpp" + +namespace rfl { +namespace parsing { + +template +struct TaggedUnionWrapperNoFields { + using Type = std::remove_cvref_t; + using FlattenedType = + std::conditional_t<_as_const_pointer, const Type*, Type>; + rfl::Rename<_discriminator, TagType> tag; + rfl::Flatten fields; +}; + +template +struct TaggedUnionWrapperWithFields { + using Type = T; + using FlattenedType = + std::conditional_t<_as_const_pointer, const Type*, Type>; + rfl::Field<_discriminator, TagType> tag; + rfl::Flatten fields; +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/TupleParser.hpp b/build-config/reflect-cpp/include/rfl/parsing/TupleParser.hpp new file mode 100644 index 0000000..bda8053 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/TupleParser.hpp @@ -0,0 +1,133 @@ +#ifndef RFL_PARSING_TUPLEPARSER_HPP_ +#define RFL_PARSING_TUPLEPARSER_HPP_ + +#include +#include +#include +#include + +#include "../Result.hpp" +#include "../Tuple.hpp" +#include "../always_false.hpp" +#include "../internal/nth_element_t.hpp" +#include "../internal/ptr_cast.hpp" +#include "Parent.hpp" +#include "TupleReader.hpp" +#include "call_destructors_on_tuple_where_necessary.hpp" +#include "schema/Type.hpp" +#include "schemaful/IsSchemafulReader.hpp" +#include "schemaful/IsSchemafulWriter.hpp" +#include "schemaful/tuple_to_named_tuple.hpp" +#include "schemaful/tuple_to_named_tuple_t.hpp" + +namespace rfl::parsing { + +template + requires AreReaderAndWriter +struct TupleParser { + public: + using InputArrayType = typename R::InputArrayType; + using InputVarType = typename R::InputVarType; + + using ParentType = Parent; + + static Result read(const R& _r, + const InputVarType& _var) noexcept { + if constexpr (schemaful::IsSchemafulReader) { + using NamedTupleType = schemaful::tuple_to_named_tuple_t; + const auto to_tuple = [](auto&& _named_tuple) { + return [&](std::integer_sequence) { + return TupleType(std::move(rfl::get<_is>(_named_tuple))...); + }(std::make_integer_sequence()); + }; + return Parser::read(_r, _var) + .transform(to_tuple); + + } else { + const auto parse = [&](const InputArrayType& _arr) -> Result { + alignas(TupleType) unsigned char buf[sizeof(TupleType)]{}; + auto ptr = internal::ptr_cast(&buf); + const auto tuple_reader = + TupleReader(&_r, ptr); + auto err = _r.read_array(tuple_reader, _arr); + if (err) { + call_destructors_on_tuple_where_necessary(tuple_reader.num_set(), + ptr); + return error(*err); + } + err = tuple_reader.handle_missing_fields(); + if (err) { + call_destructors_on_tuple_where_necessary(tuple_reader.num_set(), + ptr); + return error(*err); + } + auto res = Result(std::move(*ptr)); + call_destructors_on_tuple_where_necessary(tuple_reader.num_set(), ptr); + return res; + }; + + return _r.to_array(_var).and_then(parse); + } + } + + template + static void write(const W& _w, const TupleType& _tup, const P& _parent) { + if constexpr (schemaful::IsSchemafulWriter) { + const auto named_tuple = schemaful::tuple_to_named_tuple(_tup); + Parser, + ProcessorsType>::write(_w, named_tuple, _parent); + + } else { + constexpr auto size = rfl::tuple_size_v; + auto arr = ParentType::add_array(_w, size, _parent); + const auto new_parent = typename ParentType::Array{&arr}; + to_array(_w, _tup, new_parent, std::make_integer_sequence()); + _w.end_array(&arr); + } + } + + static schema::Type to_schema( + std::map* _definitions) { + std::vector types; + build_schema( + _definitions, &types, + std::make_integer_sequence>()); + return schema::Type{schema::Type::Tuple{.types_ = std::move(types)}}; + } + + private: + template + static void add_to_schema(std::map* _definitions, + std::vector* _types) noexcept { + using U = std::remove_cvref_t>; + _types->push_back(Parser::to_schema(_definitions)); + } + + template + static void build_schema(std::map* _definitions, + std::vector* _types, + std::integer_sequence) noexcept { + (add_to_schema<_is>(_definitions, _types), ...); + } + + template + static void add_to_array(const W& _w, const TupleType& _tup, + const P& _parent) { + using NewFieldType = + std::remove_cvref_t>; + Parser::write(_w, rfl::get<_i>(_tup), + _parent); + } + + template + static void to_array(const W& _w, const TupleType& _tup, const P& _parent, + std::integer_sequence) { + (add_to_array<_is>(_w, _tup, _parent), ...); + } +}; + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/TupleReader.hpp b/build-config/reflect-cpp/include/rfl/parsing/TupleReader.hpp new file mode 100644 index 0000000..c430445 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/TupleReader.hpp @@ -0,0 +1,127 @@ +#ifndef RFL_PARSING_TUPLEREADER_HPP_ +#define RFL_PARSING_TUPLEREADER_HPP_ + +#include +#include + +#include "../Result.hpp" +#include "../Tuple.hpp" +#include "../internal/is_array.hpp" +#include "AreReaderAndWriter.hpp" +#include "Parser_base.hpp" +#include "is_required.hpp" + +namespace rfl::parsing { + +template +class TupleReader { + private: + using InputVarType = typename R::InputVarType; + static constexpr size_t size_ = rfl::tuple_size_v; + + public: + TupleReader(const R* _r, TupleType* _tuple) + : num_set_(0), r_(_r), tuple_(_tuple) {} + + ~TupleReader() = default; + + std::optional handle_missing_fields() const { + std::optional err; + if (num_set_ < size_) { + handle_missing_fields_impl(&err); + } + return err; + } + + size_t num_set() const { return num_set_; } + + std::optional read(const InputVarType& _var) const { + std::optional err; + read_impl(_var, &err); + return err; + } + + private: + template + void handle_missing_fields_impl(std::optional* _err) const noexcept { + if constexpr (_i < size_) { + if (num_set_ == _i) { + using CurrentType = + std::remove_cvref_t>; + + if constexpr (_all_required || + is_required()) { + *_err = Error("Field " + std::to_string(_i) + + " was required, but missing."); + return; + } else { + ::new (&(rfl::get<_i>(*tuple_))) CurrentType(); + ++num_set_; + } + } + handle_missing_fields_impl<_i + 1>(_err); + } + } + + template + void read_impl(const InputVarType& _var, std::optional* _err) const { + if constexpr (_i < size_) { + if (num_set_ == _i) { + using CurrentType = + std::remove_cvref_t>; + + auto res = Parser::read(*r_, _var); + + if (res) { + move_to(&(rfl::get<_i>(*tuple_)), &(*res)); + ++num_set_; + } else { + std::stringstream stream; + stream << "Failed to parse field " << _i << ": " + << res.error().what(); + *_err = Error(stream.str()); + } + return; + } + read_impl<_i + 1>(_var, _err); + } else { + std::stringstream stream; + stream << "Expected " << size_ << " fields, but got at least one more."; + *_err = Error(stream.str()); + return; + } + } + + template + void move_to(Target* _t, Source* _s) const { + if constexpr (std::is_const_v) { + return move_to(const_cast*>(_t), _s); + } else if constexpr (!internal::is_array_v && + !std::is_array_v) { + ::new (_t) Target(std::move(*_s)); + } else if constexpr (internal::is_array_v) { + for (size_t i = 0; i < _s->arr_.size(); ++i) { + move_to(&((*_t)[i]), &(_s->arr_[i])); + } + } else { + for (size_t i = 0; i < _s->size(); ++i) { + move_to(&((*_t)[i]), &((*_s)[i])); + } + } + } + + private: + /// Indicates the last field that was set. + mutable size_t num_set_; + + /// The underlying reader. + const R* r_; + + /// The underlying tuple. + TupleType* tuple_; +}; + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/VariantAlternativeWrapper.hpp b/build-config/reflect-cpp/include/rfl/parsing/VariantAlternativeWrapper.hpp new file mode 100644 index 0000000..fe6215b --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/VariantAlternativeWrapper.hpp @@ -0,0 +1,50 @@ +#ifndef RFL_PARSING_VARIANTALTERNATIVEWRAPPER_HPP_ +#define RFL_PARSING_VARIANTALTERNATIVEWRAPPER_HPP_ + +#include + +#include "../Field.hpp" +#include "../Literal.hpp" +#include "../internal/StringLiteral.hpp" +#include "../internal/get_type_name.hpp" +#include "../internal/has_tag_v.hpp" +#include "../internal/remove_namespaces.hpp" + +namespace rfl::parsing { + +namespace vaw { + +template +struct GetName {}; + +template +struct GetName> { + constexpr static internal::StringLiteral name_ = _name; +}; + +template +consteval auto make_tag() { + if constexpr (internal::has_tag_v) { + return typename T::Tag(); + } else if constexpr (std::is_same_v, std::string>) { + return Literal<"std::string">(); + } else if constexpr (_remove_namespaces) { + return Literal< + internal::remove_namespaces()>()>(); + } else { + return Literal()>(); + } +} + +template +using tag_t = std::invoke_result_t< + decltype(make_tag>, _remove_namespaces>)>; + +} // namespace vaw + +template +using VariantAlternativeWrapper = Field>::name_, T>; + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/VectorParser.hpp b/build-config/reflect-cpp/include/rfl/parsing/VectorParser.hpp new file mode 100644 index 0000000..afbe673 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/VectorParser.hpp @@ -0,0 +1,128 @@ +#ifndef RFL_PARSING_VECTORPARSER_HPP_ +#define RFL_PARSING_VECTORPARSER_HPP_ + +#include +#include +#include +#include + +#include "../Bytestring.hpp" +#include "../Result.hpp" +#include "../Vectorstring.hpp" +#include "../always_false.hpp" +#include "MapParser.hpp" +#include "Parent.hpp" +#include "Parser_base.hpp" +#include "VectorReader.hpp" +#include "is_forward_list.hpp" +#include "is_map_like.hpp" +#include "is_map_like_not_multimap.hpp" +#include "is_set_like.hpp" +#include "schema/Type.hpp" + +namespace rfl { +namespace parsing { + +/// This can be used for data structures that would be expressed as array in +/// serialized format (std::vector, std::set, std::deque, ...), +/// but also includes map-like types, when the key is not of type +/// std::string. +template + requires AreReaderAndWriter +struct VectorParser { + public: + using InputArrayType = typename R::InputArrayType; + using InputVarType = typename R::InputVarType; + + using ParentType = Parent; + + using T = typename VecType::value_type; + + static_assert(!std::is_same_v, Bytestring>, + "Cannot be a bytestring."); + static_assert(!std::is_same_v, Vectorstring>, + "Cannot be a vectorstring."); + + static Result read(const R& _r, const InputVarType& _var) noexcept { + if constexpr (treat_as_map()) { + return MapParser::read(_r, _var); + } else if constexpr (is_forward_list()) { + const auto to_forward_list = [](auto&& vec) -> std::forward_list { + std::forward_list list; + for (auto it = vec.rbegin(); it != vec.rend(); ++it) { + list.emplace_front(std::move(*it)); + } + return list; + }; + return Parser, ProcessorsType>::read(_r, _var) + .transform(to_forward_list); + } else { + const auto parse = [&](const InputArrayType& _arr) -> Result { + VecType vec; + auto vector_reader = + VectorReader(&_r, &vec); + const auto err = _r.read_array(vector_reader, _arr); + if (err) { + return error(*err); + } + return vec; + }; + return _r.to_array(_var).and_then(parse); + } + } + + template + static void write(const W& _w, const VecType& _vec, const P& _parent) { + if constexpr (treat_as_map()) { + MapParser::write(_w, _vec, _parent); + } else { + auto arr = ParentType::add_array( + _w, std::distance(_vec.begin(), _vec.end()), _parent); + const auto new_parent = typename ParentType::Array{&arr}; + for (const auto& v : _vec) { + Parser, ProcessorsType>::write(_w, v, + new_parent); + } + _w.end_array(&arr); + } + } + + /// Generates a schema for the underlying type. + static schema::Type to_schema( + std::map* _definitions) { + if constexpr (treat_as_map()) { + return MapParser::to_schema(_definitions); + } else { + using Type = schema::Type; + return Type{Type::TypedArray{ + .type_ = Ref::make( + Parser::to_schema(_definitions))}}; + } + } + + private: + static constexpr bool treat_as_map() { + if constexpr (is_map_like_not_multimap()) { + if constexpr (internal::has_reflection_type_v) { + using U = std::remove_cvref_t; + return std::is_same() || std::is_integral_v || + std::is_floating_point_v; + + // We do not need std::string here, it is already caught by the template + // specialization. + } else if constexpr (std::is_integral_v || + std::is_floating_point_v) { + return true; + } else { + return false; + } + } else { + return false; + } + } +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/VectorReader.hpp b/build-config/reflect-cpp/include/rfl/parsing/VectorReader.hpp new file mode 100644 index 0000000..9082434 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/VectorReader.hpp @@ -0,0 +1,70 @@ +#ifndef RFL_PARSING_VECTORREADER_HPP_ +#define RFL_PARSING_VECTORREADER_HPP_ + +#include +#include + +#include "../Result.hpp" +#include "Parser_base.hpp" +#include "is_map_like.hpp" +#include "is_set_like.hpp" + +namespace rfl::parsing { + +template +class VectorReader { + private: + using InputVarType = typename R::InputVarType; + using T = typename VecType::value_type; + + public: + VectorReader(const R* _r, VecType* _vec) : r_(_r), vec_(_vec) {} + + ~VectorReader() = default; + + std::optional read(const InputVarType& _var) const { + const auto parse = [this](const InputVarType& _var) { + if constexpr (is_map_like_v) { + return get_pair(_var); + } else { + return Parser, ProcessorsType>::read(*r_, + _var); + } + }; + + const auto insert = [this](auto&& _var) -> std::optional { + if constexpr (is_map_like_v || is_set_like_v) { + vec_->insert(std::move(_var)); + } else { + vec_->emplace_back(std::move(_var)); + } + return std::nullopt; + }; + auto res = parse(_var).transform(insert); + if (res) { + return std::nullopt; + } else { + return res.error(); + } + // return parse(_var).transform(insert).error(); + } + + private: + auto get_pair(const auto& _var) const { + using K = std::remove_cvref_t; + using V = std::remove_cvref_t; + return Parser>, + ProcessorsType>::read(*r_, _var); + } + + private: + /// The underlying reader. + const R* r_; + + /// The underlying vector. + VecType* vec_; +}; + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/ViewReader.hpp b/build-config/reflect-cpp/include/rfl/parsing/ViewReader.hpp new file mode 100644 index 0000000..93a7970 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/ViewReader.hpp @@ -0,0 +1,192 @@ +#ifndef RFL_PARSING_VIEWREADER_HPP_ +#define RFL_PARSING_VIEWREADER_HPP_ + +#include +#include +#include +#include +#include +#include + +#include "../Result.hpp" +#include "../Tuple.hpp" +#include "../internal/is_array.hpp" +#include "Parser_base.hpp" +#include "schemaful/IsSchemafulReader.hpp" + +namespace rfl::parsing { + +template +class ViewReader { + private: + using InputVarType = typename R::InputVarType; + static constexpr size_t size_ = ViewType::size(); + + public: + ViewReader(const R* _r, ViewType* _view, std::array* _found, + std::array* _set, std::vector* _errors) + : r_(_r), view_(_view), found_(_found), set_(_set), errors_(_errors) {} + + ~ViewReader() = default; + + /// Assigns the parsed version of _var to the field signified by _name, if + /// such a field exists in the underlying view. + void read(const std::string_view& _name, const InputVarType& _var) const { + assign_to_matching_field(*r_, _name, _var, view_, errors_, found_, set_, + std::make_integer_sequence()); + } + + /// Assigns the parsed version of _var to the field signified by _index, if + /// such a field exists in the underlying view. + /// Note that schemaful formats can assign by index. + void read(const int _index, const InputVarType& _var) const { + assign_to_matching_field(*r_, _index, _var, view_, errors_, found_, set_, + std::make_integer_sequence()); + } + + private: + template + static bool is_matching(const int _current_index) { + return _current_index == i; + } + + template + static bool is_matching(const std::string_view& _current_name) { + return _current_name == FieldType::name(); + } + + template + static void assign_if_field_matches(const R& _r, + const auto _current_name_or_index, + const auto& _var, auto* _view, + auto* _errors, auto* _found, auto* _set, + bool* _already_assigned) { + using FieldType = tuple_element_t; + using OriginalType = typename FieldType::Type; + using T = + std::remove_cvref_t>; + constexpr auto name = FieldType::name(); + if (!(*_already_assigned) && !std::get(*_found) && + is_matching(_current_name_or_index)) { + std::get(*_found) = true; + *_already_assigned = true; + auto res = Parser::read(_r, _var); + if (!res) { + std::stringstream stream; + stream << "Failed to parse field '" << std::string(name) + << "': " << res.error().what(); + _errors->emplace_back(Error(stream.str())); + return; + } + if constexpr (std::is_pointer_v) { + move_to(rfl::get(*_view), &(*res)); + } else { + rfl::get(*_view) = std::move(*res); + } + std::get(*_set) = true; + } + } + + template + static void assign_to_extra_fields(const R& _r, + const std::string_view& _current_name, + const auto& _var, auto* _view, + auto* _errors, auto* _found, auto* _set) { + auto* extra_fields = _view->template get<_pos>(); + using ExtraFieldsType = + std::remove_cvref_t>; + using T = std::remove_cvref_t< + std::remove_pointer_t>; + if (!std::get<_pos>(*_set)) { + ::new (extra_fields) ExtraFieldsType(); + std::get<_pos>(*_set) = true; + std::get<_pos>(*_found) = true; + } + auto res = Parser::read(_r, _var); + if (!res) { + std::stringstream stream; + stream << "Failed to parse field '" << _current_name + << "': " << res.error().what(); + _errors->emplace_back(Error(stream.str())); + return; + } + extra_fields->emplace(std::string(_current_name), std::move(*res)); + } + + template + static void assign_to_matching_field(const R& _r, + const auto _current_name_or_index, + const auto& _var, auto* _view, + auto* _errors, auto* _found, auto* _set, + std::integer_sequence) { + bool already_assigned = false; + + (assign_if_field_matches(_r, _current_name_or_index, _var, _view, + _errors, _found, _set, &already_assigned), + ...); + + if constexpr (ViewType::pos_extra_fields() != -1) { + static_assert(!schemaful::IsSchemafulReader, + "rfl::ExtraFields are not supported for schemaful formats, " + "because schemaful formats cannot have extra fields."); + constexpr int pos = ViewType::pos_extra_fields(); + if (!already_assigned) { + assign_to_extra_fields(_r, _current_name_or_index, _var, _view, + _errors, _found, _set); + } + } else if constexpr (ProcessorsType::no_extra_fields_) { + static_assert( + !schemaful::IsSchemafulReader, + "Passing rfl::NoExtraFields to a schemaful format does not make " + "sense, because schemaful formats cannot have extra fields."); + if (!already_assigned) { + std::stringstream stream; + stream << "Value named '" << _current_name_or_index + << "' not used. Remove the rfl::NoExtraFields processor or add " + "rfl::ExtraFields to avoid this error message."; + _errors->emplace_back(Error(stream.str())); + } + } + } + + template + static void move_to(Target* _t, Source* _s) { + if constexpr (std::is_const_v) { + return move_to(const_cast*>(_t), _s); + } else if constexpr (!rfl::internal::is_array_v && + !std::is_array_v) { + ::new (_t) Target(std::move(*_s)); + } else if constexpr (rfl::internal::is_array_v) { + static_assert(std::is_array_v, + "Expected target to be a c-array."); + for (size_t i = 0; i < _s->arr_.size(); ++i) { + move_to(&((*_t)[i]), &(_s->arr_[i])); + } + } else { + for (size_t i = 0; i < _s->size(); ++i) { + move_to(&((*_t)[i]), &((*_s)[i])); + } + } + } + + private: + /// The underlying reader. + const R* r_; + + /// The underlying view. + ViewType* view_; + + /// Indicates that a certain field has been found. + std::array* found_; + + /// Indicates that a certain field has been successfully set - necessary, + /// because we have to trigger the destructors manually. + std::array* set_; + + /// Collects any errors we may have come across. + std::vector* errors_; +}; + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/ViewReaderWithDefault.hpp b/build-config/reflect-cpp/include/rfl/parsing/ViewReaderWithDefault.hpp new file mode 100644 index 0000000..8ee2d79 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/ViewReaderWithDefault.hpp @@ -0,0 +1,160 @@ +#ifndef RFL_PARSING_VIEWREADERWITHDEFAULT_HPP_ +#define RFL_PARSING_VIEWREADERWITHDEFAULT_HPP_ + +#include +#include +#include +#include +#include +#include + +#include "../Ref.hpp" +#include "../Result.hpp" +#include "../Tuple.hpp" +#include "../internal/is_array.hpp" +#include "Parser_base.hpp" + +namespace rfl::parsing { + +template +class ViewReaderWithDefault { + private: + using InputVarType = typename R::InputVarType; + static constexpr size_t size_ = ViewType::size(); + + public: + ViewReaderWithDefault(const R* _r, ViewType* _view, + std::vector* _errors) + : r_(_r), view_(_view), errors_(_errors) { + found_->fill(false); + } + + ~ViewReaderWithDefault() = default; + + const std::array& found() const { return *found_; } + + /// Assigns the parsed version of _var to the field signified by _name, if + /// such a field exists in the underlying view. + void read(const std::string_view& _name, const InputVarType& _var) const { + assign_to_matching_field(*r_, _name, _var, view_, errors_, found_.get(), + std::make_integer_sequence()); + } + + private: + template + static void assign_if_field_matches(const R& _r, + const std::string_view& _current_name, + const auto& _var, auto* _view, + auto* _errors, auto* _found, + bool* _already_assigned) { + using FieldType = tuple_element_t; + using OriginalType = typename FieldType::Type; + using T = + std::remove_cvref_t>; + constexpr auto name = FieldType::name(); + if (!(*_already_assigned) && !std::get(*_found) && + _current_name == name) { + std::get(*_found) = true; + *_already_assigned = true; + auto res = Parser::read(_r, _var); + if (!res) { + std::stringstream stream; + stream << "Failed to parse field '" << std::string(name) + << "': " << res.error().what(); + _errors->emplace_back(Error(stream.str())); + return; + } + if constexpr (std::is_pointer_v) { + move_to(rfl::get(*_view), &(*res)); + } else { + rfl::get(*_view) = std::move(*res); + } + } + } + + template + static void assign_to_extra_fields(const R& _r, + const std::string_view& _current_name, + const auto& _var, auto* _view, + auto* _errors) { + auto* extra_fields = _view->template get<_pos>(); + using ExtraFieldsType = + std::remove_cvref_t>; + using T = std::remove_cvref_t< + std::remove_pointer_t>; + auto res = Parser::read(_r, _var); + if (!res) { + std::stringstream stream; + stream << "Failed to parse field '" << _current_name + << "': " << res.error().what(); + _errors->emplace_back(Error(stream.str())); + return; + } + extra_fields->emplace(std::string(_current_name), std::move(*res)); + } + + template + static void assign_to_matching_field(const R& _r, + const std::string_view& _current_name, + const auto& _var, auto* _view, + auto* _errors, auto* _found, + std::integer_sequence) { + bool already_assigned = false; + + (assign_if_field_matches(_r, _current_name, _var, _view, _errors, + _found, &already_assigned), + ...); + + if constexpr (ViewType::pos_extra_fields() != -1) { + constexpr int pos = ViewType::pos_extra_fields(); + if (!already_assigned) { + assign_to_extra_fields(_r, _current_name, _var, _view, _errors); + } + } else if constexpr (ProcessorsType::no_extra_fields_) { + if (!already_assigned) { + std::stringstream stream; + stream << "Value named '" << std::string(_current_name) + << "' not used. Remove the rfl::NoExtraFields processor or add " + "rfl::ExtraFields to avoid this error message."; + _errors->emplace_back(Error(stream.str())); + } + } + } + + template + static void move_to(Target* _t, Source* _s) { + if constexpr (std::is_const_v) { + return move_to(const_cast*>(_t), _s); + } else if constexpr (!rfl::internal::is_array_v && + !std::is_array_v) { + *_t = Target(std::move(*_s)); + } else if constexpr (rfl::internal::is_array_v) { + static_assert(std::is_array_v, + "Expected target to be a c-array."); + for (size_t i = 0; i < _s->arr_.size(); ++i) { + move_to(&((*_t)[i]), &(_s->arr_[i])); + } + } else { + for (size_t i = 0; i < _s->size(); ++i) { + move_to(&((*_t)[i]), &((*_s)[i])); + } + } + } + + private: + /// The underlying reader. + const R* r_; + + /// The underlying view. + ViewType* view_; + + /// Indicates that a certain field has been found. + rfl::Ref> found_; + + /// Collects any errors we may have come across. + std::vector* errors_; +}; + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/ViewReaderWithDefaultAndStrippedFieldNames.hpp b/build-config/reflect-cpp/include/rfl/parsing/ViewReaderWithDefaultAndStrippedFieldNames.hpp new file mode 100644 index 0000000..7b12a2d --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/ViewReaderWithDefaultAndStrippedFieldNames.hpp @@ -0,0 +1,122 @@ +#ifndef RFL_PARSING_VIEWREADERWITHDEFAULTANDSTRIPPEDFIELDNAMES_HPP_ +#define RFL_PARSING_VIEWREADERWITHDEFAULTANDSTRIPPEDFIELDNAMES_HPP_ + +#include +#include +#include +#include +#include + +#include "../Result.hpp" +#include "../Tuple.hpp" +#include "../internal/is_array.hpp" +#include "Parser_base.hpp" + +namespace rfl::parsing { + +template +class ViewReaderWithDefaultAndStrippedFieldNames { + private: + using InputVarType = typename R::InputVarType; + static constexpr size_t size_ = ViewType::size(); + + public: + ViewReaderWithDefaultAndStrippedFieldNames(const R* _r, ViewType* _view, + std::vector* _errors) + : i_(0), r_(_r), view_(_view), errors_(_errors) {} + + ~ViewReaderWithDefaultAndStrippedFieldNames() = default; + + std::array found() const { + std::array f; + std::fill(f.begin(), f.begin() + i_, true); + std::fill(f.begin() + i_, f.end(), false); + return f; + } + + /// Assigns the parsed version of _var to the field signified by i_, to be + /// used when the field names are stripped. + std::optional read(const InputVarType& _var) const { + if (i_ == size_) { + std::stringstream stream; + stream << "Expected a maximum of " << std::to_string(size_) + << " fields, but got at least one more."; + return Error(stream.str()); + } + assign_to_field_i(*r_, _var, view_, errors_, i_, + std::make_integer_sequence()); + ++i_; + return std::nullopt; + } + + private: + template + static void assign_if_field_is_field_i(const R& _r, const auto& _var, + auto* _view, auto* _errors, int _i) { + using FieldType = tuple_element_t; + using OriginalType = typename FieldType::Type; + using T = + std::remove_cvref_t>; + constexpr auto name = FieldType::name(); + if (_i == i) { + auto res = Parser::read(_r, _var); + if (!res) { + std::stringstream stream; + stream << "Failed to parse field '" << std::string(name) + << "': " << res.error().what(); + _errors->emplace_back(Error(stream.str())); + return; + } + if constexpr (std::is_pointer_v) { + move_to(rfl::get(*_view), &(*res)); + } else { + rfl::get(*_view) = std::move(*res); + } + } + } + + template + static void assign_to_field_i(const R& _r, const auto& _var, auto* _view, + auto* _errors, int _i, + std::integer_sequence) { + (assign_if_field_is_field_i(_r, _var, _view, _errors, _i), ...); + } + + // TODO: Unnecessary code duplication. + template + static void move_to(Target* _t, Source* _s) { + if constexpr (std::is_const_v) { + return move_to(const_cast*>(_t), _s); + } else if constexpr (!rfl::internal::is_array_v && + !std::is_array_v) { + *_t = Target(std::move(*_s)); + } else if constexpr (rfl::internal::is_array_v) { + static_assert(std::is_array_v, + "Expected target to be a c-array."); + for (size_t i = 0; i < _s->arr_.size(); ++i) { + move_to(&((*_t)[i]), &(_s->arr_[i])); + } + } else { + for (size_t i = 0; i < _s->size(); ++i) { + move_to(&((*_t)[i]), &((*_s)[i])); + } + } + } + + private: + /// Indicates the current field. + mutable int i_; + + /// The underlying reader. + const R* r_; + + /// The underlying view. + ViewType* view_; + + /// Collects any errors we may have come across. + std::vector* errors_; +}; + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/ViewReaderWithStrippedFieldNames.hpp b/build-config/reflect-cpp/include/rfl/parsing/ViewReaderWithStrippedFieldNames.hpp new file mode 100644 index 0000000..5787a1e --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/ViewReaderWithStrippedFieldNames.hpp @@ -0,0 +1,134 @@ +#ifndef RFL_PARSING_VIEWREADERWITHSTRIPPEDFIELDNAMES_HPP_ +#define RFL_PARSING_VIEWREADERWITHSTRIPPEDFIELDNAMES_HPP_ + +#include +#include +#include +#include +#include +#include + +#include "../Result.hpp" +#include "../Tuple.hpp" +#include "../internal/is_array.hpp" +#include "Parser_base.hpp" + +namespace rfl::parsing { + +template +class ViewReaderWithStrippedFieldNames { + private: + using InputVarType = typename R::InputVarType; + static constexpr size_t size_ = ViewType::size(); + + public: + ViewReaderWithStrippedFieldNames(const R* _r, ViewType* _view, + std::array* _found, + std::array* _set, + std::vector* _errors) + : i_(0), + r_(_r), + view_(_view), + found_(_found), + set_(_set), + errors_(_errors) {} + + ~ViewReaderWithStrippedFieldNames() = default; + + /// Assigns the parsed version of _var to the field signified by i_, to be + /// used when the field names are stripped. + std::optional read(const InputVarType& _var) const { + if (i_ == size_) { + std::stringstream stream; + stream << "Expected a maximum of " << std::to_string(size_) + << " fields, but got at least one more."; + return Error(stream.str()); + } + assign_to_field_i(*r_, _var, view_, errors_, found_, set_, i_, + std::make_integer_sequence()); + ++i_; + return std::nullopt; + } + + private: + template + static void assign_if_field_is_field_i(const R& _r, const auto& _var, + auto* _view, auto* _errors, + auto* _found, auto* _set, int _i) { + using FieldType = tuple_element_t; + using OriginalType = typename FieldType::Type; + using T = + std::remove_cvref_t>; + constexpr auto name = FieldType::name(); + if (_i == i) { + std::get(*_found) = true; + auto res = Parser::read(_r, _var); + if (!res) { + std::stringstream stream; + stream << "Failed to parse field '" << std::string(name) + << "': " << res.error().what(); + _errors->emplace_back(Error(stream.str())); + return; + } + if constexpr (std::is_pointer_v) { + move_to(rfl::get(*_view), &(*res)); + } else { + rfl::get(*_view) = std::move(*res); + } + std::get(*_set) = true; + } + } + + template + static void assign_to_field_i(const R& _r, const auto& _var, auto* _view, + auto* _errors, auto* _found, auto* _set, int _i, + std::integer_sequence) { + (assign_if_field_is_field_i(_r, _var, _view, _errors, _found, _set, _i), + ...); + } + + // TODO: Unnecessary code duplication. + template + static void move_to(Target* _t, Source* _s) { + if constexpr (std::is_const_v) { + return move_to(const_cast*>(_t), _s); + } else if constexpr (!rfl::internal::is_array_v && + !std::is_array_v) { + ::new (_t) Target(std::move(*_s)); + } else if constexpr (rfl::internal::is_array_v) { + static_assert(std::is_array_v, + "Expected target to be a c-array."); + for (size_t i = 0; i < _s->arr_.size(); ++i) { + move_to(&((*_t)[i]), &(_s->arr_[i])); + } + } else { + for (size_t i = 0; i < _s->size(); ++i) { + move_to(&((*_t)[i]), &((*_s)[i])); + } + } + } + + private: + /// Indicates the current field. + mutable int i_; + + /// The underlying reader. + const R* r_; + + /// The underlying view. + ViewType* view_; + + /// Indicates that a certain field has been found. + std::array* found_; + + /// Indicates that a certain field has been successfully set - necessary, + /// because we have to trigger the destructors manually. + std::array* set_; + + /// Collects any errors we may have come across. + std::vector* errors_; +}; + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/call_destructors_on_array_where_necessary.hpp b/build-config/reflect-cpp/include/rfl/parsing/call_destructors_on_array_where_necessary.hpp new file mode 100644 index 0000000..1b02d3f --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/call_destructors_on_array_where_necessary.hpp @@ -0,0 +1,30 @@ +#ifndef RFL_PARSING_CALL_DESTRUCTORS_ON_ARRAY_WHERE_NECESSARY_HPP_ +#define RFL_PARSING_CALL_DESTRUCTORS_ON_ARRAY_WHERE_NECESSARY_HPP_ + +#include +#include + +#include "call_destructors_where_necessary.hpp" + +namespace rfl::parsing { + +/// Because of the way we have allocated the fields, we need to manually +/// trigger the destructors. + +template +void call_destructors_on_array_where_necessary(const size_t _num_set, + std::array* _array) { + for (size_t i = 0; i < std::min(_num_set, _size); ++i) { + if constexpr (!std::is_array_v && + std::is_destructible_v>) { + (*_array)[i].~T(); + } else if constexpr (std::is_array_v) { + auto ptr = (*_array)[i]; + call_destructor_on_array(sizeof(*ptr) / sizeof(**ptr), *ptr); + } + } +} + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/call_destructors_on_tuple_where_necessary.hpp b/build-config/reflect-cpp/include/rfl/parsing/call_destructors_on_tuple_where_necessary.hpp new file mode 100644 index 0000000..88004a0 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/call_destructors_on_tuple_where_necessary.hpp @@ -0,0 +1,45 @@ +#ifndef RFL_PARSING_CALL_DESTRUCTORS_ON_TUPLE_WHERE_NECESSARY_HPP_ +#define RFL_PARSING_CALL_DESTRUCTORS_ON_TUPLE_WHERE_NECESSARY_HPP_ + +#include + +#include "../Tuple.hpp" +#include "call_destructors_where_necessary.hpp" + +namespace rfl::parsing { + +/// Because of the way we have allocated the fields, we need to manually +/// trigger the destructors. + +template +void call_destructor_on_one_tuple_element_if_necessary(const size_t _num_set, + TupleType* _tup) { + using FieldType = tuple_element_t<_i, TupleType>; + using ValueType = std::remove_cv_t>; + if constexpr (!std::is_array_v && + std::is_destructible_v) { + if (_i < _num_set) { + rfl::get<_i>(*_tup).~ValueType(); + } + } else if constexpr (std::is_array_v) { + if (_i < _num_set) { + auto ptr = rfl::get<_i>(*_tup); + call_destructor_on_array(sizeof(*ptr) / sizeof(**ptr), *ptr); + } + } +} + +template +void call_destructors_on_tuple_where_necessary(const size_t _num_set, + TupleType* _tup) { + [&](std::integer_sequence) { + (call_destructor_on_one_tuple_element_if_necessary< + TupleType, rfl::tuple_size_v, is>(_num_set, _tup), + ...); + } + (std::make_integer_sequence>()); +} + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/call_destructors_where_necessary.hpp b/build-config/reflect-cpp/include/rfl/parsing/call_destructors_where_necessary.hpp new file mode 100644 index 0000000..3862afa --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/call_destructors_where_necessary.hpp @@ -0,0 +1,57 @@ +#ifndef RFL_PARSING_CALL_DESTRUCTORS_WHERE_NECESSARY_HPP_ +#define RFL_PARSING_CALL_DESTRUCTORS_WHERE_NECESSARY_HPP_ + +#include +#include + +#include "../get.hpp" + +namespace rfl::parsing { + +/// Because of the way we have allocated the fields, we need to manually +/// trigger the destructors. + +template +void call_destructor_on_array(const size_t _size, T* _ptr) { + for (size_t i = 0; i < _size; ++i) { + if constexpr (std::is_array_v) { + call_destructor_on_array(sizeof(*_ptr) / sizeof(**_ptr), *(_ptr + i)); + } else if constexpr (std::is_destructible_v>) { + (_ptr + i)->~T(); + } + } +} + +template +void call_destructor_on_one_if_necessary(const std::array& _set, + ViewType* _view) { + using FieldType = tuple_element_t<_i, typename ViewType::Fields>; + using OriginalType = std::remove_cv_t; + using ValueType = + std::remove_cvref_t>; + if constexpr (!std::is_array_v && + std::is_pointer_v && + std::is_destructible_v) { + if (std::get<_i>(_set)) { + rfl::get<_i>(*_view)->~ValueType(); + } + } else if constexpr (std::is_array_v) { + if (std::get<_i>(_set)) { + auto ptr = rfl::get<_i>(*_view); + call_destructor_on_array(sizeof(*ptr) / sizeof(**ptr), *ptr); + } + } +} + +template +void call_destructors_where_necessary(const std::array& _set, + ViewType* _view) { + [&](std::integer_sequence) { + (call_destructor_on_one_if_necessary(_set, _view), + ...); + }(std::make_integer_sequence()); +} + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/is_empty.hpp b/build-config/reflect-cpp/include/rfl/parsing/is_empty.hpp new file mode 100644 index 0000000..4c596d3 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/is_empty.hpp @@ -0,0 +1,42 @@ +#ifndef RFL_PARSING_IS_EMPTY_HPP_ +#define RFL_PARSING_IS_EMPTY_HPP_ + +#include + +#include "../internal/has_reflection_method_v.hpp" +#include "../internal/has_reflection_type_v.hpp" +#include "../internal/is_rename.hpp" +#include "../internal/is_skip.hpp" +#include "is_map_like.hpp" +#include "is_vector_like.hpp" + +namespace rfl { +namespace parsing { + +template +static bool is_empty(const T& _var) { + using Type = std::remove_cvref_t; + if constexpr (std::is_pointer_v) { + return !_var || is_empty(*_var); + } else if constexpr (internal::is_skip_v) { + return Type::skip_serialization_; + } else if constexpr (internal::has_reflection_type_v) { + if constexpr (internal::has_reflection_method_v) { + return is_empty(_var.reflection()); + } else { + const auto& [r] = _var; + return is_empty(r); + } + } else if constexpr (internal::is_rename_v) { + return is_empty(_var.value()); + } else if constexpr (is_map_like_v || is_vector_like_v) { + return _var.begin() == _var.end(); + } else { + return !_var; + } +} + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/is_forward_list.hpp b/build-config/reflect-cpp/include/rfl/parsing/is_forward_list.hpp new file mode 100644 index 0000000..2ac6fe7 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/is_forward_list.hpp @@ -0,0 +1,22 @@ +#ifndef RFL_PARSING_IS_FORWARD_LIST_HPP_ +#define RFL_PARSING_IS_FORWARD_LIST_HPP_ + +#include +#include + +namespace rfl { +namespace parsing { + +template +class is_forward_list; + +template +class is_forward_list : public std::false_type {}; + +template +class is_forward_list> : public std::true_type {}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/is_map_like.hpp b/build-config/reflect-cpp/include/rfl/parsing/is_map_like.hpp new file mode 100644 index 0000000..82f6002 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/is_map_like.hpp @@ -0,0 +1,38 @@ +#ifndef RFL_PARSING_IS_MAP_LIKE_HPP_ +#define RFL_PARSING_IS_MAP_LIKE_HPP_ + +#include +#include +#include + +namespace rfl { +namespace parsing { + +template +class is_map_like; + +template +class is_map_like : public std::false_type {}; + +template +class is_map_like> : public std::true_type {}; + +template +class is_map_like> : public std::true_type {}; + +template +class is_map_like> + : public std::true_type {}; + +template +class is_map_like> + : public std::true_type {}; + +template +constexpr bool is_map_like_v = + is_map_like>>::value; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/is_map_like_not_multimap.hpp b/build-config/reflect-cpp/include/rfl/parsing/is_map_like_not_multimap.hpp new file mode 100644 index 0000000..6481160 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/is_map_like_not_multimap.hpp @@ -0,0 +1,28 @@ +#ifndef RFL_PARSING_IS_MAP_LIKE_NOT_MULTIMAP_HPP_ +#define RFL_PARSING_IS_MAP_LIKE_NOT_MULTIMAP_HPP_ + +#include +#include +#include + +namespace rfl { +namespace parsing { + +template +class is_map_like_not_multimap; + +template +class is_map_like_not_multimap : public std::false_type {}; + +template +class is_map_like_not_multimap> : public std::true_type {}; + +template +class is_map_like_not_multimap< + std::unordered_map> + : public std::true_type {}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/is_required.hpp b/build-config/reflect-cpp/include/rfl/parsing/is_required.hpp new file mode 100644 index 0000000..bc4cb54 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/is_required.hpp @@ -0,0 +1,58 @@ +#ifndef RFL_PARSING_IS_REQUIRED_HPP_ +#define RFL_PARSING_IS_REQUIRED_HPP_ + +#include +#include +#include + +#include "../Generic.hpp" +#include "../Rename.hpp" +#include "../internal/StringLiteral.hpp" +#include "../internal/has_reflection_type_v.hpp" +#include "../internal/is_rename.hpp" +#include "is_map_like.hpp" +#include "is_vector_like.hpp" + +namespace rfl { +namespace parsing { + +/// Determines whether a field in a named tuple is required. +/// General case - most fields are required. +template +class is_never_required; + +template +class is_never_required : public std::false_type {}; + +template +class is_never_required> : public std::true_type {}; + +template +class is_never_required> : public std::true_type {}; + +template +class is_never_required> : public std::true_type {}; + +template +constexpr bool is_never_required_v = is_never_required::value; + +template +consteval bool is_required() { + using Type = std::remove_cvref_t>; + if constexpr (internal::has_reflection_type_v && + !std::is_same_v) { + return is_required(); + } else if constexpr (internal::is_rename_v) { + return is_required(); + } else { + return !(is_never_required_v || + (_ignore_empty_containers && + (is_vector_like_v || is_map_like_v))); + } +} + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/is_set_like.hpp b/build-config/reflect-cpp/include/rfl/parsing/is_set_like.hpp new file mode 100644 index 0000000..1ccf1fc --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/is_set_like.hpp @@ -0,0 +1,37 @@ +#ifndef RFL_PARSING_IS_SET_LIKE_HPP_ +#define RFL_PARSING_IS_SET_LIKE_HPP_ + +#include +#include +#include + +namespace rfl { +namespace parsing { + +template +class is_set_like; + +template +class is_set_like : public std::false_type {}; + +template +class is_set_like> : public std::true_type {}; + +template +class is_set_like> : public std::true_type {}; + +template +class is_set_like> : public std::true_type {}; + +template +class is_set_like> : public std::true_type {}; + +template +constexpr bool is_set_like_v = + is_set_like>>::value; + +} // namespace parsing + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/is_tagged_union_wrapper.hpp b/build-config/reflect-cpp/include/rfl/parsing/is_tagged_union_wrapper.hpp new file mode 100644 index 0000000..31e0bcc --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/is_tagged_union_wrapper.hpp @@ -0,0 +1,37 @@ +#ifndef RFL_PARSING_ISTAGGEDUNIONWRAPPER_HPP_ +#define RFL_PARSING_ISTAGGEDUNIONWRAPPER_HPP_ + +#include + +#include "../internal/StringLiteral.hpp" +#include "TaggedUnionWrapper.hpp" + +namespace rfl { +namespace parsing { + +template +class is_tagged_union_wrapper; + +template +class is_tagged_union_wrapper : public std::false_type {}; + +template +class is_tagged_union_wrapper< + TaggedUnionWrapperNoFields> + : public std::true_type {}; + +template +class is_tagged_union_wrapper< + TaggedUnionWrapperWithFields> + : public std::true_type {}; + +template +constexpr bool is_tagged_union_wrapper_v = + is_tagged_union_wrapper>::value; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/is_vector_like.hpp b/build-config/reflect-cpp/include/rfl/parsing/is_vector_like.hpp new file mode 100644 index 0000000..d48bee4 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/is_vector_like.hpp @@ -0,0 +1,51 @@ +#ifndef RFL_PARSING_IS_VECTOR_LIKE_HPP_ +#define RFL_PARSING_IS_VECTOR_LIKE_HPP_ + +#include +#include +#include +#include +#include +#include + +namespace rfl { +namespace parsing { + +template +class is_vector_like; + +template +class is_vector_like : public std::false_type {}; + +template +class is_vector_like> : public std::true_type {}; + +template +class is_vector_like> : public std::true_type {}; + +template +class is_vector_like> : public std::true_type {}; + +template +class is_vector_like> : public std::true_type {}; + +template +class is_vector_like> : public std::true_type {}; + +template +class is_vector_like> : public std::true_type {}; + +template +class is_vector_like> : public std::true_type {}; + +template +class is_vector_like> : public std::true_type {}; + +template +constexpr bool is_vector_like_v = + is_vector_like>>::value; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/is_view_reader.hpp b/build-config/reflect-cpp/include/rfl/parsing/is_view_reader.hpp new file mode 100644 index 0000000..42cf30e --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/is_view_reader.hpp @@ -0,0 +1,24 @@ +#ifndef RFL_PARSING_ISVIEWREADER_HPP_ +#define RFL_PARSING_ISVIEWREADER_HPP_ + +#include "ViewReader.hpp" + +namespace rfl ::parsing { + +template +class is_view_reader; + +template +class is_view_reader : public std::false_type {}; + +template +class is_view_reader> + : public std::true_type {}; + +template +constexpr bool is_view_reader_v = + is_view_reader>>::value; + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/make_type_name.hpp b/build-config/reflect-cpp/include/rfl/parsing/make_type_name.hpp new file mode 100644 index 0000000..5f2ed40 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/make_type_name.hpp @@ -0,0 +1,28 @@ +#ifndef RFL_PARSING_MAKETYPENAME_HPP_ +#define RFL_PARSING_MAKETYPENAME_HPP_ + +#include "../type_name_t.hpp" +#include "is_tagged_union_wrapper.hpp" + +namespace rfl::parsing { + +inline std::string replace_non_alphanumeric(std::string _str) { + for (auto& ch : _str) { + ch = std::isalnum(ch) ? ch : '_'; + } + return _str; +} + +template +static std::string make_type_name() { + if constexpr (is_tagged_union_wrapper_v) { + return replace_non_alphanumeric(type_name_t().str() + + "__tagged"); + } else { + return replace_non_alphanumeric(type_name_t().str()); + } +} + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/schema/Definition.hpp b/build-config/reflect-cpp/include/rfl/parsing/schema/Definition.hpp new file mode 100644 index 0000000..80e42d0 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/schema/Definition.hpp @@ -0,0 +1,21 @@ +#ifndef RFL_PARSING_SCHEMA_DEFINITION_HPP_ +#define RFL_PARSING_SCHEMA_DEFINITION_HPP_ + +#include +#include + +#include "Type.hpp" + +namespace rfl::parsing::schema { + +struct Definition { + /// Contains the root element of the schema definition. + Type root_; + + /// Contains the definitions to be referenced by Type::Reference. + std::map definitions_; +}; + +} // namespace rfl::parsing::schema + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/schema/Type.hpp b/build-config/reflect-cpp/include/rfl/parsing/schema/Type.hpp new file mode 100644 index 0000000..0ff8e05 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/schema/Type.hpp @@ -0,0 +1,111 @@ +#ifndef RFL_PARSING_SCHEMA_TYPE_HPP_ +#define RFL_PARSING_SCHEMA_TYPE_HPP_ + +#include +#include +#include +#include + +#include "../../Object.hpp" +#include "../../Ref.hpp" +#include "../../Variant.hpp" +#include "ValidationType.hpp" +#include "../../common.hpp" + +namespace rfl::parsing::schema { + +struct RFL_API Type { + struct Boolean {}; + + struct Bytestring {}; + + struct Vectorstring {}; + + struct Int32 {}; + + struct Int64 {}; + + struct UInt32 {}; + + struct UInt64 {}; + + struct Integer {}; + + struct Float {}; + + struct Double {}; + + struct String {}; + + struct AnyOf { + std::vector types_; + }; + + struct Description { + std::string description_; + Ref type_; + }; + + struct FixedSizeTypedArray { + size_t size_; + Ref type_; + }; + + struct Literal { + std::vector values_; + }; + + struct Object { + rfl::Object types_; + std::shared_ptr additional_properties_; + }; + + /// All values are assumed to be required unless explicitly stated otherwise + /// using this wrapper. + struct Optional { + Ref type_; + }; + + /// The is necessary to resolve circular definitions. Refers to something in + /// Definitions. + struct Reference { + std::string name_; + }; + + // A map with key type string. + struct StringMap { + Ref value_type_; + }; + + struct Tuple { + std::vector types_; + }; + + struct TypedArray { + Ref type_; + }; + + struct Validated { + Ref type_; + ValidationType validation_; + }; + + using VariantType = + rfl::Variant; + + Type(); + + Type(const VariantType& _variant); + + ~Type(); + + /// A type can be determined to be any of the above. + VariantType variant_; +}; + +} // namespace rfl::parsing::schema + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/schema/ValidationType.hpp b/build-config/reflect-cpp/include/rfl/parsing/schema/ValidationType.hpp new file mode 100644 index 0000000..b6da312 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/schema/ValidationType.hpp @@ -0,0 +1,67 @@ +#ifndef RFL_PARSING_SCHEMA_VALIDATIONTYPE_HPP_ +#define RFL_PARSING_SCHEMA_VALIDATIONTYPE_HPP_ + +#include +#include + +#include "../../Ref.hpp" +#include "../../Variant.hpp" + +namespace rfl::parsing::schema { + +struct ValidationType { + struct AllOf { + std::vector types_; + }; + + struct AnyOf { + std::vector types_; + }; + + struct EqualTo { + rfl::Variant value_; + }; + + struct ExclusiveMaximum { + rfl::Variant value_; + }; + + struct ExclusiveMinimum { + rfl::Variant value_; + }; + + struct Maximum { + rfl::Variant value_; + }; + + struct Minimum { + rfl::Variant value_; + }; + + struct NotEqualTo { + rfl::Variant value_; + }; + + struct OneOf { + std::vector types_; + }; + + struct Regex { + std::string pattern_; + }; + + struct Size { + Ref size_limit_; + }; + + using VariantType = + rfl::Variant; + + /// A type can be determined to be any of the above. + VariantType variant_; +}; + +} // namespace rfl::parsing::schema + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/schema/make.hpp b/build-config/reflect-cpp/include/rfl/parsing/schema/make.hpp new file mode 100644 index 0000000..9443385 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/schema/make.hpp @@ -0,0 +1,21 @@ +#ifndef RFL_PARSING_SCHEMA_MAKE_HPP_ +#define RFL_PARSING_SCHEMA_MAKE_HPP_ + +#include + +#include "../Parser.hpp" +#include "Definition.hpp" +#include "Type.hpp" + +namespace rfl::parsing::schema { + +template +Definition make() { + std::map definitions; + auto root = Parser::to_schema(&definitions); + return Definition{.root_ = root, .definitions_ = definitions}; +} + +} // namespace rfl::parsing::schema + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/schemaful/IsSchemafulReader.hpp b/build-config/reflect-cpp/include/rfl/parsing/schemaful/IsSchemafulReader.hpp new file mode 100644 index 0000000..19ecdc8 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/schemaful/IsSchemafulReader.hpp @@ -0,0 +1,66 @@ +#ifndef RFL_PARSING_SCHEMAFUL_ISSCHEMAFULREADER_HPP_ +#define RFL_PARSING_SCHEMAFUL_ISSCHEMAFULREADER_HPP_ + +#include +#include +#include +#include + +#include "../../Result.hpp" + +namespace rfl::parsing::schemaful { + +using MockVariantType = std::variant; + +template +struct MockMapReader { + void read(const std::string_view&, typename R::InputVarType&) const {} +}; + +template +struct MockObjectReader { + void read(const int, typename R::InputVarType&) const {} +}; + +template +struct MockUnionReader { + static rfl::Result read(const R&, const size_t, + typename R::InputVarType&) { + return error("This is a mock type."); + } +}; + +template +concept IsSchemafulReader = + requires(R r, typename R::InputVarType var, typename R::InputObjectType obj, + typename R::InputMapType m, typename R::InputUnionType u, + MockMapReader map_reader, MockObjectReader object_reader) { + /// A schemaful reader needs to differentiate between objects, for which + /// the field names are known at compile time and maps, for which the + /// field names are not known at compile time. + { r.read_map(map_reader, m) } -> std::same_as>; + + /// A schemaful reader can read fields by order and does not have to + /// compare strings - the correct order of the fields is guaranteed by the + /// schema. + { + r.read_object(object_reader, obj) + } -> std::same_as>; + + /// A schemaful reader needs an explicit union type. + { + r.template read_union>(u) + } -> std::same_as>; + + /// It needs to be possible to transform variables to maps. + { r.to_map(var) } -> std::same_as>; + + /// It needs to be possible to transform variables to unions. + { + r.to_union(var) + } -> std::same_as>; + }; + +} // namespace rfl::parsing::schemaful + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/schemaful/IsSchemafulWriter.hpp b/build-config/reflect-cpp/include/rfl/parsing/schemaful/IsSchemafulWriter.hpp new file mode 100644 index 0000000..6807683 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/schemaful/IsSchemafulWriter.hpp @@ -0,0 +1,129 @@ +#ifndef RFL_PARSING_SCHEMAFUL_ISSCHEMAFULWRITER_HPP_ +#define RFL_PARSING_SCHEMAFUL_ISSCHEMAFULWRITER_HPP_ + +#include +#include +#include + +namespace rfl::parsing::schemaful { + +template +concept IsSchemafulWriter = requires( + W w, typename W::OutputVarType var, typename W::OutputArrayType arr, + typename W::OutputMapType m, typename W::OutputObjectType obj, + typename W::OutputUnionType u, size_t index, size_t size, + std::string_view name, std::string val) { + /// A schemaful writer needs to know two additional types: + /// 1) Maps - unlike objects, their field names are not known at compile time. + /// 2) Unions - schemaful formats need explicit union types. + + /// Sets an empty map as the root element of the document. + /// Some serialization formats require you to pass the expected size in + /// advance. If you are not working with such a format, you can ignore the + /// parameter `size`. Returns the new array for further modification. + { w.map_as_root(size) } -> std::same_as; + + /// Sets an empty union as the root element of the document. + { w.union_as_root() } -> std::same_as; + + /// Adds an empty array to an existing map. Returns the new + /// array for further modification. + { + w.add_array_to_map(name, size, &m) + } -> std::same_as; + + /// Adds an empty array to an existing union. + /// The index refers to the index of the element in the union. + /// Returns the new array for further modification. + { + w.add_array_to_union(index, size, &u) + } -> std::same_as; + + /// Adds an empty map to an existing array. Returns the new + /// map for further modification. + { w.add_map_to_array(size, &arr) } -> std::same_as; + + /// Adds an empty map to an existing map. The key or name of the field + /// is signified by `name`. Returns the new map for further modification. + { + w.add_map_to_map(name, size, &m) + } -> std::same_as; + + /// Adds an empty map to an existing object. The key or name of the field + /// is signified by `name`. Returns the new map for further modification. + { + w.add_map_to_object(name, size, &obj) + } -> std::same_as; + + /// Adds an empty map to an existing union. + /// The index refers to the index of the element in the union. + /// Returns the new map for further modification. + { + w.add_map_to_union(index, size, &u) + } -> std::same_as; + + /// Adds an empty object to an existing map. The key or name of the field + /// is signified by `name`. Returns the new object for further modification. + { + w.add_object_to_map(name, size, &m) + } -> std::same_as; + + /// Adds an empty object to an existing union. + /// The index refers to the index of the element in the union. + /// Returns the new object for further modification. + { + w.add_object_to_union(index, size, &u) + } -> std::same_as; + + /// Adds an empty union to an existing array. Returns the new + /// union for further modification. + { w.add_union_to_array(&arr) } -> std::same_as; + + /// Adds an empty union to an existing map. The key or name of the field + /// is signified by `name`. Returns the new union for further modification. + { w.add_union_to_map(name, &m) } -> std::same_as; + + /// Adds an empty union to an existing object. The key or name of the field + /// is signified by `name`. Returns the new union for further modification. + { + w.add_union_to_object(name, &obj) + } -> std::same_as; + + /// Adds an empty union to an existing union. + /// The index refers to the index of the element in the union. + /// Returns the new union for further modification. + { + w.add_union_to_union(index, &u) + } -> std::same_as; + + /// Adds a null value to a map. Returns an + /// OutputVarType containing the null value. + { w.add_null_to_map(name, &m) } -> std::same_as; + + /// Adds a basic value (bool, numeric, string) to an existing map. The key + /// or name of the field is signified by `name`. Returns an + /// OutputVarType containing the new value. + { + w.add_value_to_map(name, val, &m) + } -> std::same_as; + + /// Adds a null value to a union. Returns an + /// OutputVarType containing the null value. + { w.add_null_to_union(index, &u) } -> std::same_as; + + /// Adds a basic value (bool, numeric, string) to an existing union. The key + /// or name of the field is signified by `name`. Returns an + /// OutputVarType containing the new value. + { + w.add_value_to_union(index, val, &u) + } -> std::same_as; + + /// Signifies to the writer that we do not want to add any further elements to + /// this map. Some serialization formats require this. If you are working + /// with a serialization format that doesn't, just leave the function empty. + { w.end_map(&m) } -> std::same_as; +}; + +} // namespace rfl::parsing::schemaful + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/schemaful/OptionalReader.hpp b/build-config/reflect-cpp/include/rfl/parsing/schemaful/OptionalReader.hpp new file mode 100644 index 0000000..6f423c5 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/schemaful/OptionalReader.hpp @@ -0,0 +1,26 @@ +#ifndef RFL_PARSING_SCHEMAFUL_OPTIONALREADER_HPP_ +#define RFL_PARSING_SCHEMAFUL_OPTIONALREADER_HPP_ + +#include +#include + +#include "../../Result.hpp" +#include "../Parser_base.hpp" + +namespace rfl::parsing::schemaful { + +template +struct OptionalReader { + static Result> read( + const R& _r, const size_t _index, + const typename R::InputVarType& _var) noexcept { + if (_index == 1) { + return std::optional(); + } + return Parser, ProcessorsType>::read(_r, _var); + } +}; + +} // namespace rfl::parsing::schemaful + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/schemaful/SharedPtrReader.hpp b/build-config/reflect-cpp/include/rfl/parsing/schemaful/SharedPtrReader.hpp new file mode 100644 index 0000000..154e5b5 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/schemaful/SharedPtrReader.hpp @@ -0,0 +1,27 @@ +#ifndef RFL_PARSING_SCHEMAFUL_SHAREDPTRREADER_HPP_ +#define RFL_PARSING_SCHEMAFUL_SHAREDPTRREADER_HPP_ + +#include +#include + +#include "../../Result.hpp" +#include "../Parser_base.hpp" + +namespace rfl::parsing::schemaful { + +template +struct SharedPtrReader { + static Result> read( + const R& _r, const size_t _index, + const typename R::InputVarType& _var) noexcept { + if (_index == 1) { + return std::shared_ptr(); + } + return Parser, ProcessorsType>::read(_r, _var) + .transform([](T&& _t) { return std::make_shared(std::move(_t)); }); + } +}; + +} // namespace rfl::parsing::schemaful + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/schemaful/UniquePtrReader.hpp b/build-config/reflect-cpp/include/rfl/parsing/schemaful/UniquePtrReader.hpp new file mode 100644 index 0000000..b27fa23 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/schemaful/UniquePtrReader.hpp @@ -0,0 +1,27 @@ +#ifndef RFL_PARSING_SCHEMAFUL_UNIQUEPTRREADER_HPP_ +#define RFL_PARSING_SCHEMAFUL_UNIQUEPTRREADER_HPP_ + +#include +#include + +#include "../../Result.hpp" +#include "../Parser_base.hpp" + +namespace rfl::parsing::schemaful { + +template +struct UniquePtrReader { + static Result> read( + const R& _r, const size_t _index, + const typename R::InputVarType& _var) noexcept { + if (_index == 1) { + return std::unique_ptr(); + } + return Parser, ProcessorsType>::read(_r, _var) + .transform([](T&& _t) { return std::make_unique(std::move(_t)); }); + } +}; + +} // namespace rfl::parsing::schemaful + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/schemaful/VariantReader.hpp b/build-config/reflect-cpp/include/rfl/parsing/schemaful/VariantReader.hpp new file mode 100644 index 0000000..5b6656e --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/schemaful/VariantReader.hpp @@ -0,0 +1,45 @@ +#ifndef RFL_PARSING_SCHEMAFUL_VARIANTREADER_HPP_ +#define RFL_PARSING_SCHEMAFUL_VARIANTREADER_HPP_ + +#include +#include + +#include "../../Result.hpp" +#include "../../internal/nth_element_t.hpp" +#include "../Parser_base.hpp" + +namespace rfl::parsing::schemaful { + +template +class VariantReader { + public: + static Result read( + const R& _r, const size_t _index, + const typename R::InputVarType& _var) noexcept { + return [&](std::integer_sequence) { + Result result = + error("Could not parse union: Index out of bounds."); + (try_one_type<_is>(_r, _index, _var, &result), ...); + return result; + }(std::make_integer_sequence()); + } + + private: + template + static void try_one_type(const R& _r, const size_t _index, + const typename R::InputVarType& _var, + Result* _result) noexcept { + if (_index == _i) { + using T = internal::nth_element_t<_i, AlternativeTypes...>; + *_result = + Parser, ProcessorsType>::read(_r, _var) + .transform( + [](auto&& _val) -> VariantType { return std::move(_val); }); + } + } +}; + +} // namespace rfl::parsing::schemaful + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/schemaful/tuple_to_named_tuple.hpp b/build-config/reflect-cpp/include/rfl/parsing/schemaful/tuple_to_named_tuple.hpp new file mode 100644 index 0000000..65f654e --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/schemaful/tuple_to_named_tuple.hpp @@ -0,0 +1,53 @@ +#ifndef RFL_PARSING_SCHEMAFUL_TUPLETONAMEDTUPLE_HPP_ +#define RFL_PARSING_SCHEMAFUL_TUPLETONAMEDTUPLE_HPP_ + +#include +#include +#include + +#include "../../Field.hpp" +#include "../../Tuple.hpp" +#include "../../internal/StringLiteral.hpp" +#include "../../make_named_tuple.hpp" + +namespace rfl::parsing::schemaful { + +template +inline consteval auto to_field_name() { + return internal::StringLiteral<5>('f', + static_cast('0' + ((_i / 100) % 10)), + static_cast('0' + ((_i / 10) % 10)), + static_cast('0' + (_i % 10))); +} + +template +inline auto to_field(const auto& _t) { + using T = std::remove_cvref_t; + return rfl::Field(), const T*>(&_t); +} + +/// Schemaful formats often don't have an explicit tuple representation. +/// This is the required workaround. +template +auto tuple_to_named_tuple(const Tuple& _tup) { + static_assert(sizeof...(Ts) <= 1000, + "The tuple cannot contain more than 1000 elements."); + return [&](std::integer_sequence) { + return rfl::make_named_tuple(to_field<_is>(rfl::get<_is>(_tup))...); + }(std::make_integer_sequence()); +} + +/// Schemaful formats often don't have an explicit tuple representation. +/// This is the required workaround. +template +auto tuple_to_named_tuple(const std::tuple& _tup) { + static_assert(sizeof...(Ts) <= 1000, + "The tuple cannot contain more than 1000 elements."); + return [&](std::integer_sequence) { + return rfl::make_named_tuple(to_field<_is>(std::get<_is>(_tup))...); + }(std::make_integer_sequence()); +} + +} // namespace rfl::parsing::schemaful + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/schemaful/tuple_to_named_tuple_t.hpp b/build-config/reflect-cpp/include/rfl/parsing/schemaful/tuple_to_named_tuple_t.hpp new file mode 100644 index 0000000..3d66c37 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/schemaful/tuple_to_named_tuple_t.hpp @@ -0,0 +1,47 @@ +#ifndef RFL_PARSING_SCHEMAFUL_TUPLETONAMEDTUPLE_T_HPP_ +#define RFL_PARSING_SCHEMAFUL_TUPLETONAMEDTUPLE_T_HPP_ + +#include +#include + +#include "../../NamedTuple.hpp" +#include "../../Tuple.hpp" +#include "tuple_to_named_tuple.hpp" + +namespace rfl::parsing::schemaful { + +template +struct ToNamedTuple; + +template +struct ToNamedTuple, Ts...> { + using Type = NamedTuple(), Ts>...>; +}; + +template +struct TupleToNamedTuple; + +template +struct TupleToNamedTuple> { + using Type = + typename ToNamedTuple, + Ts...>::Type; +}; + +template +struct TupleToNamedTuple> { + using Type = + typename ToNamedTuple, + Ts...>::Type; +}; + +/// Given +/// std::tuple or rfl::Tuple +/// return +/// NamedTuple, Field<"f001", T2>, Field<"f002", T3>, ...> +template +using tuple_to_named_tuple_t = typename TupleToNamedTuple::Type; + +} // namespace rfl::parsing::schemaful + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/schemaful/tuple_to_object.hpp b/build-config/reflect-cpp/include/rfl/parsing/schemaful/tuple_to_object.hpp new file mode 100644 index 0000000..38515a4 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/schemaful/tuple_to_object.hpp @@ -0,0 +1,15 @@ +#ifndef RFL_PARSING_SCHEMAFUL_TUPLETOOBJECT_HPP_ +#define RFL_PARSING_SCHEMAFUL_TUPLETOOBJECT_HPP_ + +#include "../schema/Type.hpp" +#include "../../common.hpp" + +namespace rfl::parsing::schemaful { + +/// Schemaful formats often don't have an explicit tuple representation. +/// This is the required workaround. +RFL_API schema::Type::Object tuple_to_object(const schema::Type::Tuple& _tup); + +} // namespace rfl::parsing::schemaful + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/supports_attributes.hpp b/build-config/reflect-cpp/include/rfl/parsing/supports_attributes.hpp new file mode 100644 index 0000000..a6a2bdb --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/supports_attributes.hpp @@ -0,0 +1,29 @@ +#ifndef RFL_PARSING_SUPPORTSATTRIBUTES_HPP_ +#define RFL_PARSING_SUPPORTSATTRIBUTES_HPP_ + +#include +#include + +#include "../Result.hpp" + +namespace rfl { +namespace parsing { + +/// Determines whether a writer supports attributes. +template +concept supports_attributes = requires(W w, std::string_view name, + typename W::OutputObjectType obj, + bool is_attribute) { + { + w.add_value_to_object(name, name, &obj, is_attribute) + } -> std::same_as; + + { + w.add_null_to_object(name, &obj, is_attribute) + } -> std::same_as; +}; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/tabular/ArrowReader.hpp b/build-config/reflect-cpp/include/rfl/parsing/tabular/ArrowReader.hpp new file mode 100644 index 0000000..d281608 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/tabular/ArrowReader.hpp @@ -0,0 +1,133 @@ +#ifndef RFL_PARSING_TABULAR_ARROWREADER_HPP_ +#define RFL_PARSING_TABULAR_ARROWREADER_HPP_ + +#include + +#include +#include +#include +#include +#include + +#include "../../Processors.hpp" +#include "../../Result.hpp" +#include "../../Tuple.hpp" +#include "../../apply.hpp" +#include "../../get.hpp" +#include "../../named_tuple_t.hpp" +#include "../../to_view.hpp" +#include "../../view_t.hpp" +#include "../call_destructors_where_necessary.hpp" +#include "make_chunked_array_iterators.hpp" + +namespace rfl::parsing::tabular { + +template +class ArrowReader { + static_assert(!Processors::add_tags_to_variants_, + "rfl::AddTagsToVariants cannot be used for tabular data."); + static_assert(!Processors::add_namespaced_tags_to_variants_, + "rfl::AddNamespacedTagsToVariants cannot be used for tabular data."); + static_assert(!Processors::all_required_, + "rfl::NoOptionals cannot be used for tabular data."); + static_assert(!Processors::default_if_missing_, + "rfl::DefaultIfMissing cannot be used for tabular data."); + static_assert(!Processors::no_extra_fields_, + "rfl::NoExtraFields cannot be used for tabular data (neither " + "can rfl::ExtraFields)."); + static_assert(!Processors::no_field_names_, + "rfl::NoFieldNames cannot be used for tabular data."); + + public: + using ValueType = typename std::remove_cvref_t; + + static Result make(const std::shared_ptr& _table) { + try { + return ArrowReader(_table); + } catch (const std::exception& e) { + return error(std::string("Could not create ArrowReader: ") + e.what()); + } + } + + ~ArrowReader() = default; + + Result read() const noexcept { + return make_chunked_array_iterators, _s>( + table_) + .and_then([&](auto chunked_array_iterators) -> Result { + VecType result; + while (!end(chunked_array_iterators)) { + auto value = new_value(&chunked_array_iterators); + if (!value) { + return error(value.error().what()); + } + result.emplace_back(std::move(*value)); + } + return result; + }); + } + + private: + ArrowReader(const std::shared_ptr& _table) + : table_(Ref::make(_table).value()) {} + + bool end(const auto& _chunked_array_iterators) const { + return apply( + [](const auto&... _its) { return (false || ... || _its.end()); }, + _chunked_array_iterators); + } + + Result new_value(auto* _chunked_array_iterators) const noexcept { + alignas(ValueType) unsigned char buf[sizeof(ValueType)]{}; + auto ptr = internal::ptr_cast(&buf); + + auto view = to_view(*ptr); + + using ViewType = std::remove_cvref_t; + + try { + const auto set_one = [&](std::integral_constant) { + using FieldType = tuple_element_t<_i, typename ViewType::Fields>; + using T = std::remove_cvref_t< + std::remove_pointer_t>; + auto res = *_chunked_array_iterators->template get<_i>(); + if (!res) { + destroy_value<_i>(&view); + throw std::runtime_error( + std::string("Field '") + typename FieldType::Name().str() + + std::string("' could not be set: ") + res.error().what()); + } + ::new (view.template get<_i>()) T(std::move(*res)); + ++_chunked_array_iterators->template get<_i>(); + }; + + [&](std::integer_sequence) { + (set_one(std::integral_constant{}), ...); + }(std::make_integer_sequence()); + } catch (const std::exception& e) { + return error(e.what()); + } + + return std::move(*ptr); + } + + template + void destroy_value(ViewType* _view) const { + static_assert(_i < ViewType::size(), "_i out of bounds."); + auto set = std::array(); + for (size_t i = 0; i < _i; ++i) { + set[i] = true; + } + for (size_t i = _i; i < ViewType::size(); ++i) { + set[i] = false; + } + call_destructors_where_necessary(set, _view); + } + + private: + Ref table_; +}; + +} // namespace rfl::parsing::tabular + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/tabular/ArrowTypes.hpp b/build-config/reflect-cpp/include/rfl/parsing/tabular/ArrowTypes.hpp new file mode 100644 index 0000000..6281855 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/tabular/ArrowTypes.hpp @@ -0,0 +1,956 @@ +#ifndef RFL_PARSING_TABULAR_ARROWTYPES_HPP_ +#define RFL_PARSING_TABULAR_ARROWTYPES_HPP_ + +#include + +#include +#include +#include +#include + +#include "../../Box.hpp" +#include "../../NamedTuple.hpp" +#include "../../Ref.hpp" +#include "../../Rename.hpp" +#include "../../Timestamp.hpp" +#include "../../Tuple.hpp" +#include "../../concepts.hpp" +#include "../../enums.hpp" +#include "../../internal/StringLiteral.hpp" +#include "../../internal/has_reflection_type_v.hpp" +#include "../../internal/ptr_cast.hpp" +#include "../../named_tuple_t.hpp" + +namespace rfl::parsing::tabular { + +enum class SerializationType { csv, parquet }; + +template +struct ArrowTypes; + +template +Result::ArrayType>> transform_numerical_array( + const std::shared_ptr& _arr) noexcept; + +template +struct ArrowTypes { + using ArrayType = arrow::BooleanArray; + using BuilderType = arrow::BooleanBuilder; + + static auto data_type() { return arrow::boolean(); } + + static void add_to_builder(const bool _val, BuilderType* _builder) { + const auto status = _builder->Append(_val); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + static Result> get_array( + const std::shared_ptr& _arr) { + if (_arr->type()->Equals(data_type())) { + return Ref::make(std::static_pointer_cast(_arr)); + } else { + return error("Expected boolean array, got " + _arr->type()->ToString() + + "."); + } + } + + static Result get_value(const Ref& _chunk, + const int64_t _ix) { + return _chunk->Value(_ix); + } + + static auto make_builder() { return BuilderType(); } +}; + +template +struct ArrowTypes { + using ArrayType = arrow::UInt8Array; + using BuilderType = arrow::UInt8Builder; + using T = uint8_t; + + static auto data_type() { return arrow::uint8(); } + + static void add_to_builder(const auto _val, BuilderType* _builder) { + const auto status = _builder->Append(_val); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + static Result> get_array( + const std::shared_ptr& _arr) { + return transform_numerical_array(_arr); + } + + static Result get_value(const Ref& _chunk, + const int64_t _ix) { + return _chunk->Value(_ix); + } + + static auto make_builder() { return BuilderType(); } +}; + +template +struct ArrowTypes { + using ArrayType = arrow::UInt16Array; + using BuilderType = arrow::UInt16Builder; + using T = uint16_t; + + static auto data_type() { return arrow::uint16(); } + + static void add_to_builder(const auto _val, BuilderType* _builder) { + const auto status = _builder->Append(_val); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + static Result> get_array( + const std::shared_ptr& _arr) { + return transform_numerical_array(_arr); + } + + static Result get_value(const Ref& _chunk, + const int64_t _ix) { + return _chunk->Value(_ix); + } + + static auto make_builder() { return BuilderType(); } +}; + +template +struct ArrowTypes { + using ArrayType = arrow::UInt32Array; + using BuilderType = arrow::UInt32Builder; + using T = uint32_t; + + static auto data_type() { return arrow::uint32(); } + + static void add_to_builder(const auto _val, BuilderType* _builder) { + const auto status = _builder->Append(_val); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + static Result> get_array( + const std::shared_ptr& _arr) { + return transform_numerical_array(_arr); + } + + static Result get_value(const Ref& _chunk, + const int64_t _ix) { + return _chunk->Value(_ix); + } + + static auto make_builder() { return BuilderType(); } +}; + +template +struct ArrowTypes { + using ArrayType = arrow::UInt64Array; + using BuilderType = arrow::UInt64Builder; + using T = uint64_t; + + static auto data_type() { return arrow::uint64(); } + + static void add_to_builder(const auto _val, BuilderType* _builder) { + const auto status = _builder->Append(_val); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + static Result> get_array( + const std::shared_ptr& _arr) { + return transform_numerical_array(_arr); + } + + static Result get_value(const Ref& _chunk, + const int64_t _ix) { + return _chunk->Value(_ix); + } + + static auto make_builder() { return BuilderType(); } +}; + +template +struct ArrowTypes { + using ArrayType = arrow::Int8Array; + using BuilderType = arrow::Int8Builder; + using T = int8_t; + + static auto data_type() { return arrow::int8(); } + + static void add_to_builder(const auto _val, BuilderType* _builder) { + const auto status = _builder->Append(_val); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + static Result> get_array( + const std::shared_ptr& _arr) { + return transform_numerical_array(_arr); + } + + static Result get_value(const Ref& _chunk, + const int64_t _ix) { + return _chunk->Value(_ix); + } + + static auto make_builder() { return BuilderType(); } +}; + +template +struct ArrowTypes { + using ArrayType = arrow::Int16Array; + using BuilderType = arrow::Int16Builder; + using T = int16_t; + + static auto data_type() { return arrow::int16(); } + + static void add_to_builder(const auto _val, BuilderType* _builder) { + const auto status = _builder->Append(_val); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + static Result> get_array( + const std::shared_ptr& _arr) { + return transform_numerical_array(_arr); + } + + static Result get_value(const Ref& _chunk, + const int64_t _ix) { + return _chunk->Value(_ix); + } + + static auto make_builder() { return BuilderType(); } +}; + +template +struct ArrowTypes { + using ArrayType = arrow::Int32Array; + using BuilderType = arrow::Int32Builder; + using T = int32_t; + + static auto data_type() { return arrow::int32(); } + + static void add_to_builder(const auto _val, BuilderType* _builder) { + const auto status = _builder->Append(_val); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + static Result> get_array( + const std::shared_ptr& _arr) { + return transform_numerical_array(_arr); + } + + static Result get_value(const Ref& _chunk, + const int64_t _ix) { + return _chunk->Value(_ix); + } + + static auto make_builder() { return BuilderType(); } +}; + +template +struct ArrowTypes { + using ArrayType = arrow::Int64Array; + using BuilderType = arrow::Int64Builder; + using T = int64_t; + + static auto data_type() { return arrow::int64(); } + + static void add_to_builder(const auto _val, BuilderType* _builder) { + const auto status = _builder->Append(_val); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + static Result> get_array( + const std::shared_ptr& _arr) { + return transform_numerical_array(_arr); + } + + static Result get_value(const Ref& _chunk, + const int64_t _ix) { + return _chunk->Value(_ix); + } + + static auto make_builder() { return BuilderType(); } +}; + +template +struct ArrowTypes { + using ArrayType = arrow::FloatArray; + using BuilderType = arrow::FloatBuilder; + using T = float; + + static auto data_type() { return arrow::float32(); } + + static void add_to_builder(const auto _val, BuilderType* _builder) { + const auto status = _builder->Append(_val); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + static Result> get_array( + const std::shared_ptr& _arr) { + return transform_numerical_array(_arr); + } + + static Result get_value(const Ref& _chunk, + const int64_t _ix) { + return _chunk->Value(_ix); + } + + static auto make_builder() { return BuilderType(); } +}; + +template +struct ArrowTypes { + using ArrayType = arrow::DoubleArray; + using BuilderType = arrow::DoubleBuilder; + using T = double; + + static auto data_type() { return arrow::float64(); } + + static void add_to_builder(const auto _val, BuilderType* _builder) { + const auto status = _builder->Append(_val); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + static Result> get_array( + const std::shared_ptr& _arr) { + return transform_numerical_array(_arr); + } + + static Result get_value(const Ref& _chunk, + const int64_t _ix) { + return _chunk->Value(_ix); + } + + static auto make_builder() { return BuilderType(); } +}; + +template +struct ArrowTypes { + using ArrayType = arrow::StringArray; + using BuilderType = arrow::StringBuilder; + + static auto data_type() { return arrow::utf8(); } + + static void add_to_builder(const auto& _val, BuilderType* _builder) { + const auto status = _builder->Append(_val); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + static Result> get_array( + const std::shared_ptr& _arr) { + if (_arr->type()->Equals(data_type())) { + return Ref::make(std::static_pointer_cast(_arr)); + } else { + return error("Expected string array, got " + _arr->type()->ToString() + + "."); + } + } + + static Result get_value(const Ref& _chunk, + const int64_t _ix) { + return std::string(_chunk->Value(_ix)); + } + + static auto make_builder() { return BuilderType(); } +}; + +template + requires enchantum::Enum +struct ArrowTypes { + using ArrayType = arrow::StringArray; + using BuilderType = arrow::StringBuilder; + + static auto data_type() { return arrow::utf8(); } + + static void add_to_builder(const T _val, BuilderType* _builder) { + const auto status = _builder->Append(enum_to_string(_val)); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + static Result> get_array( + const std::shared_ptr& _arr) { + return ArrowTypes::get_array(_arr); + } + + static Result get_value(const Ref& _chunk, const int64_t _ix) { + return string_to_enum(std::string(_chunk->Value(_ix))); + } + + static auto make_builder() { return BuilderType(); } +}; + +template + requires concepts::ContiguousByteContainer +struct ArrowTypes { + using ArrayType = arrow::BinaryArray; + using BuilderType = arrow::BinaryBuilder; + + static auto data_type() { return arrow::binary(); } + + static void add_to_builder(const auto& _val, BuilderType* _builder) { + const auto status = _builder->Append( + internal::ptr_cast(_val.data()), _val.size()); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + static Result> get_array( + const std::shared_ptr& _arr) { + if (_arr->type()->Equals(data_type())) { + return Ref::make(std::static_pointer_cast(_arr)); + + } else if (_arr->type()->Equals(arrow::utf8())) { + return transform_string( + std::static_pointer_cast(_arr)); + + } else { + return error("Expected binary or string array, got " + + _arr->type()->ToString() + "."); + } + } + + static Result get_value(const Ref& _chunk, const int64_t _ix) { + const auto begin = internal::ptr_cast( + _chunk->Value(_ix).data()); + return T(begin, begin + _chunk->Value(_ix).size()); + } + + static auto make_builder() { return BuilderType(); } + + static Result> transform_string( + const std::shared_ptr& _arr) noexcept { + if (!_arr) { + return error( + "transform_string: std::shared_ptr not set. This is a " + "bug, please report."); + } + + auto builder = arrow::BinaryBuilder(); + + for (int64_t i = 0; i < _arr->length(); ++i) { + if (_arr->IsNull(i)) { + const auto status = builder.AppendNull(); + if (!status.ok()) { + return error(status.message()); + } + } else { + const std::string_view s = _arr->Value(i); + const auto status = builder.Append( + internal::ptr_cast(s.data()), s.size()); + if (!status.ok()) { + return error(status.message()); + } + } + } + + std::shared_ptr res; + const auto status = builder.Finish(&res); + return Ref::make( + std::static_pointer_cast(res)); + } +}; + +template +struct ArrowTypes, _s> { + enum class TimeUnit { day, second, milli, micro, nano, string }; + + using ArrayType = arrow::TimestampArray; + using BuilderType = arrow::TimestampBuilder; + + static auto data_type() { return arrow::timestamp(arrow::TimeUnit::MILLI); } + + static void add_to_builder(const auto& _val, BuilderType* _builder) { + const auto status = _builder->Append(_val.to_time_t() * 1000); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + static Result> get_array( + const std::shared_ptr& _arr) { + if (_arr->type()->Equals(data_type())) { + return Ref::make(std::static_pointer_cast(_arr)); + + } else if (_arr->type()->Equals( + arrow::timestamp(arrow::TimeUnit::SECOND))) { + return transform_time_stamp( + std::static_pointer_cast(_arr)); + + } else if (_arr->type()->Equals(arrow::timestamp(arrow::TimeUnit::MICRO))) { + return transform_time_stamp( + std::static_pointer_cast(_arr)); + + } else if (_arr->type()->Equals(arrow::timestamp(arrow::TimeUnit::NANO))) { + return transform_time_stamp( + std::static_pointer_cast(_arr)); + + } else if (_arr->type()->Equals(arrow::date32())) { + return transform_time_stamp( + std::static_pointer_cast(_arr)); + + } else if (_arr->type()->Equals(arrow::date64())) { + return transform_time_stamp( + std::static_pointer_cast(_arr)); + + } else if (_arr->type()->Equals(arrow::utf8())) { + return transform_time_stamp( + std::static_pointer_cast(_arr)); + + } else { + return error("Expected timestamp, date32, date64 or string array, got " + + _arr->type()->ToString() + "."); + } + } + + static Result> get_value(const Ref& _chunk, + const int64_t _ix) { + return Timestamp<_format>(_chunk->Value(_ix) / 1000); + } + + static auto make_builder() { + return BuilderType(data_type(), arrow::default_memory_pool()); + } + + template + static Result> transform_time_stamp( + const std::shared_ptr& _arr) noexcept { + if (!_arr) { + return error( + "transform_time_stamp: std::shared_ptr not set. This is a " + "bug, please report."); + } + + auto builder = + arrow::TimestampBuilder(data_type(), arrow::default_memory_pool()); + + for (int64_t i = 0; i < _arr->length(); ++i) { + if (_arr->IsNull(i)) { + const auto status = builder.AppendNull(); + if (!status.ok()) { + return error(status.message()); + } + } else { + if constexpr (_unit == TimeUnit::day) { + const auto status = builder.Append( + static_cast(_arr->Value(i)) * 1000 * 24 * 60 * 60); + if (!status.ok()) { + return error(status.message()); + } + } else if constexpr (_unit == TimeUnit::second) { + const auto status = + builder.Append(static_cast(_arr->Value(i) * 1000)); + if (!status.ok()) { + return error(status.message()); + } + } else if constexpr (_unit == TimeUnit::milli) { + const auto status = + builder.Append(static_cast(_arr->Value(i))); + if (!status.ok()) { + return error(status.message()); + } + } else if constexpr (_unit == TimeUnit::micro) { + const auto status = + builder.Append(static_cast(_arr->Value(i) / 1000)); + if (!status.ok()) { + return error(status.message()); + } + } else if constexpr (_unit == TimeUnit::nano) { + const auto status = + builder.Append(static_cast(_arr->Value(i) / 1000000)); + if (!status.ok()) { + return error(status.message()); + } + } else if constexpr (_unit == TimeUnit::string) { + const auto ts = Timestamp<_format>::make(std::string(_arr->Value(i))); + if (!ts) { + return error(ts.error().what()); + } + const auto status = builder.Append(ts->to_time_t() * 1000); + if (!status.ok()) { + return error(status.message()); + } + } else { + static_assert(rfl::always_false_v, + "Unsupported time unit."); + } + } + } + + std::shared_ptr res; + const auto status = builder.Finish(&res); + return Ref::make( + std::static_pointer_cast(res)); + } +}; + +template +struct ArrowTypes, SerializationType::csv> { + using ArrayType = arrow::TimestampArray; + using BuilderType = arrow::StringBuilder; + + static auto data_type() { return arrow::timestamp(arrow::TimeUnit::MILLI); } + + static void add_to_builder(const Timestamp<_format>& _val, + BuilderType* _builder) { + const auto status = _builder->Append(_val.str()); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + static Result> get_array( + const std::shared_ptr& _arr) { + return ArrowTypes, + SerializationType::parquet>::get_array(_arr); + } + + static Result> get_value(const Ref& _chunk, + const int64_t _ix) { + return ArrowTypes, + SerializationType::parquet>::get_value(_chunk, _ix); + } + + static auto make_builder() { return BuilderType(); } +}; + +template + requires internal::has_reflection_type_v +struct ArrowTypes { + using ArrayType = + typename ArrowTypes::ArrayType; + using BuilderType = + typename ArrowTypes::BuilderType; + + static auto data_type() { + return ArrowTypes::data_type(); + } + + static void add_to_builder(const auto& _val, BuilderType* _builder) { + ArrowTypes::add_to_builder( + _val.reflection(), _builder); + } + + static Result> get_array( + const std::shared_ptr& _arr) { + return ArrowTypes::get_array(_arr); + } + + static Result get_value(const Ref& _chunk, const int64_t _ix) { + return ArrowTypes, + _s>::get_value(_chunk, _ix) + .and_then([](const auto& _v) -> Result { + try { + return T(_v); + } catch (const std::exception& e) { + return error(e.what()); + } + }); + } + + static auto make_builder() { + return ArrowTypes::make_builder(); + } +}; + +template +struct ArrowTypes, _s> { + using ArrayType = typename ArrowTypes, _s>::ArrayType; + using BuilderType = + typename ArrowTypes, _s>::BuilderType; + + static auto data_type() { return ArrowTypes::data_type(); } + + static void add_to_builder(const auto& _val, BuilderType* _builder) { + if (_val) { + ArrowTypes::add_to_builder(*_val, _builder); + } else { + const auto status = _builder->AppendNull(); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + } + + static Result> get_array( + const std::shared_ptr& _arr) { + return ArrowTypes::get_array(_arr); + } + + static auto get_value(const Ref& _chunk, const int64_t _ix) { + return ArrowTypes, _s>::get_value(_chunk, _ix) + .transform([](const auto& _v) { return std::make_optional(_v); }); + } + + static auto make_builder() { return ArrowTypes::make_builder(); } +}; + +template +struct ArrowTypes, _s> { + using ArrayType = typename ArrowTypes, _s>::ArrayType; + using BuilderType = + typename ArrowTypes, _s>::BuilderType; + + static auto data_type() { return ArrowTypes::data_type(); } + + static void add_to_builder(const auto& _val, BuilderType* _builder) { + if (_val) { + ArrowTypes::add_to_builder(*_val, _builder); + } else { + const auto status = _builder->AppendNull(); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + } + + static Result> get_array( + const std::shared_ptr& _arr) { + return ArrowTypes::get_array(_arr); + } + + static auto get_value(const Ref& _chunk, const int64_t _ix) { + return ArrowTypes, _s>::get_value(_chunk, _ix) + .transform([](const auto& _v) { return std::make_shared(_v); }); + } + + static auto make_builder() { return ArrowTypes::make_builder(); } +}; + +template +struct ArrowTypes, _s> { + using ArrayType = typename ArrowTypes, _s>::ArrayType; + using BuilderType = + typename ArrowTypes, _s>::BuilderType; + + static auto data_type() { return ArrowTypes::data_type(); } + + static void add_to_builder(const auto& _val, BuilderType* _builder) { + if (_val) { + ArrowTypes::add_to_builder(*_val, _builder); + } else { + const auto status = _builder->AppendNull(); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + } + + static Result> get_array( + const std::shared_ptr& _arr) { + return ArrowTypes::get_array(_arr); + } + + static auto get_value(const Ref& _chunk, const int64_t _ix) { + return ArrowTypes, _s>::get_value(_chunk, _ix) + .transform([](const auto& _v) { return std::make_unique(_v); }); + } + + static auto make_builder() { return ArrowTypes::make_builder(); } +}; + +template +struct ArrowTypes, _s> { + using ArrayType = typename ArrowTypes, _s>::ArrayType; + using BuilderType = + typename ArrowTypes, _s>::BuilderType; + + static auto data_type() { return ArrowTypes::data_type(); } + + static void add_to_builder(const auto& _val, BuilderType* _builder) { + ArrowTypes::add_to_builder(*_val, _builder); + } + + static Result> get_array( + const std::shared_ptr& _arr) { + return ArrowTypes::get_array(_arr); + } + + static auto get_value(const Ref& _chunk, const int64_t _ix) { + return ArrowTypes, _s>::get_value(_chunk, _ix) + .transform([](const auto& _v) { return Box::make(_v); }); + } + + static auto make_builder() { return ArrowTypes::make_builder(); } +}; + +template +struct ArrowTypes, _s> { + using ArrayType = typename ArrowTypes, _s>::ArrayType; + using BuilderType = + typename ArrowTypes, _s>::BuilderType; + + static auto data_type() { return ArrowTypes::data_type(); } + + static void add_to_builder(const auto& _val, BuilderType* _builder) { + ArrowTypes::add_to_builder(*_val, _builder); + } + + static Result> get_array( + const std::shared_ptr& _arr) { + return ArrowTypes::get_array(_arr); + } + + static auto get_value(const Ref& _chunk, const int64_t _ix) { + return ArrowTypes, _s>::get_value(_chunk, _ix) + .transform([](const auto& _v) { return Ref::make(_v); }); + } + + static auto make_builder() { return ArrowTypes::make_builder(); } +}; + +template +struct ArrowTypes, _s> { + using ArrayType = typename ArrowTypes, _s>::ArrayType; + using BuilderType = + typename ArrowTypes, _s>::BuilderType; + + static auto data_type() { return ArrowTypes::data_type(); } + + static void add_to_builder(const auto& _val, BuilderType* _builder) { + ArrowTypes::add_to_builder(_val.value(), _builder); + } + + static Result> get_array( + const std::shared_ptr& _arr) { + return ArrowTypes::get_array(_arr); + } + + static auto get_value(const Ref& _chunk, const int64_t _ix) { + return ArrowTypes, _s>::get_value(_chunk, _ix) + .transform([](const auto& _v) { return Rename<_name, T>(_v); }); + } + + static auto make_builder() { return ArrowTypes::make_builder(); } +}; + +template +Result::ArrayType>> +transform_numerical_array_impl( + const std::shared_ptr& _arr) noexcept { + if (!_arr) { + return error( + "transform_numerical_array_impl: std::shared_ptr not set. This is a " + "bug, please report."); + } + + auto builder = ArrowTypes::make_builder(); + + for (int64_t i = 0; i < _arr->length(); ++i) { + if (_arr->IsNull(i)) { + const auto status = builder.AppendNull(); + if (!status.ok()) { + return error(status.message()); + } + } else { + const auto status = builder.Append(static_cast(_arr->Value(i))); + if (!status.ok()) { + return error(status.message()); + } + } + } + + using TargetArrayType = typename ArrowTypes::ArrayType; + + std::shared_ptr res; + const auto status = builder.Finish(&res); + return Ref::make( + std::static_pointer_cast(res)); +} + +template +Result::ArrayType>> transform_numerical_array( + const std::shared_ptr& _arr) noexcept { + if (!_arr) { + return error( + "Could not transform the numerical array. std::shared_ptr not set."); + } + + using ArrayType = typename ArrowTypes::ArrayType; + + if (_arr->type()->Equals(ArrowTypes::data_type())) { + return Ref::make(std::static_pointer_cast(_arr)); + + } else if (_arr->type()->Equals(ArrowTypes::data_type())) { + return transform_numerical_array_impl( + std::static_pointer_cast::ArrayType>( + _arr)); + + } else if (_arr->type()->Equals(ArrowTypes::data_type())) { + return transform_numerical_array_impl( + std::static_pointer_cast::ArrayType>( + _arr)); + + } else if (_arr->type()->Equals(ArrowTypes::data_type())) { + return transform_numerical_array_impl( + std::static_pointer_cast::ArrayType>( + _arr)); + + } else if (_arr->type()->Equals(ArrowTypes::data_type())) { + return transform_numerical_array_impl( + std::static_pointer_cast::ArrayType>( + _arr)); + + } else if (_arr->type()->Equals(ArrowTypes::data_type())) { + return transform_numerical_array_impl( + std::static_pointer_cast::ArrayType>( + _arr)); + + } else if (_arr->type()->Equals(ArrowTypes::data_type())) { + return transform_numerical_array_impl( + std::static_pointer_cast::ArrayType>( + _arr)); + + } else if (_arr->type()->Equals(ArrowTypes::data_type())) { + return transform_numerical_array_impl( + std::static_pointer_cast::ArrayType>( + _arr)); + + } else if (_arr->type()->Equals(ArrowTypes::data_type())) { + return transform_numerical_array_impl( + std::static_pointer_cast::ArrayType>( + _arr)); + + } else if (_arr->type()->Equals(ArrowTypes::data_type())) { + return transform_numerical_array_impl( + std::static_pointer_cast::ArrayType>( + _arr)); + + } else if (_arr->type()->Equals(ArrowTypes::data_type())) { + return transform_numerical_array_impl( + std::static_pointer_cast::ArrayType>( + _arr)); + + } else { + return error("Expected numerical array, got " + _arr->type()->ToString() + + "."); + } +} + +} // namespace rfl::parsing::tabular + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/tabular/ArrowWriter.hpp b/build-config/reflect-cpp/include/rfl/parsing/tabular/ArrowWriter.hpp new file mode 100644 index 0000000..fbe1444 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/tabular/ArrowWriter.hpp @@ -0,0 +1,118 @@ +#ifndef RFL_PARSING_TABULAR_ARROWWRITER_HPP_ +#define RFL_PARSING_TABULAR_ARROWWRITER_HPP_ + +#include + +#include +#include +#include + +#include "../../Processors.hpp" +#include "../../Tuple.hpp" +#include "../../get.hpp" +#include "../../named_tuple_t.hpp" +#include "../../to_view.hpp" +#include "add_to_builder.hpp" +#include "make_arrow_builders.hpp" +#include "make_arrow_data_types.hpp" +#include "make_arrow_schema.hpp" + +namespace rfl::parsing::tabular { + +template +class ArrowWriter { + static_assert(!Processors::add_tags_to_variants_, + "rfl::AddTagsToVariants cannot be used for tabular data."); + static_assert(!Processors::add_namespaced_tags_to_variants_, + "rfl::AddNamespacedTagsToVariants cannot be used for tabular data."); + static_assert(!Processors::all_required_, + "rfl::NoOptionals cannot be used for tabular data."); + static_assert(!Processors::default_if_missing_, + "rfl::DefaultIfMissing cannot be used for tabular data."); + static_assert(!Processors::no_extra_fields_, + "rfl::NoExtraFields cannot be used for tabular data (neither " + "can rfl::ExtraFields)."); + static_assert(!Processors::no_field_names_, + "rfl::NoFieldNames cannot be used for tabular data."); + + public: + using ValueType = typename std::remove_cvref_t; + + ArrowWriter(const size_t _chunksize) : chunksize_(_chunksize) {} + + ~ArrowWriter() = default; + + std::shared_ptr to_table(const VecType& _data) const { + return arrow::Table::Make( + make_arrow_schema, _s>(), + to_chunked_arrays(_data)); + } + + private: + std::vector> to_chunked_arrays( + const VecType& _data) const; + + private: + size_t chunksize_; +}; + +template +std::vector> +ArrowWriter::to_chunked_arrays(const VecType& _data) const { + using ValueType = typename VecType::value_type; + + auto builders = + make_arrow_builders, _s>(); + + constexpr size_t size = tuple_size_v; + + std::vector>> array_chunks(size); + + auto it = _data.begin(); + + while (it != _data.end()) { + size_t i = 0; + + for (; it != _data.end() && (i < chunksize_ || chunksize_ == 0); + ++i, ++it) { + const auto view = to_view(*it); + + [&](const auto& _v, auto* _b, + std::integer_sequence) { + (add_to_builder<_s>(*get<_is>(_v), &(_b->template get<_is>())), ...); + }(view, &builders, std::make_integer_sequence()); + } + + if (i != 0) { + std::vector> chunks(size); + + const auto finish_builder = [](auto* _b, auto* _c) { + const auto status = _b->Finish(_c); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + }; + + [&](auto* _b, auto* _c, + std::integer_sequence) { + (finish_builder(&_b->template get<_is>(), &_c->at(_is)), ...); + }(&builders, &chunks, std::make_integer_sequence()); + + for (size_t j = 0; j < size; ++j) { + array_chunks.at(j).emplace_back(std::move(chunks.at(j))); + } + } + } + + const auto data_types = make_arrow_data_types(); + + return [&](std::integer_sequence) { + return std::vector>( + {std::make_shared(array_chunks.at(_is), + std::get<_is>(data_types))...}); + }(std::make_integer_sequence()); +} + +} // namespace rfl::parsing::tabular + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/tabular/ChunkedArrayIterator.hpp b/build-config/reflect-cpp/include/rfl/parsing/tabular/ChunkedArrayIterator.hpp new file mode 100644 index 0000000..b29a272 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/tabular/ChunkedArrayIterator.hpp @@ -0,0 +1,88 @@ +#ifndef RFL_PARSING_TABULAR_CHUNKEDARRAYITERATOR_HPP_ +#define RFL_PARSING_TABULAR_CHUNKEDARRAYITERATOR_HPP_ + +#include + +#include "../../Ref.hpp" +#include "../../Result.hpp" +#include "../../internal/ptr_cast.hpp" +#include "../is_required.hpp" +#include "array_t.hpp" + +namespace rfl::parsing::tabular { + +template +class ChunkedArrayIterator { + public: + using difference_type = std::ptrdiff_t; + using value_type = Result; + + using ArrayType = array_t; + + static ChunkedArrayIterator make(const Ref& _arr) { + return ChunkedArrayIterator(_arr); + } + + ChunkedArrayIterator(const Ref& _arr) + : arr_(_arr), chunk_ix_(0), current_chunk_(get_chunk(arr_, 0)), ix_(0) {} + + ~ChunkedArrayIterator() = default; + + Result operator*() const noexcept { + const bool is_null = + current_chunk_ + .transform([&](const auto& _c) { return _c->IsNull(ix_); }) + .value_or(false); + + if (is_null) { + if constexpr (is_required()) { + return error("Value cannot be null."); + } else { + return T(); + } + } + + return current_chunk_.and_then( + [&](const auto& _c) { return ArrowTypes::get_value(_c, ix_); }); + } + + bool end() const noexcept { return chunk_ix_ >= arr_->num_chunks(); } + + ChunkedArrayIterator& operator++() noexcept { + if (!current_chunk_) { + return *this; + } + ++ix_; + if (ix_ >= (*current_chunk_)->length()) { + ++chunk_ix_; + current_chunk_ = get_chunk(arr_, chunk_ix_); + ix_ = 0; + } + return *this; + } + + void operator++(int) noexcept { ++*this; } + + private: + static Result> get_chunk(const Ref& _arr, + const int _chunk_ix) noexcept { + if (_chunk_ix < _arr->num_chunks()) { + return ArrowTypes::get_array(_arr->chunk(_chunk_ix)); + } else { + return error("chunk_ix out of bounds."); + } + } + + private: + Ref arr_; + + int chunk_ix_; + + Result> current_chunk_; + + int64_t ix_; +}; + +} // namespace rfl::parsing::tabular + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/tabular/add_to_builder.hpp b/build-config/reflect-cpp/include/rfl/parsing/tabular/add_to_builder.hpp new file mode 100644 index 0000000..d353cbc --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/tabular/add_to_builder.hpp @@ -0,0 +1,19 @@ +#ifndef RFL_PARSING_TABULAR_ADD_TO_BUILDER_HPP_ +#define RFL_PARSING_TABULAR_ADD_TO_BUILDER_HPP_ + +#include + +#include "../../named_tuple_t.hpp" +#include "ArrowTypes.hpp" + +namespace rfl::parsing::tabular { + +template +inline void add_to_builder(const ValueType& _val, BuilderType* _builder) { + ArrowTypes, _s>::add_to_builder(_val, + _builder); +} + +} // namespace rfl::parsing::tabular + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/tabular/array_t.hpp b/build-config/reflect-cpp/include/rfl/parsing/tabular/array_t.hpp new file mode 100644 index 0000000..2e8cd7e --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/tabular/array_t.hpp @@ -0,0 +1,13 @@ +#ifndef RFL_PARSING_TABULAR_ARRAYT_HPP_ +#define RFL_PARSING_TABULAR_ARRAYT_HPP_ + +#include "ArrowTypes.hpp" + +namespace rfl::parsing::tabular { + +template +using array_t = typename ArrowTypes, _s>::ArrayType; + +} // namespace rfl::parsing::tabular + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/tabular/make_arrow_builders.hpp b/build-config/reflect-cpp/include/rfl/parsing/tabular/make_arrow_builders.hpp new file mode 100644 index 0000000..1ab8e50 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/tabular/make_arrow_builders.hpp @@ -0,0 +1,53 @@ +#ifndef RFL_PARSING_TABULAR_MAKEARROWBUILDERS_HPP_ +#define RFL_PARSING_TABULAR_MAKEARROWBUILDERS_HPP_ + +#include + +#include + +#include "../../named_tuple_t.hpp" +#include "ArrowTypes.hpp" + +namespace rfl::parsing::tabular { + +template +using arrow_builder_t = + typename ArrowTypes>, + _s>::BuilderType; + +template +struct ArrowBuildersType; + +template +struct ArrowBuildersType, _s> { + using Type = Tuple...>; + + static auto data_types() { + return [&](std::integer_sequence) { + return std::array, + sizeof...(FieldTypes)>( + {ArrowTypes::data_type()...}); + }(std::make_integer_sequence()); + } + + static Type make_builders() { + return Type(ArrowTypes::make_builder()...); + } + + static auto schema() { + const auto fields = + std::vector>({arrow::field( + typename FieldTypes::Name().str(), + ArrowTypes::data_type())...}); + return arrow::schema(fields); + } +}; + +template +auto make_arrow_builders() { + return ArrowBuildersType, _s>::make_builders(); +} + +} // namespace rfl::parsing::tabular + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/tabular/make_arrow_data_types.hpp b/build-config/reflect-cpp/include/rfl/parsing/tabular/make_arrow_data_types.hpp new file mode 100644 index 0000000..d153fcf --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/tabular/make_arrow_data_types.hpp @@ -0,0 +1,19 @@ +#ifndef RFL_PARSING_TABULAR_MAKE_ARROW_DATA_TYPES_HPP_ +#define RFL_PARSING_TABULAR_MAKE_ARROW_DATA_TYPES_HPP_ + +#include + +#include "../../named_tuple_t.hpp" +#include "make_arrow_builders.hpp" + +namespace rfl::parsing::tabular { + +template +inline auto make_arrow_data_types() { + return ArrowBuildersType>, + _s>::data_types(); +} + +} // namespace rfl::parsing::tabular + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/tabular/make_arrow_schema.hpp b/build-config/reflect-cpp/include/rfl/parsing/tabular/make_arrow_schema.hpp new file mode 100644 index 0000000..8139b45 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/tabular/make_arrow_schema.hpp @@ -0,0 +1,18 @@ +#ifndef RFL_PARSING_TABULAR_MAKE_ARROW_SCHEMA_HPP_ +#define RFL_PARSING_TABULAR_MAKE_ARROW_SCHEMA_HPP_ + +#include + +#include "../../named_tuple_t.hpp" +#include "make_arrow_builders.hpp" + +namespace rfl::parsing::tabular { + +template +inline auto make_arrow_schema() { + return ArrowBuildersType>, _s>::schema(); +} + +} // namespace rfl::parsing::tabular + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/tabular/make_chunked_array_iterators.hpp b/build-config/reflect-cpp/include/rfl/parsing/tabular/make_chunked_array_iterators.hpp new file mode 100644 index 0000000..bf65dff --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/tabular/make_chunked_array_iterators.hpp @@ -0,0 +1,52 @@ +#ifndef RFL_PARSING_TABULAR_MAKECHUNKEDARRAYITERATORS_HPP_ +#define RFL_PARSING_TABULAR_MAKECHUNKEDARRAYITERATORS_HPP_ + +#include + +#include + +#include "../../NamedTuple.hpp" +#include "../../Ref.hpp" +#include "../../Result.hpp" +#include "../../Tuple.hpp" +#include "ChunkedArrayIterator.hpp" + +namespace rfl::parsing::tabular { + +template +struct MakeChunkedArrayIterators; + +template +struct MakeChunkedArrayIterators, _s> { + using TupleType = + Tuple...>; + + Result operator()(const Ref& _table) const { + const auto get_column = + [&](const std::string& _colname) -> Result> { + const auto col = _table->GetColumnByName(_colname); + if (!col) { + return error("Column named '" + _colname + "' not found."); + } + return Ref::make(col); + }; + + try { + return TupleType( + get_column(typename FieldTypes::Name().str()) + .transform( + ChunkedArrayIterator::make) + .value()...); + } catch (const std::exception& e) { + return error(e.what()); + } + } +}; + +template +const auto make_chunked_array_iterators = + MakeChunkedArrayIterators{}; + +} // namespace rfl::parsing::tabular + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/tagged_union_wrapper_no_ptr.hpp b/build-config/reflect-cpp/include/rfl/parsing/tagged_union_wrapper_no_ptr.hpp new file mode 100644 index 0000000..4638915 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/tagged_union_wrapper_no_ptr.hpp @@ -0,0 +1,41 @@ +#ifndef RFL_PARSING_TAGGEDUNIONWRAPPERNOPTR_HPP_ +#define RFL_PARSING_TAGGEDUNIONWRAPPERNOPTR_HPP_ + +#include + +#include "../internal/StringLiteral.hpp" +#include "TaggedUnionWrapper.hpp" + +namespace rfl { +namespace parsing { + +template +struct tagged_union_wrapper_no_ptr; + +template +struct tagged_union_wrapper_no_ptr { + using Type = T; +}; + +template +struct tagged_union_wrapper_no_ptr< + TaggedUnionWrapperNoFields> { + using Type = TaggedUnionWrapperNoFields; +}; + +template +struct tagged_union_wrapper_no_ptr> { + using Type = TaggedUnionWrapperWithFields; +}; + +template +using tagged_union_wrapper_no_ptr_t = + typename tagged_union_wrapper_no_ptr>::Type; + +} // namespace parsing +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/parsing/to_single_error_message.hpp b/build-config/reflect-cpp/include/rfl/parsing/to_single_error_message.hpp new file mode 100644 index 0000000..1f06635 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/parsing/to_single_error_message.hpp @@ -0,0 +1,44 @@ +#ifndef RFL_PARSING_TOSINGLEERRORMESSAGE_HPP_ +#define RFL_PARSING_TOSINGLEERRORMESSAGE_HPP_ + +#include +#include +#include +#include + +#include "../Result.hpp" +#include "../internal/strings/strings.hpp" + +namespace rfl::parsing { + +/// Combines a set of errors to a single, readable error message. +inline std::string to_single_error_message( + std::vector _errors, + std::optional _msg_prefix = std::nullopt, + size_t _err_limit = 10) { + if (_errors.size() == 1) { + return _errors[0].what(); + } else { + std::stringstream stream; + stream << (_msg_prefix + ? *_msg_prefix + : "Found " + std::to_string(_errors.size()) + " errors:"); + for (size_t i = 0; i < _errors.size() && i < _err_limit; ++i) { + stream << "\n" + << i + 1 << ") " + << internal::strings::replace_all(_errors.at(i).what(), "\n", + "\n "); + } + if (_errors.size() > _err_limit) { + stream << "\n...\nMore than " << _err_limit + << " errors occurred, but I am only showing the " + "first " + << _err_limit << "."; + } + return stream.str(); + } +} + +} // namespace rfl::parsing + +#endif diff --git a/build-config/reflect-cpp/include/rfl/patterns.hpp b/build-config/reflect-cpp/include/rfl/patterns.hpp new file mode 100644 index 0000000..23aa6a5 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/patterns.hpp @@ -0,0 +1,38 @@ +#ifndef RFL_PATTERNS_HPP_ +#define RFL_PATTERNS_HPP_ + +#include "Pattern.hpp" +#include "Validator.hpp" + +namespace rfl { + +/// This pattern only matches alphanumeric characters. +using AlphaNumeric = Pattern; + +/// This pattern will match valid Base64 encoded strings with or without +/// padding. +using Base64Encoded = Pattern; + +/// This pattern will match email addresses. +using Email = + Pattern; + +using UUIDv1 = Pattern< + R"(^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-1[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$)", + "UUIDv1">; + +using UUIDv2 = Pattern< + R"(^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-2[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$)", + "UUIDv2">; + +using UUIDv3 = Pattern< + R"(^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-3[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$)", + "UUIDv3">; + +using UUIDv4 = Pattern< + R"(^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$)", + "UUIDv4">; + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/remove_fields.hpp b/build-config/reflect-cpp/include/rfl/remove_fields.hpp new file mode 100644 index 0000000..3721abf --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/remove_fields.hpp @@ -0,0 +1,22 @@ +#ifndef RFL_REMOVEFIELDS_HPP_ +#define RFL_REMOVEFIELDS_HPP_ + +#include +#include +#include + +#include "internal/StringLiteral.hpp" +#include "internal/remove_fields.hpp" + +namespace rfl { + +/// Recursively removes all of the fields signified by _names from the +/// NamedTupleType. +template +using remove_fields_t = + typename internal::remove_fields, + _names...>::type; + +} // namespace rfl + +#endif // RFL_REMOVEFIELDS_HPP_ diff --git a/build-config/reflect-cpp/include/rfl/replace.hpp b/build-config/reflect-cpp/include/rfl/replace.hpp new file mode 100644 index 0000000..475b96e --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/replace.hpp @@ -0,0 +1,44 @@ +#ifndef RFL_REPLACE_HPP_ +#define RFL_REPLACE_HPP_ + +#include + +#include "from_named_tuple.hpp" + +namespace rfl { + +/// Replaces one or several fields, returning a new version +/// with the non-replaced fields left unchanged. +template +auto replace(T&& _t, RField&& _field, OtherRFields&&... _other_fields) { + if constexpr (internal::is_named_tuple_v) { + return std::forward(_t).replace( + to_named_tuple(std::forward(_field)), + to_named_tuple(std::forward(_other_fields))...); + } else { + return from_named_tuple( + to_named_tuple(std::forward(_t)) + .replace(to_named_tuple(std::forward(_field)), + to_named_tuple( + std::forward(_other_fields))...)); + } +} + +/// Replaces one or several fields, returning a new version +/// with the non-replaced fields left unchanged. +template +auto replace(const T& _t, RField&& _field, OtherRFields&&... _other_fields) { + if constexpr (internal::is_named_tuple_v) { + return _t.replace( + to_named_tuple(std::forward(_field)), + to_named_tuple(std::forward(_other_fields))...); + } else { + return from_named_tuple(to_named_tuple(_t).replace( + to_named_tuple(std::forward(_field)), + to_named_tuple(std::forward(_other_fields))...)); + } +} + +} // namespace rfl + +#endif diff --git a/build-config/reflect-cpp/include/rfl/thirdparty/ctre.hpp b/build-config/reflect-cpp/include/rfl/thirdparty/ctre.hpp new file mode 100644 index 0000000..4179626 --- /dev/null +++ b/build-config/reflect-cpp/include/rfl/thirdparty/ctre.hpp @@ -0,0 +1,5989 @@ +/* + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +--- LLVM Exceptions to the Apache 2.0 License ---- + +As an exception, if, as a result of your compiling your source code, portions +of this Software are embedded into an Object form of such source code, you +may redistribute such embedded portions in such Object form without complying +with the conditions of Sections 4(a), 4(b) and 4(d) of the License. + +In addition, if you combine or link compiled forms of this Software with +software that is licensed under the GPLv2 ("Combined Software") and if a +court of competent jurisdiction determines that the patent provision (Section +3), the indemnity provision (Section 9) or other Section of the License +conflicts with the conditions of the GPLv2, you may retroactively and +prospectively choose to deem waived or otherwise exclude such Section(s) of +the License, but only in their entirety and only with respect to the Combined +Software. +*/ +#ifndef CTRE_V2__CTRE__HPP +#define CTRE_V2__CTRE__HPP + +#ifndef CTRE_V2__CTRE__LITERALS__HPP +#define CTRE_V2__CTRE__LITERALS__HPP + +#ifndef CTRE_V2__CTLL__HPP +#define CTRE_V2__CTLL__HPP + +#ifndef CTLL__PARSER__HPP +#define CTLL__PARSER__HPP + +#ifndef CTLL__FIXED_STRING__GPP +#define CTLL__FIXED_STRING__GPP + +#ifndef CTLL_IN_A_MODULE +#include +#include +#include +#include +#include +#endif + +#ifndef CTLL__UTILITIES__HPP +#define CTLL__UTILITIES__HPP + +#ifndef CTLL_IN_A_MODULE +#include +#endif + +#ifdef CTLL_IN_A_MODULE +#define CTLL_EXPORT export +#else +#define CTLL_EXPORT +#endif + +#if defined __cpp_nontype_template_parameter_class + #define CTLL_CNTTP_COMPILER_CHECK 1 +#elif defined __cpp_nontype_template_args +// compiler which defines correctly feature test macro (not you clang) + #if __cpp_nontype_template_args >= 201911L + #define CTLL_CNTTP_COMPILER_CHECK 1 + #elif __cpp_nontype_template_args >= 201411L +// appleclang 13+ + #if defined __apple_build_version__ + #if defined __clang_major__ && __clang_major__ >= 13 +// but only in c++20 and more + #if __cplusplus > 201703L + #define CTLL_CNTTP_COMPILER_CHECK 1 + #endif + #endif + #else +// clang 12+ + #if defined __clang_major__ && __clang_major__ >= 12 +// but only in c++20 and more + #if __cplusplus > 201703L + #define CTLL_CNTTP_COMPILER_CHECK 1 + #endif + #endif + #endif + #endif +#endif + +#ifndef CTLL_CNTTP_COMPILER_CHECK + #define CTLL_CNTTP_COMPILER_CHECK 0 +#endif + +#ifdef _MSC_VER +#define CTLL_FORCE_INLINE __forceinline +#else +#define CTLL_FORCE_INLINE __attribute__((always_inline)) +#endif + +namespace ctll { + +template struct conditional_helper; + +template <> struct conditional_helper { + template using type = A; +}; + +template <> struct conditional_helper { + template using type = B; +}; + +template using conditional = typename conditional_helper::template type; + +} + +#endif + +namespace ctll { + +struct length_value_t { + uint32_t value; + uint8_t length; +}; + +constexpr length_value_t length_and_value_of_utf8_code_point(uint8_t first_unit) noexcept { + if ((first_unit & 0b1000'0000) == 0b0000'0000) return {static_cast(first_unit), 1}; + else if ((first_unit & 0b1110'0000) == 0b1100'0000) return {static_cast(first_unit & 0b0001'1111), 2}; + else if ((first_unit & 0b1111'0000) == 0b1110'0000) return {static_cast(first_unit & 0b0000'1111), 3}; + else if ((first_unit & 0b1111'1000) == 0b1111'0000) return {static_cast(first_unit & 0b0000'0111), 4}; + else if ((first_unit & 0b1111'1100) == 0b1111'1000) return {static_cast(first_unit & 0b0000'0011), 5}; + else if ((first_unit & 0b1111'1100) == 0b1111'1100) return {static_cast(first_unit & 0b0000'0001), 6}; + else return {0, 0}; +} + +constexpr char32_t value_of_trailing_utf8_code_point(uint8_t unit, bool & correct) noexcept { + if ((unit & 0b1100'0000) == 0b1000'0000) return unit & 0b0011'1111; + else { + correct = false; + return 0; + } +} + +constexpr length_value_t length_and_value_of_utf16_code_point(uint16_t first_unit) noexcept { + if ((first_unit & 0b1111110000000000) == 0b1101'1000'0000'0000) return {static_cast(first_unit & 0b0000001111111111), 2}; + else return {first_unit, 1}; +} + +struct construct_from_pointer_t { }; + +constexpr auto construct_from_pointer = construct_from_pointer_t{}; + +CTLL_EXPORT template struct fixed_string { + char32_t content[N] = {}; + size_t real_size{0}; + bool correct_flag{true}; + + template constexpr fixed_string(construct_from_pointer_t, const T * input) noexcept { + if constexpr (std::is_same_v) { + #ifdef CTRE_STRING_IS_UTF8 + size_t out{0}; + for (size_t i{0}; i < N; ++i) { + length_value_t info = length_and_value_of_utf8_code_point(input[i]); + switch (info.length) { + case 6: + if (++i < N) info.value = (info.value << 6) | value_of_trailing_utf8_code_point(input[i], correct_flag); + [[fallthrough]]; + case 5: + if (++i < N) info.value = (info.value << 6) | value_of_trailing_utf8_code_point(input[i], correct_flag); + [[fallthrough]]; + case 4: + if (++i < N) info.value = (info.value << 6) | value_of_trailing_utf8_code_point(input[i], correct_flag); + [[fallthrough]]; + case 3: + if (++i < N) info.value = (info.value << 6) | value_of_trailing_utf8_code_point(input[i], correct_flag); + [[fallthrough]]; + case 2: + if (++i < N) info.value = (info.value << 6) | value_of_trailing_utf8_code_point(input[i], correct_flag); + [[fallthrough]]; + case 1: + content[out++] = static_cast(info.value); + real_size++; + break; + default: + correct_flag = false; + return; + } + } + #else + for (size_t i{0}; i < N; ++i) { + content[i] = static_cast(input[i]); + real_size++; + } + #endif +#if defined(__cpp_char8_t) + } else if constexpr (std::is_same_v) { + size_t out{0}; + for (size_t i{0}; i < N; ++i) { + length_value_t info = length_and_value_of_utf8_code_point(input[i]); + switch (info.length) { + case 6: + if (++i < N) info.value = (info.value << 6) | value_of_trailing_utf8_code_point(input[i], correct_flag); + [[fallthrough]]; + case 5: + if (++i < N) info.value = (info.value << 6) | value_of_trailing_utf8_code_point(input[i], correct_flag); + [[fallthrough]]; + case 4: + if (++i < N) info.value = (info.value << 6) | value_of_trailing_utf8_code_point(input[i], correct_flag); + [[fallthrough]]; + case 3: + if (++i < N) info.value = (info.value << 6) | value_of_trailing_utf8_code_point(input[i], correct_flag); + [[fallthrough]]; + case 2: + if (++i < N) info.value = (info.value << 6) | value_of_trailing_utf8_code_point(input[i], correct_flag); + [[fallthrough]]; + case 1: + content[out++] = static_cast(info.value); + real_size++; + break; + default: + correct_flag = false; + return; + } + } +#endif + } else if constexpr (std::is_same_v) { + size_t out{0}; + for (size_t i{0}; i < N; ++i) { + length_value_t info = length_and_value_of_utf16_code_point(input[i]); + if (info.length == 2) { + if (++i < N) { + if ((input[i] & 0b1111'1100'0000'0000) == 0b1101'1100'0000'0000) { + content[out++] = ((info.value << 10) | (input[i] & 0b0000'0011'1111'1111)) + 0x10000; + } else { + correct_flag = false; + break; + } + } + } else { + content[out++] = info.value; + } + } + real_size = out; + } else if constexpr (std::is_same_v || std::is_same_v) { + for (size_t i{0}; i < N; ++i) { + content[i] = static_cast(input[i]); + real_size++; + } + } + } + + template constexpr fixed_string(const std::array & in) noexcept: fixed_string{construct_from_pointer, in.data()} { } + template constexpr fixed_string(const T (&input)[N+1]) noexcept: fixed_string{construct_from_pointer, input} { } + + constexpr fixed_string(const fixed_string & other) noexcept { + for (size_t i{0}; i < N; ++i) { + content[i] = other.content[i]; + } + real_size = other.real_size; + correct_flag = other.correct_flag; + } + constexpr bool correct() const noexcept { + return correct_flag; + } + constexpr size_t size() const noexcept { + return real_size; + } + constexpr const char32_t * begin() const noexcept { + return content; + } + constexpr const char32_t * end() const noexcept { + return content + size(); + } + constexpr char32_t operator[](size_t i) const noexcept { + return content[i]; + } + template constexpr bool is_same_as(const fixed_string & rhs) const noexcept { + if (real_size != rhs.size()) return false; + for (size_t i{0}; i != real_size; ++i) { + if (content[i] != rhs[i]) return false; + } + return true; + } + constexpr operator std::basic_string_view() const noexcept { + return std::basic_string_view{content, size()}; + } +}; + +template <> class fixed_string<0> { + static constexpr char32_t empty[1] = {0}; +public: + template constexpr fixed_string(const T *) noexcept { + + } + constexpr fixed_string(std::initializer_list) noexcept { + + } + constexpr fixed_string(const fixed_string &) noexcept { + + } + constexpr bool correct() const noexcept { + return true; + } + constexpr size_t size() const noexcept { + return 0; + } + constexpr const char32_t * begin() const noexcept { + return empty; + } + constexpr const char32_t * end() const noexcept { + return empty + size(); + } + constexpr char32_t operator[](size_t) const noexcept { + return 0; + } + constexpr operator std::basic_string_view() const noexcept { + return std::basic_string_view{empty, 0}; + } +}; + +template fixed_string(const CharT (&)[N]) -> fixed_string; +template fixed_string(const std::array &) -> fixed_string; + +template fixed_string(fixed_string) -> fixed_string; + +} + +#endif + +#ifndef CTLL__TYPE_STACK__HPP +#define CTLL__TYPE_STACK__HPP + +namespace ctll { + +template struct list { }; + +struct _nothing { }; + +using empty_list = list<>; + +// calculate size of list content +template constexpr auto size(list) noexcept { return sizeof...(Ts); } + + +// check if the list is empty +template constexpr bool empty(list) noexcept { return false; } +constexpr bool empty(empty_list) { return true; } + +// concat two lists together left to right +template constexpr auto concat(list, list) noexcept -> list { return {}; } + +// push something to the front of a list +template constexpr auto push_front(T, list) noexcept -> list { return {}; } + +// pop element from the front of a list +template constexpr auto pop_front(list) noexcept -> list { return {}; } +constexpr auto pop_front(empty_list) -> empty_list; + +// pop element from the front of a list and return new typelist too +template struct list_pop_pair { + Front front{}; + List list{}; + constexpr list_pop_pair() = default; +}; + +template constexpr auto pop_and_get_front(list, T = T()) noexcept -> list_pop_pair> { return {}; } +template constexpr auto pop_and_get_front(empty_list, T = T()) noexcept -> list_pop_pair { return {}; } + +// return front of the list +template constexpr auto front(list, T = T()) noexcept -> Head { return {}; } +template constexpr auto front(empty_list, T = T()) noexcept -> T { return {}; } + +// rotate list +template struct rotate_item { + template friend constexpr auto operator+(list, rotate_item) noexcept -> list { return {}; } +}; + +template constexpr auto rotate(list) -> decltype((list<>{} + ... + rotate_item{})) { + return {}; +} + +// set operations +template struct item_matcher { + struct not_selected { + template friend constexpr auto operator+(list, not_selected) -> list; + }; + template struct wrapper { + template friend constexpr auto operator+(list, wrapper) -> list; + }; + + static constexpr auto check(T) { return std::true_type{}; } + static constexpr auto check(...) { return std::false_type{}; } + static constexpr auto select(T) { return not_selected{}; } + template static constexpr auto select(Y) { return wrapper{}; } +}; + +template constexpr bool exists_in(T, list) noexcept { + return (item_matcher::check(Ts{}) || ... || false); +} + +template constexpr auto add_item(T item, list l) noexcept { + if constexpr (exists_in(item, l)) { + return l; + } else { + return list{}; + } +} + +template constexpr auto remove_item(T, list) noexcept { + item_matcher matcher; + return decltype((list<>{} + ... + matcher.select(Ts{}))){}; +} + +} + +#endif + +#ifndef CTLL__GRAMMARS__HPP +#define CTLL__GRAMMARS__HPP + +namespace ctll { + +// terminal type representing symbol / character of any type +template struct term { + static constexpr auto value = v; +}; + +// epsilon = nothing on input tape +// also used as an command for parsing means "do nothing" +struct epsilon { + static constexpr auto value = '-'; +}; + +// empty_stack_symbol = nothing on stack +struct empty_stack_symbol {}; + +// push is alias to list +template using push = list; + +// accept/reject type for controlling output of LL1 machine +struct accept { constexpr explicit operator bool() noexcept { return true; } }; +struct reject { constexpr explicit operator bool() noexcept { return false; } }; + +// action type, every action item in grammar must inherit from +struct action { + struct action_tag { }; +}; + +// move one character forward and pop it from stack command +struct pop_input { + struct pop_input_tag { }; +}; + +// additional overloads for type list +template constexpr auto push_front(pop_input, list) -> list { return {}; } + +template constexpr auto push_front(epsilon, list) -> list { return {}; } + +template constexpr auto push_front(list, list) -> list { return {}; } + +template constexpr auto pop_front_and_push_front(T item, list l) { + return push_front(item, pop_front(l)); +} + +// SPECIAL matching types for nicer grammars + +// match any term +struct anything { + constexpr inline anything() noexcept { } + template constexpr anything(term) noexcept; +}; + +// match range of term A-B +template struct range { + constexpr inline range() noexcept { } + //template constexpr range(term) noexcept requires (A <= V) && (V <= B); + template > constexpr range(term) noexcept; +}; + +#ifdef __EDG__ +template struct contains { + static constexpr bool value = ((Set == V) || ... || false); +}; +#endif + +// match terms defined in set +template struct set { + constexpr inline set() noexcept { } + #ifdef __EDG__ + template ::value>> constexpr set(term) noexcept; + #else + template > constexpr set(term) noexcept; + #endif +}; + +// match terms not defined in set +template struct neg_set { + constexpr inline neg_set() noexcept { } + + #ifdef __EDG__ + template ::value>> constexpr neg_set(term) noexcept; + #else + template > constexpr neg_set(term) noexcept; + #endif +}; + +// AUGMENTED grammar which completes user-defined grammar for all other cases +template struct augment_grammar: public Grammar { + // start nonterminal is defined in parent type + using typename Grammar::_start; + + // grammar rules are inherited from Grammar parent type + using Grammar::rule; + + // term on stack and on input means pop_input; + template static constexpr auto rule(term, term) -> ctll::pop_input; + + // if the type on stack (range, set, neg_set, anything) is constructible from the terminal => pop_input + template static constexpr auto rule(Expected, term) -> std::enable_if_t>, ctll::pop_input>; + + // empty stack and empty input means we are accepting + static constexpr auto rule(empty_stack_symbol, epsilon) -> ctll::accept; + + // not matching anything else => reject + static constexpr auto rule(...) -> ctll::reject; + + // start stack is just a list; + using start_stack = list; +}; + +} + +#endif + +#ifndef CTLL__ACTIONS__HPP +#define CTLL__ACTIONS__HPP + +namespace ctll { + struct empty_subject { }; + + struct empty_actions { + // dummy operator so using Actions::operator() later will not give error + template static constexpr auto apply(Action, InputSymbol, Subject subject) { + return subject; + } + }; + + template struct identity: public Actions { + using Actions::apply; + // allow empty_subject to exists + template constexpr static auto apply(Action, term, empty_subject) -> empty_subject { return {}; } + template constexpr static auto apply(Action, epsilon, empty_subject) -> empty_subject { return {}; } + }; + + template struct ignore_unknown: public Actions { + using Actions::apply; + // allow flow thru unknown actions + template constexpr static auto apply(Action, term, Subject) -> Subject { return {}; } + template constexpr static auto apply(Action, epsilon, Subject) -> Subject { return {}; } + }; +} + +#endif + +#ifndef CTLL_IN_A_MODULE +#include +#endif + +namespace ctll { + +enum class decision { + reject, + accept, + undecided +}; + +struct placeholder { }; + +template using index_placeholder = placeholder; + +#if CTLL_CNTTP_COMPILER_CHECK +template struct parser { // in c++20 +#else +template struct parser { +#endif + + #ifdef __GNUC__ // workaround to GCC bug + #if CTLL_CNTTP_COMPILER_CHECK + static constexpr auto _input = input; // c++20 mode + #else + static constexpr auto & _input = input; // c++17 mode + #endif + #else + static constexpr auto _input = input; // everyone else + #endif + + using Actions = ctll::conditional, identity>; + using grammar = augment_grammar; + + template struct results { + + static constexpr bool is_correct = Decision == decision::accept; + + constexpr inline CTLL_FORCE_INLINE operator bool() const noexcept { + return is_correct; + } + + #ifdef __GNUC__ // workaround to GCC bug + #if CTLL_CNTTP_COMPILER_CHECK + static constexpr auto _input = input; // c++20 mode + #else + static constexpr auto & _input = input; // c++17 mode + #endif + #else + static constexpr auto _input = input; // everyone else + #endif + + using output_type = Subject; + static constexpr size_t position = Pos; + + constexpr auto operator+(placeholder) const noexcept { + if constexpr (Decision == decision::undecided) { + // parse for current char (RPos) with previous stack and subject :) + return parser::template decide({}, {}); + } else { + // if there is decision already => just push it to the end of fold expression + return *this; + } + } + }; + + template static constexpr auto get_current_term() noexcept { + if constexpr (Pos < input.size()) { + constexpr auto value = input[Pos]; + if constexpr (value <= static_cast((std::numeric_limits::max)())) { + return term(value)>{}; + } else { + return term{}; + } + + } else { + // return epsilon if we are past the input + return epsilon{}; + } + } + template static constexpr auto get_previous_term() noexcept { + if constexpr (Pos == 0) { + // there is no previous character on input if we are on start + return epsilon{}; + } else if constexpr ((Pos-1) < input.size()) { + constexpr auto value = input[Pos-1]; + if constexpr (value <= static_cast((std::numeric_limits::max)())) { + return term(value)>{}; + } else { + return term{}; + } + } else { + return epsilon{}; + } + } + // if rule is accept => return true and subject + template + static constexpr auto move(ctll::accept, Terminal, Stack, Subject) noexcept { + return typename parser::template results(); + } + // if rule is reject => return false and subject + template + static constexpr auto move(ctll::reject, Terminal, Stack, Subject) noexcept { + return typename parser::template results(); + } + // if rule is pop_input => move to next character + template + static constexpr auto move(ctll::pop_input, Terminal, Stack, Subject) noexcept { + return typename parser::template results(); + } + // if rule is string => push it to the front of stack + template + static constexpr auto move(push string, Terminal, Stack stack, Subject subject) noexcept { + return decide(push_front(string, stack), subject); + } + // if rule is epsilon (empty string) => continue + template + static constexpr auto move(epsilon, Terminal, Stack stack, Subject subject) noexcept { + return decide(stack, subject); + } + // if rule is string with current character at the beginning (term) => move to next character + // and push string without the character (quick LL(1)) + template + static constexpr auto move(push, Content...>, term, Stack stack, Subject) noexcept { + constexpr auto local_input = input; + return typename parser::template results(), stack)), Subject, decision::undecided>(); + } + // if rule is string with any character at the beginning (compatible with current term) => move to next character + // and push string without the character (quick LL(1)) + template + static constexpr auto move(push, term, Stack stack, Subject) noexcept { + constexpr auto local_input = input; + return typename parser::template results(), stack)), Subject, decision::undecided>(); + } + // decide if we need to take action or move + template static constexpr auto decide(Stack previous_stack, Subject previous_subject) noexcept { + // each call means we pop something from stack + auto top_symbol = decltype(ctll::front(previous_stack, empty_stack_symbol()))(); + // gcc pedantic warning + [[maybe_unused]] auto stack = decltype(ctll::pop_front(previous_stack))(); + + // in case top_symbol is action type (apply it on previous subject and get new one) + if constexpr (std::is_base_of_v) { + auto subject = Actions::apply(top_symbol, get_previous_term(), previous_subject); + + // in case that semantic action is error => reject input + if constexpr (std::is_same_v) { + return typename parser::template results(); + } else { + return decide(stack, subject); + } + } else { + // all other cases are ordinary for LL(1) parser + auto current_term = get_current_term(); + auto rule = decltype(grammar::rule(top_symbol,current_term))(); + return move(rule, current_term, stack, previous_subject); + } + } + + // trampolines with folded expression + template static constexpr auto trampoline_decide(Subject, std::index_sequence) noexcept { + // parse everything for first char and than for next and next ... + // Pos+1 is needed as we want to finish calculation with epsilons on stack + auto v = (decide<0, typename grammar::start_stack, Subject>({}, {}) + ... + index_placeholder()); + return v; + } + + template static constexpr auto trampoline_decide(Subject subject = {}) noexcept { + // there will be no recursion, just sequence long as the input + return trampoline_decide(subject, std::make_index_sequence()); + } + + template using output = decltype(trampoline_decide()); + template static inline constexpr bool correct_with = trampoline_decide(); + +}; + +} // end of ctll namespace + +#endif + +#endif + +#ifndef CTRE__PCRE_ACTIONS__HPP +#define CTRE__PCRE_ACTIONS__HPP + +#ifndef CTRE__PCRE__HPP +#define CTRE__PCRE__HPP + +// THIS FILE WAS GENERATED BY DESATOMAT TOOL, DO NOT MODIFY THIS FILE + +namespace ctre { + +struct pcre { + +// NONTERMINALS: + struct a {}; + struct b {}; + struct backslash {}; + struct backslash_range {}; + struct block {}; + struct block_name2 {}; + struct block_name {}; + struct c {}; + struct class_named_name {}; + struct content2 {}; + struct content_in_capture {}; + struct content_or_empty {}; + struct d {}; + struct e {}; + struct f {}; + struct g {}; + struct h {}; + struct hexdec_repeat {}; + struct i {}; + struct j {}; + struct k {}; + struct l {}; + struct m {}; + struct mod {}; + struct mode_switch2 {}; + struct n {}; + struct number2 {}; + struct number {}; + struct o {}; + struct opt_content {}; + struct p {}; + struct property_name2 {}; + struct property_name {}; + struct property_value2 {}; + struct property_value {}; + struct range {}; + struct repeat {}; + struct s {}; using _start = s; + struct set2a {}; + struct set2b {}; + struct string2 {}; + +// 'action' types: + struct class_digit: ctll::action {}; + struct class_horizontal_space: ctll::action {}; + struct class_named_alnum: ctll::action {}; + struct class_named_alpha: ctll::action {}; + struct class_named_ascii: ctll::action {}; + struct class_named_blank: ctll::action {}; + struct class_named_cntrl: ctll::action {}; + struct class_named_digit: ctll::action {}; + struct class_named_graph: ctll::action {}; + struct class_named_lower: ctll::action {}; + struct class_named_print: ctll::action {}; + struct class_named_punct: ctll::action {}; + struct class_named_space: ctll::action {}; + struct class_named_upper: ctll::action {}; + struct class_named_word: ctll::action {}; + struct class_named_xdigit: ctll::action {}; + struct class_non_horizontal_space: ctll::action {}; + struct class_non_vertical_space: ctll::action {}; + struct class_nondigit: ctll::action {}; + struct class_nonnewline: ctll::action {}; + struct class_nonspace: ctll::action {}; + struct class_nonword: ctll::action {}; + struct class_space: ctll::action {}; + struct class_vertical_space: ctll::action {}; + struct class_word: ctll::action {}; + struct create_hexdec: ctll::action {}; + struct create_number: ctll::action {}; + struct finish_hexdec: ctll::action {}; + struct look_finish: ctll::action {}; + struct make_alternate: ctll::action {}; + struct make_atomic: ctll::action {}; + struct make_back_reference: ctll::action {}; + struct make_capture: ctll::action {}; + struct make_capture_with_name: ctll::action {}; + struct make_lazy: ctll::action {}; + struct make_optional: ctll::action {}; + struct make_possessive: ctll::action {}; + struct make_property: ctll::action {}; + struct make_property_negative: ctll::action {}; + struct make_range: ctll::action {}; + struct make_relative_back_reference: ctll::action {}; + struct make_sequence: ctll::action {}; + struct mode_case_insensitive: ctll::action {}; + struct mode_case_sensitive: ctll::action {}; + struct mode_multiline: ctll::action {}; + struct mode_singleline: ctll::action {}; + struct negate_class_named: ctll::action {}; + struct prepare_capture: ctll::action {}; + struct push_assert_begin: ctll::action {}; + struct push_assert_end: ctll::action {}; + struct push_assert_subject_begin: ctll::action {}; + struct push_assert_subject_end: ctll::action {}; + struct push_assert_subject_end_with_lineend: ctll::action {}; + struct push_character: ctll::action {}; + struct push_character_alarm: ctll::action {}; + struct push_character_anything: ctll::action {}; + struct push_character_escape: ctll::action {}; + struct push_character_formfeed: ctll::action {}; + struct push_character_newline: ctll::action {}; + struct push_character_null: ctll::action {}; + struct push_character_return_carriage: ctll::action {}; + struct push_character_tab: ctll::action {}; + struct push_empty: ctll::action {}; + struct push_hexdec: ctll::action {}; + struct push_name: ctll::action {}; + struct push_not_word_boundary: ctll::action {}; + struct push_number: ctll::action {}; + struct push_property_name: ctll::action {}; + struct push_property_value: ctll::action {}; + struct push_word_boundary: ctll::action {}; + struct repeat_ab: ctll::action {}; + struct repeat_at_least: ctll::action {}; + struct repeat_exactly: ctll::action {}; + struct repeat_plus: ctll::action {}; + struct repeat_star: ctll::action {}; + struct reset_capture: ctll::action {}; + struct set_combine: ctll::action {}; + struct set_empty: ctll::action {}; + struct set_make: ctll::action {}; + struct set_make_negative: ctll::action {}; + struct set_start: ctll::action {}; + struct start_atomic: ctll::action {}; + struct start_lookahead_negative: ctll::action {}; + struct start_lookahead_positive: ctll::action {}; + struct start_lookbehind_negative: ctll::action {}; + struct start_lookbehind_positive: ctll::action {}; + +// (q)LL1 function: + using _others = ctll::neg_set<'!','$','\x28','\x29','*','+',',','-','.','/','0','1','2','3','4','5','6','7','8','9',':','<','=','>','?','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','[','\\','\"',']','^','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','\x7B','|','\x7D'>; + static constexpr auto rule(s, ctll::term<'\\'>) -> ctll::push; + static constexpr auto rule(s, ctll::term<'['>) -> ctll::push; + static constexpr auto rule(s, ctll::term<'\x28'>) -> ctll::push; + static constexpr auto rule(s, ctll::term<'^'>) -> ctll::push; + static constexpr auto rule(s, ctll::term<'$'>) -> ctll::push; + static constexpr auto rule(s, ctll::set<'!',',','-','/','0','1','2','3','4','5','6','7','8','9',':','<','=','>','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','\"',']','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'>) -> ctll::push; + static constexpr auto rule(s, _others) -> ctll::push; + static constexpr auto rule(s, ctll::term<'.'>) -> ctll::push; + static constexpr auto rule(s, ctll::term<'|'>) -> ctll::push; + static constexpr auto rule(s, ctll::epsilon) -> ctll::push; + static constexpr auto rule(s, ctll::set<'\x29','*','+','?','\x7B','\x7D'>) -> ctll::reject; + + static constexpr auto rule(a, ctll::term<'\\'>) -> ctll::push; + static constexpr auto rule(a, ctll::term<'['>) -> ctll::push; + static constexpr auto rule(a, ctll::term<'\x28'>) -> ctll::push; + static constexpr auto rule(a, ctll::term<'^'>) -> ctll::push; + static constexpr auto rule(a, ctll::term<'$'>) -> ctll::push; + static constexpr auto rule(a, ctll::set<'!',',','-','/','0','1','2','3','4','5','6','7','8','9',':','<','=','>','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','\"',']','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'>) -> ctll::push; + static constexpr auto rule(a, _others) -> ctll::push; + static constexpr auto rule(a, ctll::term<'.'>) -> ctll::push; + static constexpr auto rule(a, ctll::term<'\x29'>) -> ctll::push; + static constexpr auto rule(a, ctll::epsilon) -> ctll::push; + static constexpr auto rule(a, ctll::set<'*','+','?','\x7B','|','\x7D'>) -> ctll::reject; + + static constexpr auto rule(b, ctll::term<','>) -> ctll::push; + static constexpr auto rule(b, ctll::term<'\x7D'>) -> ctll::push; + + static constexpr auto rule(backslash, ctll::term<'d'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::term<'h'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::term<'H'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::term<'V'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::term<'D'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::term<'N'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::term<'S'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::term<'W'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::term<'s'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::term<'v'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::term<'w'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::set<'1','2','3','4','5','6','7','8','9'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::term<'g'>) -> ctll::push, m>; + static constexpr auto rule(backslash, ctll::term<'p'>) -> ctll::push, property_name, ctll::term<'\x7D'>, make_property>; + static constexpr auto rule(backslash, ctll::term<'P'>) -> ctll::push, property_name, ctll::term<'\x7D'>, make_property_negative>; + static constexpr auto rule(backslash, ctll::term<'u'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::term<'x'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::term<'A'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::term<'z'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::term<'Z'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::set<'$','\x28','\x29','*','+','-','.','/','<','>','?','[','\\','\"',']','^','\x7B','|','\x7D'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::term<'a'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::term<'e'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::term<'f'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::term<'n'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::term<'0'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::term<'r'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::term<'t'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::term<'B'>) -> ctll::push; + static constexpr auto rule(backslash, ctll::term<'b'>) -> ctll::push; + + static constexpr auto rule(backslash_range, ctll::term<'u'>) -> ctll::push; + static constexpr auto rule(backslash_range, ctll::term<'x'>) -> ctll::push; + static constexpr auto rule(backslash_range, ctll::set<'$','\x28','\x29','*','+','-','.','/','<','>','?','[','\\','\"',']','^','\x7B','|','\x7D'>) -> ctll::push; + static constexpr auto rule(backslash_range, ctll::term<'a'>) -> ctll::push; + static constexpr auto rule(backslash_range, ctll::term<'e'>) -> ctll::push; + static constexpr auto rule(backslash_range, ctll::term<'f'>) -> ctll::push; + static constexpr auto rule(backslash_range, ctll::term<'n'>) -> ctll::push; + static constexpr auto rule(backslash_range, ctll::term<'0'>) -> ctll::push; + static constexpr auto rule(backslash_range, ctll::term<'r'>) -> ctll::push; + static constexpr auto rule(backslash_range, ctll::term<'t'>) -> ctll::push; + + static constexpr auto rule(block, ctll::term<'\\'>) -> ctll::push>; + static constexpr auto rule(block, ctll::term<'['>) -> ctll::push>; + static constexpr auto rule(block, ctll::term<'?'>) -> ctll::push; + static constexpr auto rule(block, ctll::term<'\x28'>) -> ctll::push>; + static constexpr auto rule(block, ctll::term<'^'>) -> ctll::push>; + static constexpr auto rule(block, ctll::term<'$'>) -> ctll::push>; + static constexpr auto rule(block, ctll::set<'!',',','-','/','0','1','2','3','4','5','6','7','8','9',':','<','=','>','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','\"',']','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'>) -> ctll::push>; + static constexpr auto rule(block, _others) -> ctll::push>; + static constexpr auto rule(block, ctll::term<'.'>) -> ctll::push>; + static constexpr auto rule(block, ctll::term<'|'>) -> ctll::push>; + static constexpr auto rule(block, ctll::term<'\x29'>) -> ctll::push; + static constexpr auto rule(block, ctll::set<'*','+','\x7B','\x7D'>) -> ctll::reject; + + static constexpr auto rule(block_name2, ctll::set<'>','\x7D'>) -> ctll::epsilon; + static constexpr auto rule(block_name2, ctll::set<'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'>) -> ctll::push; + + static constexpr auto rule(block_name, ctll::set<'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'>) -> ctll::push; + + static constexpr auto rule(c, ctll::term<'['>) -> ctll::push, i, range, set_start, set2b, set_make, ctll::term<']'>>; + static constexpr auto rule(c, ctll::term<'\\'>) -> ctll::push>; + static constexpr auto rule(c, ctll::set<'!','$','\x28','\x29','*','+',',','.','/','0','1','2','3','4','5','6','7','8','9',':','<','=','>','?','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','\"','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','\x7B','|','\x7D'>) -> ctll::push>; + static constexpr auto rule(c, _others) -> ctll::push>; + static constexpr auto rule(c, ctll::term<'^'>) -> ctll::push>; + static constexpr auto rule(c, ctll::set<'-',']'>) -> ctll::reject; + + static constexpr auto rule(class_named_name, ctll::term<'x'>) -> ctll::push, ctll::term<'i'>, ctll::term<'g'>, ctll::term<'i'>, ctll::term<'t'>, class_named_xdigit>; + static constexpr auto rule(class_named_name, ctll::term<'d'>) -> ctll::push, ctll::term<'g'>, ctll::term<'i'>, ctll::term<'t'>, class_named_digit>; + static constexpr auto rule(class_named_name, ctll::term<'b'>) -> ctll::push, ctll::term<'a'>, ctll::term<'n'>, ctll::term<'k'>, class_named_blank>; + static constexpr auto rule(class_named_name, ctll::term<'c'>) -> ctll::push, ctll::term<'t'>, ctll::term<'r'>, ctll::term<'l'>, class_named_cntrl>; + static constexpr auto rule(class_named_name, ctll::term<'w'>) -> ctll::push, ctll::term<'r'>, ctll::term<'d'>, class_named_word>; + static constexpr auto rule(class_named_name, ctll::term<'l'>) -> ctll::push, ctll::term<'w'>, ctll::term<'e'>, ctll::term<'r'>, class_named_lower>; + static constexpr auto rule(class_named_name, ctll::term<'s'>) -> ctll::push, ctll::term<'a'>, ctll::term<'c'>, ctll::term<'e'>, class_named_space>; + static constexpr auto rule(class_named_name, ctll::term<'u'>) -> ctll::push, ctll::term<'p'>, ctll::term<'e'>, ctll::term<'r'>, class_named_upper>; + static constexpr auto rule(class_named_name, ctll::term<'g'>) -> ctll::push, ctll::term<'a'>, ctll::term<'p'>, ctll::term<'h'>, class_named_graph>; + static constexpr auto rule(class_named_name, ctll::term<'a'>) -> ctll::push; + static constexpr auto rule(class_named_name, ctll::term<'p'>) -> ctll::push; + + static constexpr auto rule(content2, ctll::term<'\x29'>) -> ctll::epsilon; + static constexpr auto rule(content2, ctll::epsilon) -> ctll::epsilon; + static constexpr auto rule(content2, ctll::term<'|'>) -> ctll::push; + + static constexpr auto rule(content_in_capture, ctll::term<'\\'>) -> ctll::push; + static constexpr auto rule(content_in_capture, ctll::term<'['>) -> ctll::push; + static constexpr auto rule(content_in_capture, ctll::term<'\x28'>) -> ctll::push; + static constexpr auto rule(content_in_capture, ctll::term<'^'>) -> ctll::push; + static constexpr auto rule(content_in_capture, ctll::term<'$'>) -> ctll::push; + static constexpr auto rule(content_in_capture, ctll::set<'!',',','-','/','0','1','2','3','4','5','6','7','8','9',':','<','=','>','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','\"',']','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'>) -> ctll::push; + static constexpr auto rule(content_in_capture, _others) -> ctll::push; + static constexpr auto rule(content_in_capture, ctll::term<'.'>) -> ctll::push; + static constexpr auto rule(content_in_capture, ctll::term<'|'>) -> ctll::push; + static constexpr auto rule(content_in_capture, ctll::term<'\x29'>) -> ctll::push; + static constexpr auto rule(content_in_capture, ctll::set<'*','+','?','\x7B','\x7D'>) -> ctll::reject; + + static constexpr auto rule(content_or_empty, ctll::term<'\\'>) -> ctll::push; + static constexpr auto rule(content_or_empty, ctll::term<'['>) -> ctll::push; + static constexpr auto rule(content_or_empty, ctll::term<'\x28'>) -> ctll::push; + static constexpr auto rule(content_or_empty, ctll::term<'^'>) -> ctll::push; + static constexpr auto rule(content_or_empty, ctll::term<'$'>) -> ctll::push; + static constexpr auto rule(content_or_empty, ctll::set<'!',',','-','/','0','1','2','3','4','5','6','7','8','9',':','<','=','>','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','\"',']','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'>) -> ctll::push; + static constexpr auto rule(content_or_empty, _others) -> ctll::push; + static constexpr auto rule(content_or_empty, ctll::term<'.'>) -> ctll::push; + static constexpr auto rule(content_or_empty, ctll::term<'\x29'>) -> ctll::push; + static constexpr auto rule(content_or_empty, ctll::set<'*','+','?','\x7B','|','\x7D'>) -> ctll::reject; + + static constexpr auto rule(d, ctll::term<'i'>) -> ctll::push; + static constexpr auto rule(d, ctll::term<'c'>) -> ctll::push; + static constexpr auto rule(d, ctll::term<'m'>) -> ctll::push; + static constexpr auto rule(d, ctll::term<'s'>) -> ctll::push; + static constexpr auto rule(d, ctll::term<'<'>) -> ctll::push; + static constexpr auto rule(d, ctll::term<':'>) -> ctll::push>; + static constexpr auto rule(d, ctll::term<'>'>) -> ctll::push>; + static constexpr auto rule(d, ctll::term<'!'>) -> ctll::push>; + static constexpr auto rule(d, ctll::term<'='>) -> ctll::push>; + + static constexpr auto rule(e, ctll::term<'d'>) -> ctll::push; + static constexpr auto rule(e, ctll::term<'h'>) -> ctll::push; + static constexpr auto rule(e, ctll::term<'H'>) -> ctll::push; + static constexpr auto rule(e, ctll::term<'V'>) -> ctll::push; + static constexpr auto rule(e, ctll::term<'D'>) -> ctll::push; + static constexpr auto rule(e, ctll::term<'N'>) -> ctll::push; + static constexpr auto rule(e, ctll::term<'S'>) -> ctll::push; + static constexpr auto rule(e, ctll::term<'W'>) -> ctll::push; + static constexpr auto rule(e, ctll::term<'s'>) -> ctll::push; + static constexpr auto rule(e, ctll::term<'v'>) -> ctll::push; + static constexpr auto rule(e, ctll::term<'w'>) -> ctll::push; + static constexpr auto rule(e, ctll::term<'p'>) -> ctll::push, property_name, ctll::term<'\x7D'>, make_property>; + static constexpr auto rule(e, ctll::term<'P'>) -> ctll::push, property_name, ctll::term<'\x7D'>, make_property_negative>; + static constexpr auto rule(e, ctll::term<'u'>) -> ctll::push; + static constexpr auto rule(e, ctll::term<'x'>) -> ctll::push; + static constexpr auto rule(e, ctll::set<'$','\x28','\x29','*','+','-','.','/','<','>','?','[','\\','\"',']','^','\x7B','|','\x7D'>) -> ctll::push; + static constexpr auto rule(e, ctll::term<'a'>) -> ctll::push; + static constexpr auto rule(e, ctll::term<'e'>) -> ctll::push; + static constexpr auto rule(e, ctll::term<'f'>) -> ctll::push; + static constexpr auto rule(e, ctll::term<'n'>) -> ctll::push; + static constexpr auto rule(e, ctll::term<'0'>) -> ctll::push; + static constexpr auto rule(e, ctll::term<'r'>) -> ctll::push; + static constexpr auto rule(e, ctll::term<'t'>) -> ctll::push; + + static constexpr auto rule(f, ctll::term<'d'>) -> ctll::push; + static constexpr auto rule(f, ctll::term<'h'>) -> ctll::push; + static constexpr auto rule(f, ctll::term<'H'>) -> ctll::push; + static constexpr auto rule(f, ctll::term<'V'>) -> ctll::push; + static constexpr auto rule(f, ctll::term<'D'>) -> ctll::push; + static constexpr auto rule(f, ctll::term<'N'>) -> ctll::push; + static constexpr auto rule(f, ctll::term<'S'>) -> ctll::push; + static constexpr auto rule(f, ctll::term<'W'>) -> ctll::push; + static constexpr auto rule(f, ctll::term<'s'>) -> ctll::push; + static constexpr auto rule(f, ctll::term<'v'>) -> ctll::push; + static constexpr auto rule(f, ctll::term<'w'>) -> ctll::push; + static constexpr auto rule(f, ctll::term<'p'>) -> ctll::push, property_name, ctll::term<'\x7D'>, make_property>; + static constexpr auto rule(f, ctll::term<'P'>) -> ctll::push, property_name, ctll::term<'\x7D'>, make_property_negative>; + static constexpr auto rule(f, ctll::term<'u'>) -> ctll::push; + static constexpr auto rule(f, ctll::term<'x'>) -> ctll::push; + static constexpr auto rule(f, ctll::set<'$','\x28','\x29','*','+','-','.','/','<','>','?','[','\\','\"',']','^','\x7B','|','\x7D'>) -> ctll::push; + static constexpr auto rule(f, ctll::term<'a'>) -> ctll::push; + static constexpr auto rule(f, ctll::term<'e'>) -> ctll::push; + static constexpr auto rule(f, ctll::term<'f'>) -> ctll::push; + static constexpr auto rule(f, ctll::term<'n'>) -> ctll::push; + static constexpr auto rule(f, ctll::term<'0'>) -> ctll::push; + static constexpr auto rule(f, ctll::term<'r'>) -> ctll::push; + static constexpr auto rule(f, ctll::term<'t'>) -> ctll::push; + + static constexpr auto rule(g, ctll::term<'s'>) -> ctll::push, ctll::term<'i'>, ctll::term<'i'>, class_named_ascii>; + static constexpr auto rule(g, ctll::term<'l'>) -> ctll::push; + + static constexpr auto rule(h, ctll::term<'r'>) -> ctll::push, ctll::term<'n'>, ctll::term<'t'>, class_named_print>; + static constexpr auto rule(h, ctll::term<'u'>) -> ctll::push, ctll::term<'c'>, ctll::term<'t'>, class_named_punct>; + + static constexpr auto rule(hexdec_repeat, ctll::term<'\x7D'>) -> ctll::epsilon; + static constexpr auto rule(hexdec_repeat, ctll::set<'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','a','b','c','d','e','f'>) -> ctll::push; + + static constexpr auto rule(i, ctll::term<'^'>) -> ctll::push, ctll::term<']'>>; + static constexpr auto rule(i, ctll::term<'x'>) -> ctll::push, ctll::term<'i'>, ctll::term<'g'>, ctll::term<'i'>, ctll::term<'t'>, class_named_xdigit, ctll::term<':'>, ctll::term<']'>>; + static constexpr auto rule(i, ctll::term<'d'>) -> ctll::push, ctll::term<'g'>, ctll::term<'i'>, ctll::term<'t'>, class_named_digit, ctll::term<':'>, ctll::term<']'>>; + static constexpr auto rule(i, ctll::term<'b'>) -> ctll::push, ctll::term<'a'>, ctll::term<'n'>, ctll::term<'k'>, class_named_blank, ctll::term<':'>, ctll::term<']'>>; + static constexpr auto rule(i, ctll::term<'c'>) -> ctll::push, ctll::term<'t'>, ctll::term<'r'>, ctll::term<'l'>, class_named_cntrl, ctll::term<':'>, ctll::term<']'>>; + static constexpr auto rule(i, ctll::term<'w'>) -> ctll::push, ctll::term<'r'>, ctll::term<'d'>, class_named_word, ctll::term<':'>, ctll::term<']'>>; + static constexpr auto rule(i, ctll::term<'l'>) -> ctll::push, ctll::term<'w'>, ctll::term<'e'>, ctll::term<'r'>, class_named_lower, ctll::term<':'>, ctll::term<']'>>; + static constexpr auto rule(i, ctll::term<'s'>) -> ctll::push, ctll::term<'a'>, ctll::term<'c'>, ctll::term<'e'>, class_named_space, ctll::term<':'>, ctll::term<']'>>; + static constexpr auto rule(i, ctll::term<'u'>) -> ctll::push, ctll::term<'p'>, ctll::term<'e'>, ctll::term<'r'>, class_named_upper, ctll::term<':'>, ctll::term<']'>>; + static constexpr auto rule(i, ctll::term<'g'>) -> ctll::push, ctll::term<'a'>, ctll::term<'p'>, ctll::term<'h'>, class_named_graph, ctll::term<':'>, ctll::term<']'>>; + static constexpr auto rule(i, ctll::term<'a'>) -> ctll::push, ctll::term<']'>>; + static constexpr auto rule(i, ctll::term<'p'>) -> ctll::push, ctll::term<']'>>; + + static constexpr auto rule(j, ctll::term<'\\'>) -> ctll::push; + static constexpr auto rule(j, ctll::set<'!','$','\x28','\x29','*','+',',','.','/','0','1','2','3','4','5','6','7','8','9',':','<','=','>','?','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','\"','^','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','\x7B','|','\x7D'>) -> ctll::push; + static constexpr auto rule(j, _others) -> ctll::push; + static constexpr auto rule(j, ctll::set<'-','[',']'>) -> ctll::reject; + + static constexpr auto rule(k, ctll::term<'\x7B'>) -> ctll::push, push_hexdec, hexdec_repeat, ctll::term<'\x7D'>, finish_hexdec>; + static constexpr auto rule(k, ctll::set<'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','a','b','c','d','e','f'>) -> ctll::push, push_hexdec, ctll::set<'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','a','b','c','d','e','f'>, push_hexdec, ctll::set<'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','a','b','c','d','e','f'>, push_hexdec, finish_hexdec>; + + static constexpr auto rule(l, ctll::term<'\x7B'>) -> ctll::push, push_hexdec, hexdec_repeat, ctll::term<'\x7D'>, finish_hexdec>; + static constexpr auto rule(l, ctll::set<'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','a','b','c','d','e','f'>) -> ctll::push, push_hexdec, finish_hexdec>; + + static constexpr auto rule(m, ctll::set<'0','1','2','3','4','5','6','7','8','9'>) -> ctll::push, make_back_reference>; + static constexpr auto rule(m, ctll::term<'-'>) -> ctll::push, make_relative_back_reference>; + static constexpr auto rule(m, ctll::set<'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'>) -> ctll::push, make_back_reference>; + + static constexpr auto rule(mod, ctll::set<'!','$','\x28','\x29',',','-','.','/','0','1','2','3','4','5','6','7','8','9',':','<','=','>','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','[','\\','\"',']','^','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','|'>) -> ctll::epsilon; + static constexpr auto rule(mod, ctll::epsilon) -> ctll::epsilon; + static constexpr auto rule(mod, _others) -> ctll::epsilon; + static constexpr auto rule(mod, ctll::term<'?'>) -> ctll::push; + static constexpr auto rule(mod, ctll::term<'+'>) -> ctll::push; + static constexpr auto rule(mod, ctll::set<'*','\x7B','\x7D'>) -> ctll::reject; + + static constexpr auto rule(mode_switch2, ctll::term<'i'>) -> ctll::push; + static constexpr auto rule(mode_switch2, ctll::term<'c'>) -> ctll::push; + static constexpr auto rule(mode_switch2, ctll::term<'m'>) -> ctll::push; + static constexpr auto rule(mode_switch2, ctll::term<'s'>) -> ctll::push; + static constexpr auto rule(mode_switch2, ctll::term<'\x29'>) -> ctll::push; + + static constexpr auto rule(n, ctll::set<'0','1','2','3','4','5','6','7','8','9'>) -> ctll::push, mod>; + static constexpr auto rule(n, ctll::term<'\x7D'>) -> ctll::push; + + static constexpr auto rule(number2, ctll::set<',','\x7D'>) -> ctll::epsilon; + static constexpr auto rule(number2, ctll::set<'0','1','2','3','4','5','6','7','8','9'>) -> ctll::push; + + static constexpr auto rule(number, ctll::set<'0','1','2','3','4','5','6','7','8','9'>) -> ctll::push; + + static constexpr auto rule(o, ctll::set<'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'>) -> ctll::push'>, content_in_capture, make_capture_with_name, ctll::term<'\x29'>>; + static constexpr auto rule(o, ctll::term<'!'>) -> ctll::push>; + static constexpr auto rule(o, ctll::term<'='>) -> ctll::push>; + + static constexpr auto rule(opt_content, ctll::term<'\\'>) -> ctll::push; + static constexpr auto rule(opt_content, ctll::term<'['>) -> ctll::push; + static constexpr auto rule(opt_content, ctll::term<'\x28'>) -> ctll::push; + static constexpr auto rule(opt_content, ctll::term<'^'>) -> ctll::push; + static constexpr auto rule(opt_content, ctll::term<'$'>) -> ctll::push; + static constexpr auto rule(opt_content, ctll::set<'!',',','-','/','0','1','2','3','4','5','6','7','8','9',':','<','=','>','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','\"',']','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'>) -> ctll::push; + static constexpr auto rule(opt_content, _others) -> ctll::push; + static constexpr auto rule(opt_content, ctll::term<'.'>) -> ctll::push; + static constexpr auto rule(opt_content, ctll::epsilon) -> ctll::push; + static constexpr auto rule(opt_content, ctll::set<'\x29','*','+','?','\x7B','|','\x7D'>) -> ctll::reject; + + static constexpr auto rule(p, ctll::term<'p'>) -> ctll::push, ctll::term<'a'>, class_named_alpha>; + static constexpr auto rule(p, ctll::term<'n'>) -> ctll::push, ctll::term<'m'>, class_named_alnum>; + + static constexpr auto rule(property_name2, ctll::term<'\x7D'>) -> ctll::epsilon; + static constexpr auto rule(property_name2, ctll::term<'='>) -> ctll::push; + static constexpr auto rule(property_name2, ctll::set<'.','0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'>) -> ctll::push; + + static constexpr auto rule(property_name, ctll::set<'.','0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'>) -> ctll::push; + + static constexpr auto rule(property_value2, ctll::term<'\x7D'>) -> ctll::epsilon; + static constexpr auto rule(property_value2, ctll::set<'.','0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'>) -> ctll::push; + + static constexpr auto rule(property_value, ctll::set<'.','0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'>) -> ctll::push; + + static constexpr auto rule(range, ctll::set<'!','$','\x28','\x29','*','+',',','.','/','0','1','2','3','4','5','6','7','8','9',':','<','=','>','?','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','[','\\','\"',']','^','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','\x7B','|','\x7D'>) -> ctll::epsilon; + static constexpr auto rule(range, ctll::epsilon) -> ctll::epsilon; + static constexpr auto rule(range, _others) -> ctll::epsilon; + static constexpr auto rule(range, ctll::term<'-'>) -> ctll::push; + + static constexpr auto rule(repeat, ctll::set<'!','$','\x28','\x29',',','-','.','/','0','1','2','3','4','5','6','7','8','9',':','<','=','>','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','[','\\','\"',']','^','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','|'>) -> ctll::epsilon; + static constexpr auto rule(repeat, ctll::epsilon) -> ctll::epsilon; + static constexpr auto rule(repeat, _others) -> ctll::epsilon; + static constexpr auto rule(repeat, ctll::term<'?'>) -> ctll::push; + static constexpr auto rule(repeat, ctll::term<'\x7B'>) -> ctll::push; + static constexpr auto rule(repeat, ctll::term<'+'>) -> ctll::push; + static constexpr auto rule(repeat, ctll::term<'*'>) -> ctll::push; + static constexpr auto rule(repeat, ctll::term<'\x7D'>) -> ctll::reject; + + static constexpr auto rule(set2a, ctll::term<'['>) -> ctll::push, i, range, set_start, set2b>; + static constexpr auto rule(set2a, ctll::term<'\\'>) -> ctll::push; + static constexpr auto rule(set2a, ctll::set<'!','$','\x28','\x29','*','+',',','.','/','0','1','2','3','4','5','6','7','8','9',':','<','=','>','?','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','\"','^','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','\x7B','|','\x7D'>) -> ctll::push; + static constexpr auto rule(set2a, _others) -> ctll::push; + static constexpr auto rule(set2a, ctll::term<']'>) -> ctll::push; + static constexpr auto rule(set2a, ctll::term<'-'>) -> ctll::reject; + + static constexpr auto rule(set2b, ctll::term<']'>) -> ctll::epsilon; + static constexpr auto rule(set2b, ctll::term<'['>) -> ctll::push, i, range, set_combine, set2b>; + static constexpr auto rule(set2b, ctll::term<'\\'>) -> ctll::push; + static constexpr auto rule(set2b, ctll::set<'!','$','\x28','\x29','*','+',',','.','/','0','1','2','3','4','5','6','7','8','9',':','<','=','>','?','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','\"','^','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','\x7B','|','\x7D'>) -> ctll::push; + static constexpr auto rule(set2b, _others) -> ctll::push; + static constexpr auto rule(set2b, ctll::term<'-'>) -> ctll::reject; + + static constexpr auto rule(string2, ctll::set<'\x29','|'>) -> ctll::epsilon; + static constexpr auto rule(string2, ctll::epsilon) -> ctll::epsilon; + static constexpr auto rule(string2, ctll::term<'\\'>) -> ctll::push; + static constexpr auto rule(string2, ctll::term<'['>) -> ctll::push; + static constexpr auto rule(string2, ctll::term<'\x28'>) -> ctll::push; + static constexpr auto rule(string2, ctll::term<'^'>) -> ctll::push; + static constexpr auto rule(string2, ctll::term<'$'>) -> ctll::push; + static constexpr auto rule(string2, ctll::set<'!',',','-','/','0','1','2','3','4','5','6','7','8','9',':','<','=','>','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','\"',']','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'>) -> ctll::push; + static constexpr auto rule(string2, _others) -> ctll::push; + static constexpr auto rule(string2, ctll::term<'.'>) -> ctll::push; + static constexpr auto rule(string2, ctll::set<'*','+','?','\x7B','\x7D'>) -> ctll::reject; + +}; + +} + +#endif //CTRE__PCRE__HPP + +#ifndef CTRE__ROTATE__HPP +#define CTRE__ROTATE__HPP + +#ifndef CTRE__ATOMS__HPP +#define CTRE__ATOMS__HPP + +#ifndef CTRE__ATOMS_CHARACTERS__HPP +#define CTRE__ATOMS_CHARACTERS__HPP + +#ifndef CTRE__UTILITY__HPP +#define CTRE__UTILITY__HPP + +#define CTRE_CNTTP_COMPILER_CHECK CTLL_CNTTP_COMPILER_CHECK + +#ifdef CTRE_IN_A_MODULE +#define CTRE_EXPORT export +#else +#define CTRE_EXPORT +#endif + +#if __GNUC__ > 9 +#if __has_cpp_attribute(likely) +#define CTRE_LIKELY [[likely]] +#else +#define CTRE_LIKELY +#endif + +#if __has_cpp_attribute(unlikely) +#define CTRE_UNLIKELY [[unlikely]] +#else +#define CTRE_UNLIKELY +#endif +#else +#define CTRE_LIKELY +#define CTRE_UNLIKELY +#endif + +#ifdef _MSC_VER +#define CTRE_FORCE_INLINE __forceinline +#if __has_cpp_attribute(msvc::flatten) +#define CTRE_FLATTEN [[msvc::flatten]] +#elif _MSC_VER >= 1930 && !defined(__clang__) +#define CTRE_FLATTEN [[msvc::flatten]] +#else +#define CTRE_FLATTEN +#endif +#else +#define CTRE_FORCE_INLINE inline __attribute__((always_inline)) +#define CTRE_FLATTEN __attribute__((flatten)) +#endif + +#endif + +#ifndef CTRE_V2__CTRE__FLAGS_AND_MODES__HPP +#define CTRE_V2__CTRE__FLAGS_AND_MODES__HPP + +namespace ctre { + +struct singleline { }; +struct multiline { }; + +struct case_sensitive { }; +struct case_insensitive { }; + +using ci = case_insensitive; +using cs = case_sensitive; + +template struct flag_list { }; + +struct flags { + bool block_empty_match = false; + bool multiline = false; + bool case_insensitive = false; + + constexpr flags() = default; + constexpr flags(const flags &) = default; + constexpr flags(flags &&) = default; + + constexpr CTRE_FORCE_INLINE flags(ctre::singleline v) noexcept { set_flag(v); } + constexpr CTRE_FORCE_INLINE flags(ctre::multiline v) noexcept { set_flag(v); } + constexpr CTRE_FORCE_INLINE flags(ctre::case_sensitive v) noexcept { set_flag(v); } + constexpr CTRE_FORCE_INLINE flags(ctre::case_insensitive v) noexcept { set_flag(v); } + + + template constexpr CTRE_FORCE_INLINE flags(ctll::list) noexcept { + (this->set_flag(Args{}), ...); + } + + constexpr friend CTRE_FORCE_INLINE auto operator+(flags f, pcre::mode_case_insensitive) noexcept { + f.case_insensitive = true; + return f; + } + + constexpr friend CTRE_FORCE_INLINE auto operator+(flags f, pcre::mode_case_sensitive) noexcept { + f.case_insensitive = false; + return f; + } + + constexpr friend CTRE_FORCE_INLINE auto operator+(flags f, pcre::mode_singleline) noexcept { + f.multiline = false; + return f; + } + + constexpr friend CTRE_FORCE_INLINE auto operator+(flags f, pcre::mode_multiline) noexcept { + f.multiline = true; + return f; + } + + constexpr CTRE_FORCE_INLINE void set_flag(ctre::singleline) noexcept { + multiline = false; + } + + constexpr CTRE_FORCE_INLINE void set_flag(ctre::multiline) noexcept { + multiline = true; + } + + constexpr CTRE_FORCE_INLINE void set_flag(ctre::case_insensitive) noexcept { + case_insensitive = true; + } + + constexpr CTRE_FORCE_INLINE void set_flag(ctre::case_sensitive) noexcept { + case_insensitive = false; + } +}; + +constexpr CTRE_FORCE_INLINE auto not_empty_match(flags f) { + f.block_empty_match = true; + return f; +} + +constexpr CTRE_FORCE_INLINE auto consumed_something(flags f, bool condition = true) { + if (condition) f.block_empty_match = false; + return f; +} + +constexpr CTRE_FORCE_INLINE bool cannot_be_empty_match(flags f) { + return f.block_empty_match; +} + +constexpr CTRE_FORCE_INLINE bool multiline_mode(flags f) { + return f.multiline; +} + +constexpr CTRE_FORCE_INLINE bool is_case_insensitive(flags f) { + return f.case_insensitive; +} + +} // namespace ctre + +#endif + +#ifndef CTRE_IN_A_MODULE +#include +#endif + +namespace ctre { + +// sfinae check for types here + +template class MatchesCharacter { + template static auto test(CharT c) -> decltype(Y::match_char(c, std::declval()), std::true_type()); + template static auto test(...) -> std::false_type; +public: + template static inline constexpr bool value = decltype(test(std::declval()))(); +}; + +template constexpr CTRE_FORCE_INLINE bool is_ascii_alpha(T v) { + return ((v >= static_cast('a') && v <= static_cast('z')) || (v >= static_cast('A') && v <= static_cast('Z'))); +} + +template constexpr CTRE_FORCE_INLINE bool is_ascii_alpha_lowercase(T v) { + return (v >= static_cast('a')) && (v <= static_cast('z')); +} + +template constexpr CTRE_FORCE_INLINE bool is_ascii_alpha_uppercase(T v) { + return (v >= static_cast('A')) && v <= (static_cast('Z')); +} + +template struct character { + template CTRE_FORCE_INLINE static constexpr bool match_char(CharT value, const flags & f) noexcept { + if constexpr (is_ascii_alpha(V)) { + if (is_case_insensitive(f)) { + if (value == (V ^ static_cast(0x20))) { + return true;// + } + } + } + return value == V; + } +}; + +template struct negative_set { + template CTRE_FORCE_INLINE static constexpr bool match_char([[maybe_unused]] CharT value, const flags & f) noexcept { + return !(Content::match_char(value, f) || ... || false); + } +}; + +template struct set { + template CTRE_FORCE_INLINE static constexpr bool match_char([[maybe_unused]] CharT value, const flags & f) noexcept { + return (Content::match_char(value, f) || ... || false); + } +}; + +template struct enumeration : set...> { }; + +template struct negate { + template CTRE_FORCE_INLINE static constexpr bool match_char([[maybe_unused]] CharT value, const flags & f) noexcept { + return !(Content::match_char(value, f) || ... || false); + } +}; + +template struct char_range { + template CTRE_FORCE_INLINE static constexpr bool match_char(CharT value, const flags & f) noexcept { + if constexpr (is_ascii_alpha_lowercase(A) && is_ascii_alpha_lowercase(B)) { + if (is_case_insensitive(f)) { + if (value >= (A ^ static_cast(0x20)) && value <= (B ^ static_cast(0x20))) { + return true;// + } + } + } else if constexpr (is_ascii_alpha_uppercase(A) && is_ascii_alpha_uppercase(B)) { + if (is_case_insensitive(f)) { + if (value >= (A ^ static_cast(0x20)) && value <= (B ^ static_cast(0x20))) { + return true;// + } + } + } + return (value >= A) && (value <= B); + } +}; +using word_chars = set, char_range<'a','z'>, char_range<'0','9'>, character<'_'> >; + +using space_chars = enumeration<' ', '\t', '\n', '\v', '\f', '\r'>; + +using vertical_space_chars = enumeration< + char{0x000A}, // Linefeed (LF) + char{0x000B}, // Vertical tab (VT) + char{0x000C}, // Form feed (FF) + char{0x000D}, // Carriage return (CR) + char32_t{0x0085}, // Next line (NEL) + char32_t{0x2028}, // Line separator + char32_t{0x2029} // Paragraph separator +>; + +using horizontal_space_chars = enumeration< + char{0x0009}, // Horizontal tab (HT) + char{0x0020}, // Space + char32_t{0x00A0}, // Non-break space + char32_t{0x1680}, // Ogham space mark + char32_t{0x180E}, // Mongolian vowel separator + char32_t{0x2000}, // En quad + char32_t{0x2001}, // Em quad + char32_t{0x2002}, // En space + char32_t{0x2003}, // Em space + char32_t{0x2004}, // Three-per-em space + char32_t{0x2005}, // Four-per-em space + char32_t{0x2006}, // Six-per-em space + char32_t{0x2007}, // Figure space + char32_t{0x2008}, // Punctuation space + char32_t{0x2009}, // Thin space + char32_t{0x200A}, // Hair space + char32_t{0x202F}, // Narrow no-break space + char32_t{0x205F}, // Medium mathematical space + char32_t{0x3000} // Ideographic space +>; + +using alphanum_chars = set, char_range<'a','z'>, char_range<'0','9'> >; + +using alpha_chars = set, char_range<'a','z'> >; + +using xdigit_chars = set, char_range<'a','f'>, char_range<'0','9'> >; + +using punct_chars + = enumeration<'!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', + '.', '/', ':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', + '^', '_', '`', '{', '|', '}', '~'>; + +using digit_chars = char_range<'0','9'>; + +using ascii_chars = char_range<'\x00','\x7F'>; + +} + +#endif + +#ifndef CTRE_IN_A_MODULE +#include +#endif + +namespace ctre { + +// special helpers for matching +struct accept { }; +struct reject { }; +struct start_mark { }; +struct end_mark { }; +struct end_cycle_mark { }; +struct end_lookahead_mark { }; +struct end_lookbehind_mark { }; +template struct numeric_mark { }; + +struct any { }; + +// actual AST of regexp +template struct string { }; +template struct select { }; +template struct sequence { }; +struct empty { }; + +template struct repeat { }; +template using plus = repeat<1,0,Content...>; +template using star = repeat<0,0,Content...>; + +template struct lazy_repeat { }; +template using lazy_plus = lazy_repeat<1,0,Content...>; +template using lazy_star = lazy_repeat<0,0,Content...>; + +template struct possessive_repeat { }; +template using possessive_plus = possessive_repeat<1,0,Content...>; +template using possessive_star = possessive_repeat<0,0,Content...>; + +template using optional = repeat<0,1,Content...>; +template using lazy_optional = lazy_repeat<0,1,Content...>; +template using possessive_optional = possessive_repeat<0,1,Content...>; + +template struct capture { }; + +template struct capture_with_name { }; + +template struct back_reference { }; +template struct back_reference_with_name { }; + +template struct look_start { }; + +template struct lookahead_positive { }; +template struct lookahead_negative { }; + +template struct lookbehind_positive { }; +template struct lookbehind_negative { }; + +struct atomic_start { }; + +template struct atomic_group { }; + +template struct boundary { }; +template struct not_boundary { }; + +using word_boundary = boundary; +using not_word_boundary = not_boundary; + +struct assert_subject_begin { }; +struct assert_subject_end { }; +struct assert_subject_end_line{ }; +struct assert_line_begin { }; +struct assert_line_end { }; + +template struct mode_switch { }; + +} + +#endif + +#ifndef CTRE__ATOMS_UNICODE__HPP +#define CTRE__ATOMS_UNICODE__HPP + +// master branch is not including unicode db (for now) +#ifndef H_COR3NTIN_UNICODE_SYNOPSYS +#define H_COR3NTIN_UNICODE_SYNOPSYS + +#ifndef UNICODE_DB_IN_A_MODULE +#include +#endif + +namespace uni +{ + enum class category; + enum class property; + enum class version : unsigned char; + enum class script ; + enum class block; + + struct script_extensions_view { + constexpr script_extensions_view(char32_t); + + struct sentinel {}; + struct iterator { + + constexpr iterator(char32_t c); + constexpr script operator*() const; + + constexpr iterator& operator++(int); + + constexpr iterator operator++(); + + constexpr bool operator==(sentinel) const; + constexpr bool operator!=(sentinel) const; + + private: + char32_t m_c; + script m_script; + int idx = 1; + }; + + constexpr iterator begin() const; + constexpr sentinel end() const; + + private: + char32_t c; + }; + + struct numeric_value { + + constexpr double value() const; + constexpr long long numerator() const; + constexpr int denominator() const; + constexpr bool is_valid() const; + + protected: + constexpr numeric_value() = default; + constexpr numeric_value(long long n, int16_t d); + + long long _n = 0; + int16_t _d = 0; + friend constexpr numeric_value cp_numeric_value(char32_t cp); + }; + + constexpr category cp_category(char32_t cp); + constexpr script cp_script(char32_t cp); + constexpr script_extensions_view cp_script_extensions(char32_t cp); + constexpr version cp_age(char32_t cp); + constexpr block cp_block(char32_t cp); + constexpr bool cp_is_valid(char32_t cp); + constexpr bool cp_is_assigned(char32_t cp); + constexpr bool cp_is_ascii(char32_t cp); + constexpr numeric_value cp_numeric_value(char32_t cp); + + template