Cleanup includes (#519)

This commit is contained in:
KostinPavel
2025-10-13 18:16:14 +02:00
committed by GitHub
parent afc0255579
commit 732e9fe85f
812 changed files with 604 additions and 1897 deletions
+8
View File
@@ -0,0 +1,8 @@
Checks: |
-misc-unused-using-decls
-misc-include-cleaner
-modernize-use-using
-readability-duplicate-include
-readability-redundant-preprocessor
HeaderFilterRegex: \./.+\\.(h|hpp)$
WarningsAsErrors: false
+22 -2
View File
@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.23) cmake_minimum_required(VERSION 3.23)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
option(REFLECTCPP_BUILD_SHARED "Build shared library" ${BUILD_SHARED_LIBS}) option(REFLECTCPP_BUILD_SHARED "Build shared library" ${BUILD_SHARED_LIBS})
option(REFLECTCPP_INSTALL "Install reflect cpp" OFF) option(REFLECTCPP_INSTALL "Install reflect cpp" OFF)
@@ -154,9 +156,27 @@ endif()
add_library(reflectcpp::reflectcpp ALIAS reflectcpp) add_library(reflectcpp::reflectcpp ALIAS reflectcpp)
if (MSVC) if (MSVC)
target_compile_options(reflectcpp PRIVATE $<$<CONFIG:Debug>:-Wall>) target_compile_options(reflectcpp PRIVATE
$<$<CONFIG:Debug>:
-Wall
>
$<$<CONFIG:Release>:
-DNDEBUG
>
)
else() else()
target_compile_options(reflectcpp PRIVATE $<$<CONFIG:Debug>:-Wall -Wextra>) target_compile_options(reflectcpp PRIVATE
$<$<CONFIG:Debug>:
-Wall -Wextra -Wpedantic -Wshadow -Wconversion
#-Wnull-dereference -Wold-style-cast
#-g3 -fno-omit-frame-pointer
#-fsanitize=address,undefined
#-fno-sanitize-recover=undefined
>
$<$<CONFIG:Release>:
-DNDEBUG
>
)
endif() endif()
if(REFLECTCPP_USE_STD_EXPECTED) if(REFLECTCPP_USE_STD_EXPECTED)
-4
View File
@@ -1,8 +1,5 @@
#include <benchmark/benchmark.h> #include <benchmark/benchmark.h>
#include <array>
#include <iostream>
#include <optional>
#include <rfl/avro.hpp> #include <rfl/avro.hpp>
#include <rfl/bson.hpp> #include <rfl/bson.hpp>
#include <rfl/capnproto.hpp> #include <rfl/capnproto.hpp>
@@ -13,7 +10,6 @@
#include <rfl/toml.hpp> #include <rfl/toml.hpp>
#include <rfl/ubjson.hpp> #include <rfl/ubjson.hpp>
#include <rfl/yaml.hpp> #include <rfl/yaml.hpp>
#include <type_traits>
#include <vector> #include <vector>
namespace canada_read { namespace canada_read {
-4
View File
@@ -1,8 +1,5 @@
#include <benchmark/benchmark.h> #include <benchmark/benchmark.h>
#include <array>
#include <iostream>
#include <optional>
#include <rfl/avro.hpp> #include <rfl/avro.hpp>
#include <rfl/bson.hpp> #include <rfl/bson.hpp>
#include <rfl/capnproto.hpp> #include <rfl/capnproto.hpp>
@@ -13,7 +10,6 @@
#include <rfl/toml.hpp> #include <rfl/toml.hpp>
#include <rfl/ubjson.hpp> #include <rfl/ubjson.hpp>
#include <rfl/yaml.hpp> #include <rfl/yaml.hpp>
#include <type_traits>
#include <vector> #include <vector>
namespace canada_write { namespace canada_write {
-3
View File
@@ -1,7 +1,5 @@
#include <benchmark/benchmark.h> #include <benchmark/benchmark.h>
#include <array>
#include <iostream>
#include <optional> #include <optional>
#include <rfl/avro.hpp> #include <rfl/avro.hpp>
#include <rfl/bson.hpp> #include <rfl/bson.hpp>
@@ -14,7 +12,6 @@
#include <rfl/ubjson.hpp> #include <rfl/ubjson.hpp>
#include <rfl/xml.hpp> #include <rfl/xml.hpp>
#include <rfl/yaml.hpp> #include <rfl/yaml.hpp>
#include <type_traits>
#include <vector> #include <vector>
namespace licenses_read { namespace licenses_read {
-3
View File
@@ -1,7 +1,5 @@
#include <benchmark/benchmark.h> #include <benchmark/benchmark.h>
#include <array>
#include <iostream>
#include <optional> #include <optional>
#include <rfl/avro.hpp> #include <rfl/avro.hpp>
#include <rfl/bson.hpp> #include <rfl/bson.hpp>
@@ -14,7 +12,6 @@
#include <rfl/ubjson.hpp> #include <rfl/ubjson.hpp>
#include <rfl/xml.hpp> #include <rfl/xml.hpp>
#include <rfl/yaml.hpp> #include <rfl/yaml.hpp>
#include <type_traits>
#include <vector> #include <vector>
namespace licenses_write { namespace licenses_write {
-4
View File
@@ -1,8 +1,5 @@
#include <benchmark/benchmark.h> #include <benchmark/benchmark.h>
#include <array>
#include <iostream>
#include <optional>
#include <rfl/avro.hpp> #include <rfl/avro.hpp>
#include <rfl/bson.hpp> #include <rfl/bson.hpp>
#include <rfl/capnproto.hpp> #include <rfl/capnproto.hpp>
@@ -14,7 +11,6 @@
#include <rfl/ubjson.hpp> #include <rfl/ubjson.hpp>
#include <rfl/xml.hpp> #include <rfl/xml.hpp>
#include <rfl/yaml.hpp> #include <rfl/yaml.hpp>
#include <type_traits>
#include <vector> #include <vector>
namespace person_read { namespace person_read {
-4
View File
@@ -1,8 +1,5 @@
#include <benchmark/benchmark.h> #include <benchmark/benchmark.h>
#include <array>
#include <iostream>
#include <optional>
#include <rfl/avro.hpp> #include <rfl/avro.hpp>
#include <rfl/bson.hpp> #include <rfl/bson.hpp>
#include <rfl/capnproto.hpp> #include <rfl/capnproto.hpp>
@@ -14,7 +11,6 @@
#include <rfl/ubjson.hpp> #include <rfl/ubjson.hpp>
#include <rfl/xml.hpp> #include <rfl/xml.hpp>
#include <rfl/yaml.hpp> #include <rfl/yaml.hpp>
#include <type_traits>
#include <vector> #include <vector>
namespace person_write { namespace person_write {
-3
View File
@@ -2,12 +2,9 @@
#include <rapidjson/document.h> #include <rapidjson/document.h>
#include <simdjson.h> #include <simdjson.h>
#include <array>
#include <iostream> #include <iostream>
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
#include <optional>
#include <rfl/json.hpp> #include <rfl/json.hpp>
#include <type_traits>
#include <vector> #include <vector>
namespace canada { namespace canada {
-2
View File
@@ -2,12 +2,10 @@
#include <rapidjson/document.h> #include <rapidjson/document.h>
#include <simdjson.h> #include <simdjson.h>
#include <array>
#include <iostream> #include <iostream>
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
#include <optional> #include <optional>
#include <rfl/json.hpp> #include <rfl/json.hpp>
#include <type_traits>
#include <vector> #include <vector>
namespace licenses { namespace licenses {
-1
View File
@@ -5,7 +5,6 @@
#include <array> #include <array>
#include <iostream> #include <iostream>
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
#include <optional>
#include <rfl/json.hpp> #include <rfl/json.hpp>
#include <type_traits> #include <type_traits>
#include <vector> #include <vector>
+1 -2
View File
@@ -2,7 +2,6 @@
#define RFL_BOX_HPP_ #define RFL_BOX_HPP_
#include <memory> #include <memory>
#include <stdexcept>
#include "Result.hpp" #include "Result.hpp"
@@ -146,7 +145,7 @@ namespace std {
template <class T> template <class T>
struct hash<rfl::Box<T>> { struct hash<rfl::Box<T>> {
size_t operator()(const rfl::Box<T>& _b) const { size_t operator()(const rfl::Box<T>& _b) const {
return hash<unique_ptr<T>>()(_b.ptr()); return std::hash<std::unique_ptr<T>>{}(_b.ptr());
} }
}; };
-3
View File
@@ -1,9 +1,7 @@
#ifndef RFL_FIELD_HPP_ #ifndef RFL_FIELD_HPP_
#define RFL_FIELD_HPP_ #define RFL_FIELD_HPP_
#include <algorithm>
#include <string_view> #include <string_view>
#include <tuple>
#include <type_traits> #include <type_traits>
#include <utility> #include <utility>
@@ -11,7 +9,6 @@
#include "default.hpp" #include "default.hpp"
#include "internal/Array.hpp" #include "internal/Array.hpp"
#include "internal/StringLiteral.hpp" #include "internal/StringLiteral.hpp"
#include "internal/to_std_array.hpp"
#include "internal/wrap_in_rfl_array_t.hpp" #include "internal/wrap_in_rfl_array_t.hpp"
namespace rfl { namespace rfl {
-1
View File
@@ -5,7 +5,6 @@
#include <cstdint> #include <cstdint>
#include <functional> #include <functional>
#include <string> #include <string>
#include <tuple>
#include <type_traits> #include <type_traits>
#include <utility> #include <utility>
#include <vector> #include <vector>
+1 -2
View File
@@ -129,11 +129,10 @@ inline std::basic_ostream<CharT, Traits>& operator<<(
} // namespace rfl } // namespace rfl
namespace std { namespace std {
template <class T> template <class T>
struct hash<rfl::Ref<T>> { struct hash<rfl::Ref<T>> {
size_t operator()(const rfl::Ref<T>& _r) const { size_t operator()(const rfl::Ref<T>& _r) const {
return hash<shared_ptr<T>>()(_r.ptr()); return std::hash<std::shared_ptr<T>>{}(_r.ptr());
} }
}; };
-3
View File
@@ -5,12 +5,9 @@
#include <expected> #include <expected>
#endif #endif
#include <algorithm>
#include <array> #include <array>
#include <functional> #include <functional>
#include <iostream>
#include <new> #include <new>
#include <optional>
#include <stdexcept> #include <stdexcept>
#include <string> #include <string>
#include <type_traits> #include <type_traits>
-7
View File
@@ -1,14 +1,7 @@
#ifndef RFL_TUPLE_HPP_ #ifndef RFL_TUPLE_HPP_
#define RFL_TUPLE_HPP_ #define RFL_TUPLE_HPP_
#include <algorithm>
#include <array> #include <array>
#include <bit>
#include <cstdint>
#include <limits>
#include <memory>
#include <optional>
#include <stdexcept>
#include <tuple> #include <tuple>
#include <type_traits> #include <type_traits>
#include <utility> #include <utility>
+2 -11
View File
@@ -1,8 +1,9 @@
#ifndef RFL_VALIDATOR_HPP_ #ifndef RFL_VALIDATOR_HPP_
#define RFL_VALIDATOR_HPP_ #define RFL_VALIDATOR_HPP_
#include <cstddef>
#include <exception>
#include <functional> #include <functional>
#include <string>
#include <type_traits> #include <type_traits>
#include <utility> #include <utility>
@@ -110,17 +111,7 @@ struct Validator {
template <class T, class V, class... Vs> template <class T, class V, class... Vs>
inline auto operator<=>(const Validator<T, V, Vs...>& _v1, inline auto operator<=>(const Validator<T, V, Vs...>& _v1,
const Validator<T, V, Vs...>& _v2) { const Validator<T, V, Vs...>& _v2) {
#if __cpp_lib_three_way_comparison >= 201907L
return _v1.value() <=> _v2.value(); return _v1.value() <=> _v2.value();
#else
if (_v1.value() < _v2.value()) {
return std::strong_ordering::less;
} else if (_v1.value() > _v2.value()) {
return std::strong_ordering::greater;
} else {
return std::strong_ordering::equal;
}
#endif
} }
template <class T, class V, class... Vs> template <class T, class V, class... Vs>
+5 -5
View File
@@ -4,7 +4,7 @@
#include "../Generic.hpp" #include "../Generic.hpp"
#include "../Tuple.hpp" #include "../Tuple.hpp"
#include "../always_false.hpp" #include "../always_false.hpp"
#include "../parsing/Parser.hpp" //#include "../parsing/Parser.hpp"
#include "Reader.hpp" #include "Reader.hpp"
#include "Writer.hpp" #include "Writer.hpp"
@@ -82,15 +82,15 @@ struct Parser<avro::Reader, avro::Writer,
} }
template <class P> template <class P>
static void write(const W& _w, static void write(const W& /*_w*/,
const internal::Skip<T, _skip_serialization, const internal::Skip<T, _skip_serialization,
_skip_deserialization>& _skip, _skip_deserialization>& /*_skip*/,
const P& _parent) noexcept { const P& /*_parent*/) noexcept {
static_assert(always_false_v<P>, "rfl::Skip is unsupported in Avro."); static_assert(always_false_v<P>, "rfl::Skip is unsupported in Avro.");
} }
template <class U> template <class U>
static schema::Type to_schema(U* _definitions) { static schema::Type to_schema(U* /*_definitions*/) {
static_assert(always_false_v<U>, "rfl::Skip is unsupported in Avro."); static_assert(always_false_v<U>, "rfl::Skip is unsupported in Avro.");
return schema::Type{}; return schema::Type{};
} }
+36 -10
View File
@@ -8,7 +8,6 @@
#include <string> #include <string>
#include <string_view> #include <string_view>
#include <type_traits> #include <type_traits>
#include <vector>
#include "../Bytestring.hpp" #include "../Bytestring.hpp"
#include "../Result.hpp" #include "../Result.hpp"
@@ -91,9 +90,12 @@ struct Reader {
if (type != AVRO_BOOLEAN) { if (type != AVRO_BOOLEAN) {
return rfl::error("Could not cast to boolean."); return rfl::error("Could not cast to boolean.");
} }
int result = 0; int result_value = 0;
avro_value_get_boolean(_var.val_, &result); int result = avro_value_get_boolean(_var.val_, &result_value);
return (result != 0); if (result != 0) {
return error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
}
return (result_value != 0);
} else if constexpr (std::is_floating_point<std::remove_cvref_t<T>>()) { } else if constexpr (std::is_floating_point<std::remove_cvref_t<T>>()) {
if (type == AVRO_DOUBLE) { if (type == AVRO_DOUBLE) {
@@ -188,10 +190,18 @@ struct Reader {
std::optional<Error> read_array(const ArrayReader& _array_reader, std::optional<Error> read_array(const ArrayReader& _array_reader,
const InputArrayType& _arr) const noexcept { const InputArrayType& _arr) const noexcept {
size_t size = 0; size_t size = 0;
avro_value_get_size(_arr.val_, &size); int res = avro_value_get_size(_arr.val_, &size);
if(res)
{
return Error(std::string(__FUNCTION__) + " error(" + std::to_string(res) + "): " + avro_strerror());
}
for (size_t ix = 0; ix < size; ++ix) { for (size_t ix = 0; ix < size; ++ix) {
avro_value_t element; avro_value_t element;
avro_value_get_by_index(_arr.val_, ix, &element, nullptr); res = avro_value_get_by_index(_arr.val_, ix, &element, nullptr);
if(res)
{
return Error(std::string(__FUNCTION__) + " error(" + std::to_string(res) + "): " + avro_strerror());
}
const auto err = _array_reader.read(InputVarType{&element}); const auto err = _array_reader.read(InputVarType{&element});
if (err) { if (err) {
return err; return err;
@@ -204,11 +214,19 @@ struct Reader {
std::optional<Error> read_map(const MapReader& _map_reader, std::optional<Error> read_map(const MapReader& _map_reader,
const InputMapType& _map) const noexcept { const InputMapType& _map) const noexcept {
size_t size = 0; size_t size = 0;
avro_value_get_size(_map.val_, &size); int res = avro_value_get_size(_map.val_, &size);
if(res!=0)
{
return Error(std::string(__FUNCTION__) + " error("+ std::to_string(res)+"): " + avro_strerror());
}
for (size_t ix = 0; ix < size; ++ix) { for (size_t ix = 0; ix < size; ++ix) {
avro_value_t element; avro_value_t element;
const char* key = nullptr; const char* key = nullptr;
avro_value_get_by_index(_map.val_, ix, &element, &key); res = avro_value_get_by_index(_map.val_, ix, &element, &key);
if(res!=0)
{
return Error(std::string(__FUNCTION__) + " error("+ std::to_string(res)+"): " + avro_strerror());
}
_map_reader.read(std::string_view(key), InputVarType{&element}); _map_reader.read(std::string_view(key), InputVarType{&element});
} }
return std::nullopt; return std::nullopt;
@@ -218,10 +236,18 @@ struct Reader {
std::optional<Error> read_object(const ObjectReader& _object_reader, std::optional<Error> read_object(const ObjectReader& _object_reader,
const InputObjectType& _obj) const noexcept { const InputObjectType& _obj) const noexcept {
size_t size = 0; size_t size = 0;
avro_value_get_size(_obj.val_, &size); int res = avro_value_get_size(_obj.val_, &size);
if(res!=0)
{
return Error(std::string(__FUNCTION__) + " error("+ std::to_string(res)+"): " + avro_strerror());
}
for (size_t ix = 0; ix < size; ++ix) { for (size_t ix = 0; ix < size; ++ix) {
avro_value_t element; avro_value_t element;
avro_value_get_by_index(_obj.val_, ix, &element, nullptr); res = avro_value_get_by_index(_obj.val_, ix, &element, nullptr);
if(res!=0)
{
return Error(std::string(__FUNCTION__) + " error("+ std::to_string(res)+"): " + avro_strerror());
}
_object_reader.read(static_cast<int>(ix), InputVarType{&element}); _object_reader.read(static_cast<int>(ix), InputVarType{&element});
} }
return std::nullopt; return std::nullopt;
+2 -2
View File
@@ -5,8 +5,8 @@
#include <string> #include <string>
#include "../Box.hpp" //#include "../Box.hpp"
#include "../Result.hpp" //#include "../Result.hpp"
namespace rfl::avro { namespace rfl::avro {
+91 -56
View File
@@ -1,24 +1,17 @@
#ifndef RFL_AVRO_WRITER_HPP_ #ifndef RFL_AVRO_WRITER_HPP_
#define RFL_AVRO_WRITER_HPP_ #define RFL_AVRO_WRITER_HPP_
#include <avro.h>
#include <bit>
#include <cstdint> #include <cstdint>
#include <exception>
#include <map>
#include <sstream>
#include <stdexcept>
#include <string> #include <string>
#include <string_view> #include <string_view>
#include <type_traits> #include <type_traits>
#include <variant>
#include <vector>
#include "../Box.hpp" #include <avro.h>
//#include "../Box.hpp"
#include "../Bytestring.hpp" #include "../Bytestring.hpp"
#include "../Ref.hpp" //#include "../Ref.hpp"
#include "../Result.hpp" //#include "../Result.hpp"
#include "../Vectorstring.hpp" #include "../Vectorstring.hpp"
#include "../always_false.hpp" #include "../always_false.hpp"
#include "../internal/is_literal.hpp" #include "../internal/is_literal.hpp"
@@ -63,94 +56,100 @@ class Writer {
OutputObjectType object_as_root(const size_t _size) const noexcept; OutputObjectType object_as_root(const size_t _size) const noexcept;
OutputVarType null_as_root() const noexcept; OutputVarType null_as_root() const;
OutputUnionType union_as_root() const noexcept; OutputUnionType union_as_root() const noexcept;
template <class T> template <class T>
OutputVarType value_as_root(const T& _var) const noexcept { OutputVarType value_as_root(const T& _var) const {
set_value(_var, root_); set_value(_var, root_);
return OutputVarType{*root_}; return OutputVarType{*root_};
} }
OutputArrayType add_array_to_array(const size_t _size, OutputArrayType add_array_to_array(const size_t _size,
OutputArrayType* _parent) const noexcept; OutputArrayType* _parent) const;
OutputArrayType add_array_to_map(const std::string_view& _name, OutputArrayType add_array_to_map(const std::string_view& _name,
const size_t _size, const size_t _size,
OutputMapType* _parent) const noexcept; OutputMapType* _parent) const;
OutputArrayType add_array_to_object(const std::string_view& _name, OutputArrayType add_array_to_object(const std::string_view& _name,
const size_t _size, const size_t _size,
OutputObjectType* _parent) const noexcept; OutputObjectType* _parent) const;
OutputArrayType add_array_to_union(const size_t _index, const size_t _size, OutputArrayType add_array_to_union(const size_t _index, const size_t _size,
OutputUnionType* _parent) const noexcept; OutputUnionType* _parent) const;
OutputMapType add_map_to_array(const size_t _size, OutputMapType add_map_to_array(const size_t _size,
OutputArrayType* _parent) const noexcept; OutputArrayType* _parent) const;
OutputMapType add_map_to_map(const std::string_view& _name, OutputMapType add_map_to_map(const std::string_view& _name,
const size_t _size, const size_t _size,
OutputMapType* _parent) const noexcept; OutputMapType* _parent) const;
OutputMapType add_map_to_object(const std::string_view& _name, OutputMapType add_map_to_object(const std::string_view& _name,
const size_t _size, const size_t _size,
OutputObjectType* _parent) const noexcept; OutputObjectType* _parent) const;
OutputMapType add_map_to_union(const size_t _index, const size_t _size, OutputMapType add_map_to_union(const size_t _index, const size_t _size,
OutputUnionType* _parent) const noexcept; OutputUnionType* _parent) const;
OutputObjectType add_object_to_array(const size_t _size, OutputObjectType add_object_to_array(const size_t _size,
OutputArrayType* _parent) const noexcept; OutputArrayType* _parent) const;
OutputObjectType add_object_to_map(const std::string_view& _name, OutputObjectType add_object_to_map(const std::string_view& _name,
const size_t _size, const size_t _size,
OutputMapType* _parent) const noexcept; OutputMapType* _parent) const;
OutputObjectType add_object_to_object( OutputObjectType add_object_to_object(
const std::string_view& _name, const size_t _size, const std::string_view& _name, const size_t _size,
OutputObjectType* _parent) const noexcept; OutputObjectType* _parent) const;
OutputObjectType add_object_to_union(const size_t _index, const size_t _size, OutputObjectType add_object_to_union(const size_t _index, const size_t _size,
OutputUnionType* _parent) const noexcept; OutputUnionType* _parent) const;
OutputUnionType add_union_to_array(OutputArrayType* _parent) const noexcept; OutputUnionType add_union_to_array(OutputArrayType* _parent) const;
OutputUnionType add_union_to_map(const std::string_view& _name, OutputUnionType add_union_to_map(const std::string_view& _name,
OutputMapType* _parent) const noexcept; OutputMapType* _parent) const;
OutputUnionType add_union_to_object(const std::string_view& _name, OutputUnionType add_union_to_object(const std::string_view& _name,
OutputObjectType* _parent) const noexcept; OutputObjectType* _parent) const;
OutputUnionType add_union_to_union(const size_t _index, OutputUnionType add_union_to_union(const size_t _index,
OutputUnionType* _parent) const noexcept; OutputUnionType* _parent) const;
OutputVarType add_null_to_array(OutputArrayType* _parent) const noexcept; OutputVarType add_null_to_array(OutputArrayType* _parent) const;
OutputVarType add_null_to_map(const std::string_view& _name, OutputVarType add_null_to_map(const std::string_view& _name,
OutputMapType* _parent) const noexcept; OutputMapType* _parent) const;
OutputVarType add_null_to_object(const std::string_view& _name, OutputVarType add_null_to_object(const std::string_view& _name,
OutputObjectType* _parent) const noexcept; OutputObjectType* _parent) const;
OutputVarType add_null_to_union(const size_t _index, OutputVarType add_null_to_union(const size_t _index,
OutputUnionType* _parent) const noexcept; OutputUnionType* _parent) const;
template <class T> template <class T>
OutputVarType add_value_to_array(const T& _var, OutputVarType add_value_to_array(const T& _var,
OutputArrayType* _parent) const noexcept { OutputArrayType* _parent) const {
avro_value_t new_value; avro_value_t new_value;
avro_value_append(&_parent->val_, &new_value, nullptr); int result = avro_value_append(&_parent->val_, &new_value, nullptr);
if (result != 0) {
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
}
set_value(_var, &new_value); set_value(_var, &new_value);
return OutputVarType{new_value}; return OutputVarType{new_value};
} }
template <class T> template <class T>
OutputVarType add_value_to_map(const std::string_view& _name, const T& _var, OutputVarType add_value_to_map(const std::string_view& _name, const T& _var,
OutputMapType* _parent) const noexcept { OutputMapType* _parent) const {
avro_value_t new_value; avro_value_t new_value;
avro_value_add(&_parent->val_, _name.data(), &new_value, nullptr, nullptr); int result = avro_value_add(&_parent->val_, _name.data(), &new_value, nullptr, nullptr);
if (result != 0) {
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
}
set_value(_var, &new_value); set_value(_var, &new_value);
return OutputVarType{new_value}; return OutputVarType{new_value};
} }
@@ -158,53 +157,89 @@ class Writer {
template <class T> template <class T>
OutputVarType add_value_to_object(const std::string_view& _name, OutputVarType add_value_to_object(const std::string_view& _name,
const T& _var, const T& _var,
OutputObjectType* _parent) const noexcept { OutputObjectType* _parent) const {
avro_value_t new_value; avro_value_t new_value;
avro_value_get_by_name(&_parent->val_, _name.data(), &new_value, nullptr); int result = avro_value_get_by_name(&_parent->val_, _name.data(), &new_value, nullptr);
if (result != 0) {
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
}
set_value(_var, &new_value); set_value(_var, &new_value);
return OutputVarType{new_value}; return OutputVarType{new_value};
} }
template <class T> template <class T>
OutputVarType add_value_to_union(const size_t _index, const T& _var, OutputVarType add_value_to_union(const size_t _index, const T& _var,
OutputUnionType* _parent) const noexcept { OutputUnionType* _parent) const {
if (_index > static_cast<size_t>(INT_MAX)) {
throw std::runtime_error(std::string(__FUNCTION__) + " index error");
}
avro_value_t new_value; avro_value_t new_value;
avro_value_set_branch(&_parent->val_, static_cast<int>(_index), &new_value); int result = avro_value_set_branch(&_parent->val_, static_cast<int>(_index), &new_value);
if (result != 0) {
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
}
set_value(_var, &new_value); set_value(_var, &new_value);
return OutputVarType{new_value}; return OutputVarType{new_value};
} }
void end_array(OutputArrayType* _arr) const noexcept {} void end_array(OutputArrayType* /*_arr*/) const noexcept {}
void end_map(OutputMapType* _obj) const noexcept {} void end_map(OutputMapType* /*_obj*/) const noexcept {}
void end_object(OutputObjectType* _obj) const noexcept {} void end_object(OutputObjectType* /*_obj*/) const noexcept {}
private: private:
template <class T> template <class T>
void set_value(const T& _var, avro_value_t* _val) const noexcept { void set_value(const T& _var, avro_value_t* _val) const {
if constexpr (std::is_same<std::remove_cvref_t<T>, std::string>()) { if constexpr (std::is_same<std::remove_cvref_t<T>, std::string>()) {
avro_value_set_string_len(_val, _var.c_str(), _var.size() + 1); int result = avro_value_set_string_len(_val, _var.c_str(), _var.size() + 1);
if (result != 0) {
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
}
} else if constexpr (std::is_same<std::remove_cvref_t<T>, } else if constexpr (std::is_same<std::remove_cvref_t<T>,
rfl::Bytestring>() || rfl::Bytestring>() ||
std::is_same<std::remove_cvref_t<T>, std::is_same<std::remove_cvref_t<T>,
rfl::Vectorstring>()) { rfl::Vectorstring>()) {
auto var = _var; auto var = _var;
avro_value_set_bytes(_val, var.data(), var.size()); if (!var.data()) {
return;
}
int result = avro_value_set_bytes(_val, var.data(), var.size());
if (result != 0) {
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
}
} else if constexpr (std::is_same<std::remove_cvref_t<T>, bool>()) { } else if constexpr (std::is_same<std::remove_cvref_t<T>, bool>()) {
avro_value_set_boolean(_val, _var); int result = avro_value_set_boolean(_val, _var);
if (result != 0) {
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
}
} else if constexpr (std::is_floating_point<std::remove_cvref_t<T>>()) { } else if constexpr (std::is_floating_point<std::remove_cvref_t<T>>()) {
/*int result = avro_value_set_double(_val, static_cast<double>(_var));
if (result != 0) {
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
}*/
avro_value_set_double(_val, static_cast<double>(_var)); avro_value_set_double(_val, static_cast<double>(_var));
} else if constexpr (std::is_integral<std::remove_cvref_t<T>>()) { } else if constexpr (std::is_integral<std::remove_cvref_t<T>>()) {
/*int result = avro_value_set_long(_val, static_cast<std::int64_t>(_var));
if (result != 0) {
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
}*/
avro_value_set_long(_val, static_cast<std::int64_t>(_var)); avro_value_set_long(_val, static_cast<std::int64_t>(_var));
} else if constexpr (internal::is_literal_v<T>) { } else if constexpr (internal::is_literal_v<T>) {
avro_value_set_enum(_val, static_cast<int>(_var.value())); int result = avro_value_set_enum(_val, static_cast<int>(_var.value()));
if (result != 0) {
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
}
} else if constexpr (internal::is_validator_v<T>) {
using ValueType = std::remove_cvref_t<typename T::ReflectionType>;
const auto val = _var.value();
set_value<ValueType>(val, _val);
} else if constexpr (std::is_same<std::remove_cvref_t<T>, rfl::Timestamp<"%Y-%m-%d">>()) {
const auto str = _var.to_string();
set_value<std::string>(str, _val);
} else if constexpr (std::is_same<std::remove_cvref_t<T>, rfl::Email>()) {
const auto& str = static_cast<const std::string&>(_var);
set_value<std::string>(str, _val);
} else { } else {
static_assert(rfl::always_false_v<T>, "Unsupported type."); static_assert(rfl::always_false_v<T>, "Unsupported type.");
} }
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef RFL_AVRO_LOAD_HPP_ #ifndef RFL_AVRO_LOAD_HPP_
#define RFL_AVRO_LOAD_HPP_ #define RFL_AVRO_LOAD_HPP_
#include "../Processors.hpp" //#include "../Processors.hpp"
#include "../Result.hpp" #include "../Result.hpp"
#include "../io/load_bytes.hpp" #include "../io/load_bytes.hpp"
#include "read.hpp" #include "read.hpp"
+8 -4
View File
@@ -3,7 +3,6 @@
#include <avro.h> #include <avro.h>
#include <bit>
#include <istream> #include <istream>
#include <string> #include <string>
#include <type_traits> #include <type_traits>
@@ -37,9 +36,14 @@ Result<internal::wrap_in_rfl_array_t<T>> read(
avro_reader_t avro_reader = avro_reader_t avro_reader =
avro_reader_memory(internal::ptr_cast<const char*>(_bytes), _size); avro_reader_memory(internal::ptr_cast<const char*>(_bytes), _size);
avro_value_t root; avro_value_t root;
avro_generic_value_new(_schema.iface(), &root); int res = avro_generic_value_new(_schema.iface(), &root);
auto err = avro_value_read(avro_reader, &root); if (res != 0) {
if (err) { avro_value_decref(&root);
avro_reader_free(avro_reader);
return error(std::string("Could not read root value: ") + avro_strerror());
}
res = avro_value_read(avro_reader, &root);
if (res) {
avro_value_decref(&root); avro_value_decref(&root);
avro_reader_free(avro_reader); avro_reader_free(avro_reader);
return error(std::string("Could not read root value: ") + avro_strerror()); return error(std::string("Could not read root value: ") + avro_strerror());
+25 -26
View File
@@ -2,12 +2,11 @@
#define RFL_AVRO_SCHEMA_TYPE_HPP_ #define RFL_AVRO_SCHEMA_TYPE_HPP_
#include <map> #include <map>
#include <memory>
#include <optional> #include <optional>
#include <string> #include <string>
#include "../../Literal.hpp" #include "../../Literal.hpp"
#include "../../Object.hpp" //#include "../../Object.hpp"
#include "../../Ref.hpp" #include "../../Ref.hpp"
#include "../../Rename.hpp" #include "../../Rename.hpp"
#include "../../Variant.hpp" #include "../../Variant.hpp"
@@ -16,69 +15,69 @@ namespace rfl::avro::schema {
struct Type { struct Type {
struct Null { struct Null {
Literal<"null"> type; Literal<"null"> type{};
}; };
struct Boolean { struct Boolean {
Literal<"boolean"> type; Literal<"boolean"> type{};
}; };
struct Int { struct Int {
Literal<"int"> type; Literal<"int"> type{};
}; };
struct Long { struct Long {
Literal<"long"> type; Literal<"long"> type{};
}; };
struct Float { struct Float {
Literal<"float"> type; Literal<"float"> type{};
}; };
struct Double { struct Double {
Literal<"float"> type; Literal<"float"> type{};
}; };
struct Bytes { struct Bytes {
Literal<"bytes"> type; Literal<"bytes"> type{};
}; };
struct String { struct String {
Literal<"string"> type; Literal<"string"> type{};
}; };
struct RecordField { struct RecordField {
std::string name; std::string name{};
rfl::Ref<Type> type; rfl::Ref<Type> type{};
}; };
struct Record { struct Record {
Literal<"record"> type; Literal<"record"> type{};
std::string name; std::string name{};
std::vector<RecordField> fields; std::vector<RecordField> fields{};
std::optional<std::string> doc; std::optional<std::string> doc{};
}; };
struct Enum { struct Enum {
Literal<"enum"> type; Literal<"enum"> type{};
std::string name; std::string name{};
std::vector<std::string> symbols; std::vector<std::string> symbols{};
}; };
struct Array { struct Array {
Literal<"array"> type; Literal<"array"> type{};
rfl::Ref<Type> items; rfl::Ref<Type> items{};
Rename<"default", std::vector<std::string>> default_; Rename<"default", std::vector<std::string>> default_{};
}; };
struct Map { struct Map {
Literal<"map"> type; Literal<"map"> type{};
rfl::Ref<Type> values; rfl::Ref<Type> values{};
Rename<"default", std::map<std::string, std::string>> default_; Rename<"default", std::map<std::string, std::string>> default_{};
}; };
struct Reference { struct Reference {
std::string type; std::string type{};
}; };
using ReflectionType = using ReflectionType =
+6 -8
View File
@@ -1,21 +1,19 @@
#ifndef RFL_AVRO_TOSCHEMA_HPP_ #ifndef RFL_AVRO_TOSCHEMA_HPP_
#define RFL_AVRO_TOSCHEMA_HPP_ #define RFL_AVRO_TOSCHEMA_HPP_
#include <map>
#include <string> #include <string>
#include <type_traits>
#include "../Literal.hpp" //#include "../Literal.hpp"
#include "../Processors.hpp" #include "../Processors.hpp"
#include "../Variant.hpp" //#include "../Variant.hpp"
#include "../json.hpp" //#include "../json.hpp"
#include "../parsing/schema/Type.hpp" //#include "../parsing/schema/Type.hpp"
#include "../parsing/schema/ValidationType.hpp" //#include "../parsing/schema/ValidationType.hpp"
#include "../parsing/schema/make.hpp" #include "../parsing/schema/make.hpp"
#include "Reader.hpp" #include "Reader.hpp"
#include "Schema.hpp" #include "Schema.hpp"
#include "Writer.hpp" #include "Writer.hpp"
#include "schema/Type.hpp" //#include "schema/Type.hpp"
namespace rfl::avro { namespace rfl::avro {
+15 -10
View File
@@ -3,17 +3,12 @@
#include <avro.h> #include <avro.h>
#include <bit>
#include <cstdint>
#include <ostream> #include <ostream>
#include <sstream>
#include <string>
#include <type_traits> #include <type_traits>
#include <utility>
#include "../parsing/Parent.hpp" #include "../parsing/Parent.hpp"
#include "Parser.hpp" #include "Parser.hpp"
#include "Schema.hpp" //#include "Schema.hpp"
#include "Writer.hpp" #include "Writer.hpp"
#include "to_schema.hpp" #include "to_schema.hpp"
@@ -21,22 +16,32 @@ namespace rfl::avro {
/// Returns AVRO bytes. /// Returns AVRO bytes.
template <class... Ps> template <class... Ps>
std::vector<char> write(const auto& _obj, const auto& _schema) noexcept { std::vector<char> write(const auto& _obj, const auto& _schema) {
using T = std::remove_cvref_t<decltype(_obj)>; using T = std::remove_cvref_t<decltype(_obj)>;
using U = typename std::remove_cvref_t<decltype(_schema)>::Type; using U = typename std::remove_cvref_t<decltype(_schema)>::Type;
using ParentType = parsing::Parent<Writer>; using ParentType = parsing::Parent<Writer>;
static_assert(std::is_same<T, U>(), static_assert(std::is_same<T, U>(),
"The schema must be compatible with the type to write."); "The schema must be compatible with the type to write.");
avro_value_t root; avro_value_t root;
avro_generic_value_new(_schema.iface(), &root); int result = avro_generic_value_new(_schema.iface(), &root);
if (result != 0) {
avro_value_decref(&root);
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
}
const auto writer = Writer(&root); const auto writer = Writer(&root);
Parser<T, Processors<Ps...>>::write(writer, _obj, Parser<T, Processors<Ps...>>::write(writer, _obj,
typename ParentType::Root{}); typename ParentType::Root{});
size_t size = 0; size_t size = 0;
avro_value_sizeof(&root, &size); result = avro_value_sizeof(&root, &size);
if (result != 0) {
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
}
std::vector<char> buffer(size); std::vector<char> buffer(size);
avro_writer_t avro_writer = avro_writer_memory(buffer.data(), buffer.size()); avro_writer_t avro_writer = avro_writer_memory(buffer.data(), buffer.size());
avro_value_write(avro_writer, &root); result = avro_value_write(avro_writer, &root);
if (result != 0) {
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
}
avro_value_decref(&root); avro_value_decref(&root);
avro_writer_free(avro_writer); avro_writer_free(avro_writer);
return buffer; return buffer;
+1 -1
View File
@@ -3,7 +3,7 @@
#include <bson/bson.h> #include <bson/bson.h>
#include "../parsing/Parser.hpp" //#include "../parsing/Parser.hpp"
#include "Reader.hpp" #include "Reader.hpp"
#include "Writer.hpp" #include "Writer.hpp"
+4 -13
View File
@@ -3,27 +3,18 @@
#include <bson/bson.h> #include <bson/bson.h>
#include <array>
#include <concepts>
#include <cstddef> #include <cstddef>
#include <exception> #include <exception>
#include <map>
#include <memory>
#include <optional> #include <optional>
#include <sstream>
#include <stdexcept>
#include <string> #include <string>
#include <string_view>
#include <type_traits> #include <type_traits>
#include <unordered_map>
#include <vector>
#include "../Box.hpp" //#include "../Box.hpp"
#include "../Bytestring.hpp" //#include "../Bytestring.hpp"
#include "../Result.hpp" #include "../Result.hpp"
#include "../Vectorstring.hpp" //#include "../Vectorstring.hpp"
#include "../always_false.hpp" #include "../always_false.hpp"
#include "../internal/ptr_cast.hpp" //#include "../internal/ptr_cast.hpp"
namespace rfl { namespace rfl {
namespace bson { namespace bson {
+1 -5
View File
@@ -4,10 +4,6 @@
#include <bson/bson.h> #include <bson/bson.h>
#include <cstddef> #include <cstddef>
#include <exception>
#include <map>
#include <sstream>
#include <stdexcept>
#include <string> #include <string>
#include <string_view> #include <string_view>
#include <type_traits> #include <type_traits>
@@ -17,7 +13,7 @@
#include "../Box.hpp" #include "../Box.hpp"
#include "../Bytestring.hpp" #include "../Bytestring.hpp"
#include "../Ref.hpp" #include "../Ref.hpp"
#include "../Result.hpp" //#include "../Result.hpp"
#include "../Vectorstring.hpp" #include "../Vectorstring.hpp"
#include "../always_false.hpp" #include "../always_false.hpp"
#include "../internal/ptr_cast.hpp" #include "../internal/ptr_cast.hpp"
-1
View File
@@ -4,7 +4,6 @@
#include <bson/bson.h> #include <bson/bson.h>
#include <istream> #include <istream>
#include <string>
#include "../Processors.hpp" #include "../Processors.hpp"
#include "../concepts.hpp" #include "../concepts.hpp"
-2
View File
@@ -1,8 +1,6 @@
#ifndef RFL_BSON_SAVE_HPP_ #ifndef RFL_BSON_SAVE_HPP_
#define RFL_BSON_SAVE_HPP_ #define RFL_BSON_SAVE_HPP_
#include <fstream>
#include <iostream>
#include <string> #include <string>
#include "../Result.hpp" #include "../Result.hpp"
-2
View File
@@ -4,8 +4,6 @@
#include <bson/bson.h> #include <bson/bson.h>
#include <ostream> #include <ostream>
#include <sstream>
#include <string>
#include <utility> #include <utility>
#include "../Processors.hpp" #include "../Processors.hpp"
+6 -6
View File
@@ -1,10 +1,10 @@
#ifndef RFL_CAPNPROTO_PARSER_HPP_ #ifndef RFL_CAPNPROTO_PARSER_HPP_
#define RFL_CAPNPROTO_PARSER_HPP_ #define RFL_CAPNPROTO_PARSER_HPP_
#include "../Generic.hpp" //#include "../Generic.hpp"
#include "../Tuple.hpp" #include "../Tuple.hpp"
#include "../always_false.hpp" #include "../always_false.hpp"
#include "../parsing/Parser.hpp" //#include "../parsing/Parser.hpp"
#include "Reader.hpp" #include "Reader.hpp"
#include "Writer.hpp" #include "Writer.hpp"
@@ -91,16 +91,16 @@ struct Parser<capnproto::Reader, capnproto::Writer,
} }
template <class P> template <class P>
static void write(const W& _w, static void write(const W& /*_w*/,
const internal::Skip<T, _skip_serialization, const internal::Skip<T, _skip_serialization,
_skip_deserialization>& _skip, _skip_deserialization>& /*_skip*/,
const P& _parent) noexcept { const P& /*_parent*/) noexcept {
static_assert(always_false_v<P>, static_assert(always_false_v<P>,
"rfl::Skip is unsupported in Cap'n Proto."); "rfl::Skip is unsupported in Cap'n Proto.");
} }
template <class U> template <class U>
static schema::Type to_schema(U* _definitions) { static schema::Type to_schema(U* /*_definitions*/) {
static_assert(always_false_v<U>, static_assert(always_false_v<U>,
"rfl::Skip is unsupported in Cap'n Proto."); "rfl::Skip is unsupported in Cap'n Proto.");
return schema::Type{}; return schema::Type{};
-3
View File
@@ -3,12 +3,9 @@
#include <capnp/dynamic.h> #include <capnp/dynamic.h>
#include <cstddef>
#include <exception> #include <exception>
#include <string> #include <string>
#include <string_view>
#include <type_traits> #include <type_traits>
#include <vector>
#include "../Bytestring.hpp" #include "../Bytestring.hpp"
#include "../Result.hpp" #include "../Result.hpp"
+2 -3
View File
@@ -3,11 +3,10 @@
#include <capnp/schema-parser.h> #include <capnp/schema-parser.h>
#include <memory>
#include <string> #include <string>
#include "../Box.hpp" //#include "../Box.hpp"
#include "../Result.hpp" //#include "../Result.hpp"
namespace rfl::capnproto { namespace rfl::capnproto {
+10 -16
View File
@@ -4,26 +4,20 @@
#include <capnp/dynamic.h> #include <capnp/dynamic.h>
#include <kj/array.h> #include <kj/array.h>
#include <bit>
#include <cstdint> #include <cstdint>
#include <exception>
#include <map>
#include <sstream>
#include <stdexcept> #include <stdexcept>
#include <string> #include <string>
#include <string_view> #include <string_view>
#include <type_traits> #include <type_traits>
#include <variant>
#include <vector>
#include "../Box.hpp" //#include "../Box.hpp"
#include "../Bytestring.hpp" #include "../Bytestring.hpp"
#include "../Ref.hpp" //#include "../Ref.hpp"
#include "../Result.hpp" //#include "../Result.hpp"
#include "../Vectorstring.hpp" #include "../Vectorstring.hpp"
#include "../always_false.hpp" #include "../always_false.hpp"
#include "../internal/is_literal.hpp" #include "../internal/is_literal.hpp"
#include "../internal/ptr_cast.hpp" //#include "../internal/ptr_cast.hpp"
namespace rfl::capnproto { namespace rfl::capnproto {
@@ -62,14 +56,14 @@ class Writer {
~Writer(); ~Writer();
template <class T> template <class T>
OutputArrayType array_as_root(const T _size) const noexcept { OutputArrayType array_as_root(const T /*_size*/) const noexcept {
static_assert(always_false_v<T>, static_assert(always_false_v<T>,
"In Cap'n Proto, root values must always be structs."); "In Cap'n Proto, root values must always be structs.");
throw std::runtime_error("Unsupported."); throw std::runtime_error("Unsupported.");
} }
template <class T> template <class T>
OutputMapType map_as_root(const T _size) const noexcept { OutputMapType map_as_root(const T /*_size*/) const noexcept {
static_assert(always_false_v<T>, static_assert(always_false_v<T>,
"In Cap'n Proto, root values must always be structs."); "In Cap'n Proto, root values must always be structs.");
throw std::runtime_error("Unsupported."); throw std::runtime_error("Unsupported.");
@@ -92,7 +86,7 @@ class Writer {
} }
template <class T> template <class T>
OutputVarType value_as_root(const T& _var) const noexcept { OutputVarType value_as_root(const T& /*_var*/) const noexcept {
static_assert(always_false_v<T>, static_assert(always_false_v<T>,
"In Cap'n Proto, root values must always be structs."); "In Cap'n Proto, root values must always be structs.");
throw std::runtime_error("Unsupported."); throw std::runtime_error("Unsupported.");
@@ -261,11 +255,11 @@ class Writer {
return OutputVarType{}; return OutputVarType{};
} }
void end_array(OutputArrayType* _arr) const noexcept {} void end_array(OutputArrayType* /*_arr*/) const noexcept {}
void end_map(OutputMapType* _obj) const noexcept {} void end_map(OutputMapType* /*_obj*/) const noexcept {}
void end_object(OutputObjectType* _obj) const noexcept {} void end_object(OutputObjectType* /*_obj*/) const noexcept {}
private: private:
capnp::DynamicStruct::Builder* root_; capnp::DynamicStruct::Builder* root_;
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef RFL_CAPNPROTO_LOAD_HPP_ #ifndef RFL_CAPNPROTO_LOAD_HPP_
#define RFL_CAPNPROTO_LOAD_HPP_ #define RFL_CAPNPROTO_LOAD_HPP_
#include "../Processors.hpp" //#include "../Processors.hpp"
#include "../Result.hpp" #include "../Result.hpp"
#include "../io/load_bytes.hpp" #include "../io/load_bytes.hpp"
#include "read.hpp" #include "read.hpp"
+2 -4
View File
@@ -5,16 +5,14 @@
#include <capnp/serialize-packed.h> #include <capnp/serialize-packed.h>
#include <kj/io.h> #include <kj/io.h>
#include <bit>
#include <istream> #include <istream>
#include <string>
#include <type_traits> #include <type_traits>
#include "../Processors.hpp" #include "../Processors.hpp"
#include "../SnakeCaseToCamelCase.hpp" #include "../SnakeCaseToCamelCase.hpp"
#include "../concepts.hpp" #include "../concepts.hpp"
#include "../internal/ptr_cast.hpp" //#include "../internal/ptr_cast.hpp"
#include "../internal/strings/strings.hpp" //#include "../internal/strings/strings.hpp"
#include "../internal/wrap_in_rfl_array_t.hpp" #include "../internal/wrap_in_rfl_array_t.hpp"
#include "Parser.hpp" #include "Parser.hpp"
#include "Reader.hpp" #include "Reader.hpp"
-1
View File
@@ -1,7 +1,6 @@
#ifndef RFL_CAPNPROTO_SAVE_HPP_ #ifndef RFL_CAPNPROTO_SAVE_HPP_
#define RFL_CAPNPROTO_SAVE_HPP_ #define RFL_CAPNPROTO_SAVE_HPP_
#include <fstream>
#include <iostream> #include <iostream>
#include <string> #include <string>
+12 -15
View File
@@ -2,15 +2,12 @@
#define RFL_CAPNPROTO_SCHEMA_TYPE_HPP_ #define RFL_CAPNPROTO_SCHEMA_TYPE_HPP_
#include <iostream> #include <iostream>
#include <map>
#include <memory>
#include <optional>
#include <string> #include <string>
#include "../../Literal.hpp" //#include "../../Literal.hpp"
#include "../../Object.hpp" //#include "../../Object.hpp"
#include "../../Ref.hpp" #include "../../Ref.hpp"
#include "../../Rename.hpp" //#include "../../Rename.hpp"
#include "../../Variant.hpp" #include "../../Variant.hpp"
namespace rfl::capnproto::schema { namespace rfl::capnproto::schema {
@@ -45,30 +42,30 @@ struct Type {
struct Text {}; struct Text {};
struct Enum { struct Enum {
std::string name; std::string name{};
std::vector<std::string> fields; std::vector<std::string> fields{};
}; };
struct List { struct List {
rfl::Ref<Type> type; rfl::Ref<Type> type{};
}; };
struct Map { struct Map {
rfl::Ref<Type> type; rfl::Ref<Type> type{};
}; };
struct Reference { struct Reference {
std::string type_name; std::string type_name{};
}; };
struct Struct { struct Struct {
std::string name; std::string name{};
std::vector<std::pair<std::string, Type>> fields; std::vector<std::pair<std::string, Type>> fields{};
}; };
struct Union { struct Union {
std::string name; std::string name{};
std::vector<std::pair<std::string, Type>> fields; std::vector<std::pair<std::string, Type>> fields{};
}; };
using ReflectionType = using ReflectionType =
+9 -10
View File
@@ -1,22 +1,21 @@
#ifndef RFL_CAPNPROTO_TOSCHEMA_HPP_ #ifndef RFL_CAPNPROTO_TOSCHEMA_HPP_
#define RFL_CAPNPROTO_TOSCHEMA_HPP_ #define RFL_CAPNPROTO_TOSCHEMA_HPP_
#include <map>
#include <string> #include <string>
#include <type_traits>
#include "../Literal.hpp" //#include "../Literal.hpp"
#include "../Processors.hpp" //#include "../Processors.hpp"
#include "../Result.hpp" #include "../Result.hpp"
#include "../SnakeCaseToCamelCase.hpp" //#include "../SnakeCaseToCamelCase.hpp"
#include "../Variant.hpp" //#include "../Variant.hpp"
#include "../json.hpp" //#include "../json.hpp"
#include "../parsing/schema/Type.hpp" //#include "../parsing/schema/Type.hpp"
#include "../parsing/schema/ValidationType.hpp" //#include "../parsing/schema/ValidationType.hpp"
#include "../parsing/schema/make.hpp" #include "../parsing/schema/make.hpp"
#include "Schema.hpp" #include "Schema.hpp"
#include "Writer.hpp" #include "Writer.hpp"
#include "schema/Type.hpp" #include "Reader.hpp"
//#include "schema/Type.hpp"
namespace rfl::capnproto { namespace rfl::capnproto {
+2 -7
View File
@@ -8,20 +8,15 @@
#include <capnp/serialize-packed.h> #include <capnp/serialize-packed.h>
#include <kj/io.h> #include <kj/io.h>
#include <bit>
#include <cstdint>
#include <ostream> #include <ostream>
#include <sstream>
#include <string>
#include <type_traits> #include <type_traits>
#include <utility>
#include "../SnakeCaseToCamelCase.hpp" #include "../SnakeCaseToCamelCase.hpp"
#include "../internal/ptr_cast.hpp" #include "../internal/ptr_cast.hpp"
#include "../internal/strings/strings.hpp" //#include "../internal/strings/strings.hpp"
#include "../parsing/Parent.hpp" #include "../parsing/Parent.hpp"
#include "Parser.hpp" #include "Parser.hpp"
#include "Schema.hpp" //#include "Schema.hpp"
#include "Writer.hpp" #include "Writer.hpp"
#include "get_root_name.hpp" #include "get_root_name.hpp"
#include "to_schema.hpp" #include "to_schema.hpp"
+2 -2
View File
@@ -1,8 +1,8 @@
#ifndef RFL_CBOR_PARSER_HPP_ #ifndef RFL_CBOR_PARSER_HPP_
#define RFL_CBOR_PARSER_HPP_ #define RFL_CBOR_PARSER_HPP_
#include "../Tuple.hpp" //#include "../Tuple.hpp"
#include "../parsing/Parser.hpp" //#include "../parsing/Parser.hpp"
#include "Reader.hpp" #include "Reader.hpp"
#include "Writer.hpp" #include "Writer.hpp"
-1
View File
@@ -5,7 +5,6 @@
#include <exception> #include <exception>
#include <jsoncons/json.hpp> #include <jsoncons/json.hpp>
#include <string> #include <string>
#include <string_view>
#include <type_traits> #include <type_traits>
#include <vector> #include <vector>
+5 -12
View File
@@ -1,22 +1,15 @@
#ifndef RFL_CBOR_WRITER_HPP_ #ifndef RFL_CBOR_WRITER_HPP_
#define RFL_CBOR_WRITER_HPP_ #define RFL_CBOR_WRITER_HPP_
#include <bit>
#include <exception>
#include <jsoncons_ext/cbor/cbor_encoder.hpp> #include <jsoncons_ext/cbor/cbor_encoder.hpp>
#include <map>
#include <sstream>
#include <stdexcept>
#include <string> #include <string>
#include <string_view> #include <string_view>
#include <type_traits> #include <type_traits>
#include <variant>
#include <vector>
#include "../Box.hpp" //#include "../Box.hpp"
#include "../Bytestring.hpp" #include "../Bytestring.hpp"
#include "../Ref.hpp" //#include "../Ref.hpp"
#include "../Result.hpp" //#include "../Result.hpp"
#include "../Vectorstring.hpp" #include "../Vectorstring.hpp"
#include "../always_false.hpp" #include "../always_false.hpp"
@@ -67,14 +60,14 @@ class Writer {
template <class T> template <class T>
OutputVarType add_value_to_array(const T& _var, OutputVarType add_value_to_array(const T& _var,
OutputArrayType* _parent) const noexcept { OutputArrayType* /*_parent*/) const noexcept {
return new_value(_var); return new_value(_var);
} }
template <class T> template <class T>
OutputVarType add_value_to_object(const std::string_view& _name, OutputVarType add_value_to_object(const std::string_view& _name,
const T& _var, const T& _var,
OutputObjectType* _parent) const noexcept { OutputObjectType* /*_parent*/) const noexcept {
encoder_->key(_name); encoder_->key(_name);
return new_value(_var); return new_value(_var);
} }
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef RFL_CBOR_LOAD_HPP_ #ifndef RFL_CBOR_LOAD_HPP_
#define RFL_CBOR_LOAD_HPP_ #define RFL_CBOR_LOAD_HPP_
#include "../Processors.hpp" //#include "../Processors.hpp"
#include "../Result.hpp" #include "../Result.hpp"
#include "../io/load_bytes.hpp" #include "../io/load_bytes.hpp"
#include "read.hpp" #include "read.hpp"
-1
View File
@@ -1,7 +1,6 @@
#ifndef RFL_CBOR_READ_HPP_ #ifndef RFL_CBOR_READ_HPP_
#define RFL_CBOR_READ_HPP_ #define RFL_CBOR_READ_HPP_
#include <bit>
#include <istream> #include <istream>
#include <jsoncons/json.hpp> #include <jsoncons/json.hpp>
#include <jsoncons_ext/cbor/decode_cbor.hpp> #include <jsoncons_ext/cbor/decode_cbor.hpp>
-2
View File
@@ -1,8 +1,6 @@
#ifndef RFL_CBOR_SAVE_HPP_ #ifndef RFL_CBOR_SAVE_HPP_
#define RFL_CBOR_SAVE_HPP_ #define RFL_CBOR_SAVE_HPP_
#include <fstream>
#include <iostream>
#include <string> #include <string>
#include "../Result.hpp" #include "../Result.hpp"
-3
View File
@@ -4,9 +4,6 @@
#include <cstdint> #include <cstdint>
#include <jsoncons_ext/cbor/cbor_encoder.hpp> #include <jsoncons_ext/cbor/cbor_encoder.hpp>
#include <ostream> #include <ostream>
#include <sstream>
#include <string>
#include <utility>
#include "../internal/ptr_cast.hpp" #include "../internal/ptr_cast.hpp"
#include "../parsing/Parent.hpp" #include "../parsing/Parent.hpp"
+2 -3
View File
@@ -5,13 +5,12 @@
#include <arrow/io/api.h> #include <arrow/io/api.h>
#include <istream> #include <istream>
#include <memory>
#include <string> #include <string>
#include <string_view> #include <string_view>
#include "../Processors.hpp" //#include "../Processors.hpp"
#include "../Result.hpp" #include "../Result.hpp"
#include "../concepts.hpp" //#include "../concepts.hpp"
#include "../internal/wrap_in_rfl_array_t.hpp" #include "../internal/wrap_in_rfl_array_t.hpp"
#include "../parsing/tabular/ArrowReader.hpp" #include "../parsing/tabular/ArrowReader.hpp"
#include "Settings.hpp" #include "Settings.hpp"
-2
View File
@@ -1,8 +1,6 @@
#ifndef RFL_CSV_SAVE_HPP_ #ifndef RFL_CSV_SAVE_HPP_
#define RFL_CSV_SAVE_HPP_ #define RFL_CSV_SAVE_HPP_
#include <fstream>
#include <iostream>
#include <string> #include <string>
#include "../Result.hpp" #include "../Result.hpp"
+2 -5
View File
@@ -5,16 +5,13 @@
#include <arrow/csv/writer.h> #include <arrow/csv/writer.h>
#include <arrow/io/api.h> #include <arrow/io/api.h>
#include <cstdint>
#include <ostream> #include <ostream>
#include <sstream>
#include <stdexcept> #include <stdexcept>
#include <string> #include <string>
#include <string_view> #include <string_view>
#include <utility>
#include "../Processors.hpp" //#include "../Processors.hpp"
#include "../Ref.hpp" //#include "../Ref.hpp"
#include "../parsing/tabular/ArrowWriter.hpp" #include "../parsing/tabular/ArrowWriter.hpp"
#include "Settings.hpp" #include "Settings.hpp"
+3 -7
View File
@@ -5,19 +5,15 @@
#include <cstddef> #include <cstddef>
#include <exception> #include <exception>
#include <map>
#include <sstream>
#include <stdexcept>
#include <string> #include <string>
#include <string_view> #include <string_view>
#include <type_traits> #include <type_traits>
#include <vector>
#include "../Bytestring.hpp" //#include "../Bytestring.hpp"
#include "../Result.hpp" #include "../Result.hpp"
#include "../Vectorstring.hpp" //#include "../Vectorstring.hpp"
#include "../always_false.hpp" #include "../always_false.hpp"
#include "../internal/ptr_cast.hpp" //#include "../internal/ptr_cast.hpp"
namespace rfl { namespace rfl {
namespace flexbuf { namespace flexbuf {
+4 -11
View File
@@ -4,20 +4,13 @@
#include <flatbuffers/flexbuffers.h> #include <flatbuffers/flexbuffers.h>
#include <cstddef> #include <cstddef>
#include <exception>
#include <functional>
#include <map>
#include <optional>
#include <sstream>
#include <stdexcept>
#include <string> #include <string>
#include <string_view> #include <string_view>
#include <type_traits> #include <type_traits>
#include <vector>
#include "../Bytestring.hpp" #include "../Bytestring.hpp"
#include "../Ref.hpp" //#include "../Ref.hpp"
#include "../Result.hpp" //#include "../Result.hpp"
#include "../Vectorstring.hpp" #include "../Vectorstring.hpp"
#include "../always_false.hpp" #include "../always_false.hpp"
@@ -70,14 +63,14 @@ struct Writer {
template <class T> template <class T>
OutputVarType add_value_to_array(const T& _var, OutputVarType add_value_to_array(const T& _var,
OutputArrayType* _parent) const noexcept { OutputArrayType* /*_parent*/) const noexcept {
return insert_value(_var); return insert_value(_var);
} }
template <class T> template <class T>
OutputVarType add_value_to_object(const std::string_view& _name, OutputVarType add_value_to_object(const std::string_view& _name,
const T& _var, const T& _var,
OutputObjectType* _parent) const noexcept { OutputObjectType* /*_parent*/) const noexcept {
return insert_value(_name, _var); return insert_value(_name, _var);
} }
+2 -2
View File
@@ -7,9 +7,9 @@
#include <vector> #include <vector>
#include "../Processors.hpp" #include "../Processors.hpp"
#include "../Result.hpp" //#include "../Result.hpp"
#include "../concepts.hpp" #include "../concepts.hpp"
#include "../internal/ptr_cast.hpp" //#include "../internal/ptr_cast.hpp"
#include "Parser.hpp" #include "Parser.hpp"
namespace rfl { namespace rfl {
-2
View File
@@ -1,8 +1,6 @@
#ifndef RFL_FLEXBUF_SAVE_HPP_ #ifndef RFL_FLEXBUF_SAVE_HPP_
#define RFL_FLEXBUF_SAVE_HPP_ #define RFL_FLEXBUF_SAVE_HPP_
#include <fstream>
#include <iostream>
#include <string> #include <string>
#include "../Result.hpp" #include "../Result.hpp"
+1 -3
View File
@@ -3,13 +3,11 @@
#include <flatbuffers/flexbuffers.h> #include <flatbuffers/flexbuffers.h>
#include <cstddef>
#include <ostream> #include <ostream>
#include <sstream>
#include <vector> #include <vector>
#include "../Processors.hpp" #include "../Processors.hpp"
#include "../Ref.hpp" //#include "../Ref.hpp"
#include "../internal/ptr_cast.hpp" #include "../internal/ptr_cast.hpp"
#include "../parsing/Parent.hpp" #include "../parsing/Parent.hpp"
#include "Parser.hpp" #include "Parser.hpp"
+1 -6
View File
@@ -2,14 +2,9 @@
#define GENERIC_READER_HPP_ #define GENERIC_READER_HPP_
#include <cstddef> #include <cstddef>
#include <exception>
#include <map>
#include <sstream>
#include <stdexcept>
#include <string> #include <string>
#include <string_view> #include <string_view>
#include <type_traits> #include <type_traits>
#include <vector>
#include "../Generic.hpp" #include "../Generic.hpp"
#include "../Result.hpp" #include "../Result.hpp"
@@ -97,7 +92,7 @@ struct Reader {
template <class T> template <class T>
rfl::Result<T> use_custom_constructor( rfl::Result<T> use_custom_constructor(
const InputVarType _var) const noexcept { const InputVarType /*_var*/) const noexcept {
return error("Not supported for generic types"); return error("Not supported for generic types");
} }
}; };
-3
View File
@@ -1,12 +1,9 @@
#ifndef GENERIC_READ_HPP_ #ifndef GENERIC_READ_HPP_
#define GENERIC_READ_HPP_ #define GENERIC_READ_HPP_
#include <istream>
#include <vector>
#include "../Generic.hpp" #include "../Generic.hpp"
#include "../Processors.hpp" #include "../Processors.hpp"
#include "../Result.hpp"
#include "Parser.hpp" #include "Parser.hpp"
namespace rfl { namespace rfl {
-2
View File
@@ -1,8 +1,6 @@
#ifndef RFL_INTERNAL_ARRAY_HPP_ #ifndef RFL_INTERNAL_ARRAY_HPP_
#define RFL_INTERNAL_ARRAY_HPP_ #define RFL_INTERNAL_ARRAY_HPP_
#include <array>
#include <cstddef>
#include <type_traits> #include <type_traits>
#include "to_std_array.hpp" #include "to_std_array.hpp"
-2
View File
@@ -1,8 +1,6 @@
#ifndef RFL_INTERNAL_FIELD_TUPLE_T_HPP_ #ifndef RFL_INTERNAL_FIELD_TUPLE_T_HPP_
#define RFL_INTERNAL_FIELD_TUPLE_T_HPP_ #define RFL_INTERNAL_FIELD_TUPLE_T_HPP_
#include <functional>
#include <tuple>
#include <type_traits> #include <type_traits>
#include "copy_to_field_tuple.hpp" #include "copy_to_field_tuple.hpp"
-3
View File
@@ -1,9 +1,6 @@
#ifndef RFL_INTERNAL_GETTER_HPP_ #ifndef RFL_INTERNAL_GETTER_HPP_
#define RFL_INTERNAL_GETTER_HPP_ #define RFL_INTERNAL_GETTER_HPP_
#include <tuple>
#include <variant>
#include "../Tuple.hpp" #include "../Tuple.hpp"
#include "StringLiteral.hpp" #include "StringLiteral.hpp"
#include "find_index.hpp" #include "find_index.hpp"
-2
View File
@@ -1,8 +1,6 @@
#ifndef RFL_INTERNAL_HASVALIDATION_HPP_ #ifndef RFL_INTERNAL_HASVALIDATION_HPP_
#define RFL_INTERNAL_HASVALIDATION_HPP_ #define RFL_INTERNAL_HASVALIDATION_HPP_
#include <type_traits>
#include "../Result.hpp" #include "../Result.hpp"
namespace rfl { namespace rfl {
-4
View File
@@ -1,10 +1,6 @@
#ifndef RFL_INTERNAL_ALLFIELDS_HPP_ #ifndef RFL_INTERNAL_ALLFIELDS_HPP_
#define RFL_INTERNAL_ALLFIELDS_HPP_ #define RFL_INTERNAL_ALLFIELDS_HPP_
#include <tuple>
#include <type_traits>
#include <utility>
#include "../Tuple.hpp" #include "../Tuple.hpp"
#include "is_field.hpp" #include "is_field.hpp"
+1 -3
View File
@@ -3,13 +3,11 @@
#include <cassert> #include <cassert>
#include <cstddef> #include <cstddef>
#include <iostream>
#include <type_traits>
#include <utility> #include <utility>
#include "../Tuple.hpp" #include "../Tuple.hpp"
#include "../always_false.hpp" #include "../always_false.hpp"
#include "is_named_tuple.hpp" //#include "is_named_tuple.hpp" //Not here
#include "num_fields.hpp" #include "num_fields.hpp"
namespace rfl::internal { namespace rfl::internal {
@@ -1,8 +1,6 @@
#ifndef RFL_INTERNAL_COPY_FLATTENED_TUPLE_TO_NAMED_TUPLE_HPP_ #ifndef RFL_INTERNAL_COPY_FLATTENED_TUPLE_TO_NAMED_TUPLE_HPP_
#define RFL_INTERNAL_COPY_FLATTENED_TUPLE_TO_NAMED_TUPLE_HPP_ #define RFL_INTERNAL_COPY_FLATTENED_TUPLE_TO_NAMED_TUPLE_HPP_
#include <functional>
#include <tuple>
#include <type_traits> #include <type_traits>
#include <utility> #include <utility>
+3 -5
View File
@@ -1,18 +1,16 @@
#ifndef RFL_INTERNAL_ENUMS_NAMES_HPP_ #ifndef RFL_INTERNAL_ENUMS_NAMES_HPP_
#define RFL_INTERNAL_ENUMS_NAMES_HPP_ #define RFL_INTERNAL_ENUMS_NAMES_HPP_
#include <algorithm>
#include <array> #include <array>
#include <string>
#include <string_view> #include <string_view>
#include <type_traits> #include <type_traits>
#include <utility> #include <utility>
#include "../../Literal.hpp" #include "../../Literal.hpp"
#include "../../config.hpp" //#include "../../config.hpp"
#include "../../define_literal.hpp" //#include "../../define_literal.hpp"
#include "../../make_named_tuple.hpp" #include "../../make_named_tuple.hpp"
#include "../../thirdparty/enchantum/enchantum.hpp" //#include "../../thirdparty/enchantum/enchantum.hpp"
#include "../StringLiteral.hpp" #include "../StringLiteral.hpp"
namespace rfl::internal::enums { namespace rfl::internal::enums {
@@ -28,12 +28,11 @@
#define ENCHANTUM_MAX_RANGE RFL_ENUM_RANGE_MAX #define ENCHANTUM_MAX_RANGE RFL_ENUM_RANGE_MAX
#include <concepts> #include <concepts>
#include <limits>
#include <type_traits>
#include <utility> #include <utility>
#include "../../thirdparty/enchantum/enchantum.hpp"// NOLINT(unused-includes)
#include "../../Literal.hpp" #include "../../Literal.hpp"
#include "../../thirdparty/enchantum/enchantum.hpp"
#include "Names.hpp" #include "Names.hpp"
#include "range_defined.hpp" #include "range_defined.hpp"
@@ -1,8 +1,6 @@
#ifndef RFL_INTERNAL_ENUMS_RANGE_DEFINED_HPP_ #ifndef RFL_INTERNAL_ENUMS_RANGE_DEFINED_HPP_
#define RFL_INTERNAL_ENUMS_RANGE_DEFINED_HPP_ #define RFL_INTERNAL_ENUMS_RANGE_DEFINED_HPP_
#include <concepts>
#include "../../config.hpp" #include "../../config.hpp"
namespace rfl::internal::enums { namespace rfl::internal::enums {
-2
View File
@@ -1,8 +1,6 @@
#ifndef RFL_INTERNAL_FIELD_TUPLE_T_HPP_ #ifndef RFL_INTERNAL_FIELD_TUPLE_T_HPP_
#define RFL_INTERNAL_FIELD_TUPLE_T_HPP_ #define RFL_INTERNAL_FIELD_TUPLE_T_HPP_
#include <functional>
#include <tuple>
#include <type_traits> #include <type_traits>
#include "copy_to_field_tuple.hpp" #include "copy_to_field_tuple.hpp"
+1 -2
View File
@@ -1,11 +1,10 @@
#ifndef RFL_INTERNAL_FIELD_TYPE_HPP_ #ifndef RFL_INTERNAL_FIELD_TYPE_HPP_
#define RFL_INTERNAL_FIELD_TYPE_HPP_ #define RFL_INTERNAL_FIELD_TYPE_HPP_
#include <tuple>
#include <type_traits> #include <type_traits>
#include <variant> #include <variant>
#include "../NamedTuple.hpp" //#include "../NamedTuple.hpp"
#include "../TaggedUnion.hpp" #include "../TaggedUnion.hpp"
#include "../Tuple.hpp" #include "../Tuple.hpp"
#include "../named_tuple_t.hpp" #include "../named_tuple_t.hpp"
-2
View File
@@ -1,8 +1,6 @@
#ifndef RFL_FIND_INDEX_HPP_ #ifndef RFL_FIND_INDEX_HPP_
#define RFL_FIND_INDEX_HPP_ #define RFL_FIND_INDEX_HPP_
#include <type_traits>
#include "StringLiteral.hpp" #include "StringLiteral.hpp"
namespace rfl { namespace rfl {
@@ -1,7 +1,6 @@
#ifndef RFL_INTERNAL_FLATTENED_PTR_TUPLE_T_HPP_ #ifndef RFL_INTERNAL_FLATTENED_PTR_TUPLE_T_HPP_
#define RFL_INTERNAL_FLATTENED_PTR_TUPLE_T_HPP_ #define RFL_INTERNAL_FLATTENED_PTR_TUPLE_T_HPP_
#include <functional>
#include <type_traits> #include <type_traits>
#include "to_flattened_ptr_tuple.hpp" #include "to_flattened_ptr_tuple.hpp"
+1 -5
View File
@@ -1,13 +1,9 @@
#ifndef RFL_INTERNAL_FLATTENED_TUPLE_T_HPP_ #ifndef RFL_INTERNAL_FLATTENED_TUPLE_T_HPP_
#define RFL_INTERNAL_FLATTENED_TUPLE_T_HPP_ #define RFL_INTERNAL_FLATTENED_TUPLE_T_HPP_
#include <functional>
#include <tuple>
#include <type_traits>
#include "flattened_ptr_tuple_t.hpp" #include "flattened_ptr_tuple_t.hpp"
#include "remove_ptrs_tup.hpp" #include "remove_ptrs_tup.hpp"
#include "../to_named_tuple.hpp" //#include "../to_named_tuple.hpp"
namespace rfl { namespace rfl {
namespace internal { namespace internal {
@@ -2,10 +2,7 @@
#define RFL_INTERNAL_GET_ITH_FIELD_FROM_FAKE_OBJECT_HPP_ #define RFL_INTERNAL_GET_ITH_FIELD_FROM_FAKE_OBJECT_HPP_
#include <cstddef> #include <cstddef>
#include <iostream>
#include <tuple>
#include <type_traits> #include <type_traits>
#include <utility>
#include "../always_false.hpp" #include "../always_false.hpp"
#include "get_fake_object.hpp" #include "get_fake_object.hpp"
-1
View File
@@ -2,7 +2,6 @@
#define RFL_INTERNAL_GETMETAFIELDS_HPP_ #define RFL_INTERNAL_GETMETAFIELDS_HPP_
#include <array> #include <array>
#include <tuple>
#include <utility> #include <utility>
#include "../MetaField.hpp" #include "../MetaField.hpp"
+1 -1
View File
@@ -3,7 +3,7 @@
#include <type_traits> #include <type_traits>
#include "../parsing/Parser.hpp" //#include "../parsing/Parser.hpp"
namespace rfl::internal { namespace rfl::internal {
+3 -2
View File
@@ -1,15 +1,16 @@
#ifndef RFL_INTERNAL_HASFIELDS_HPP_ #ifndef RFL_INTERNAL_HASFIELDS_HPP_
#define RFL_INTERNAL_HASFIELDS_HPP_ #define RFL_INTERNAL_HASFIELDS_HPP_
#include <tuple>
#include <type_traits> #include <type_traits>
#include <utility> #include <utility>
#include "../Tuple.hpp" #include "../Tuple.hpp"
#include "all_fields.hpp" //#include "all_fields.hpp"
#include "is_field.hpp" #include "is_field.hpp"
#include "is_flatten_field.hpp" #include "is_flatten_field.hpp"
#include "ptr_tuple_t.hpp" #include "ptr_tuple_t.hpp"
#include "is_named_tuple.hpp"
namespace rfl { namespace rfl {
namespace internal { namespace internal {
@@ -1,7 +1,6 @@
#ifndef RFL_INTERNAL_HASFLATTENFIELDS_HPP_ #ifndef RFL_INTERNAL_HASFLATTENFIELDS_HPP_
#define RFL_INTERNAL_HASFLATTENFIELDS_HPP_ #define RFL_INTERNAL_HASFLATTENFIELDS_HPP_
#include <tuple>
#include <type_traits> #include <type_traits>
#include <utility> #include <utility>
-2
View File
@@ -1,8 +1,6 @@
#ifndef RFL_INTERNAL_HASREFLECTOR_HPP_ #ifndef RFL_INTERNAL_HASREFLECTOR_HPP_
#define RFL_INTERNAL_HASREFLECTOR_HPP_ #define RFL_INTERNAL_HASREFLECTOR_HPP_
#include <type_traits>
namespace rfl { namespace rfl {
template <typename T> template <typename T>
struct Reflector; struct Reflector;
-1
View File
@@ -2,7 +2,6 @@
#define RFL_HASTAGV_HPP_ #define RFL_HASTAGV_HPP_
#include <cstdint> #include <cstdint>
#include <utility>
namespace rfl { namespace rfl {
namespace internal { namespace internal {
@@ -1,11 +1,9 @@
#ifndef RFL_INTERNAL_ISADDTAGSTOVARIANTS_HPP_ #ifndef RFL_INTERNAL_ISADDTAGSTOVARIANTS_HPP_
#define RFL_INTERNAL_ISADDTAGSTOVARIANTS_HPP_ #define RFL_INTERNAL_ISADDTAGSTOVARIANTS_HPP_
#include <tuple>
#include <type_traits> #include <type_traits>
#include <utility>
#include "../AddTagsToVariants.hpp" //#include "../AddTagsToVariants.hpp"
namespace rfl ::internal { namespace rfl ::internal {
@@ -1,9 +1,7 @@
#ifndef RFL_INTERNAL_ISALLOWRAWPTRS_HPP_ #ifndef RFL_INTERNAL_ISALLOWRAWPTRS_HPP_
#define RFL_INTERNAL_ISALLOWRAWPTRS_HPP_ #define RFL_INTERNAL_ISALLOWRAWPTRS_HPP_
#include <tuple>
#include <type_traits> #include <type_traits>
#include <utility>
#include "../AllowRawPtrs.hpp" #include "../AllowRawPtrs.hpp"
-2
View File
@@ -1,9 +1,7 @@
#ifndef RFL_INTERNAL_ISARRAY_HPP_ #ifndef RFL_INTERNAL_ISARRAY_HPP_
#define RFL_INTERNAL_ISARRAY_HPP_ #define RFL_INTERNAL_ISARRAY_HPP_
#include <tuple>
#include <type_traits> #include <type_traits>
#include <utility>
#include "Array.hpp" #include "Array.hpp"
+1 -3
View File
@@ -1,12 +1,10 @@
#ifndef RFL_INTERNAL_ISATTRIBUTE_HPP_ #ifndef RFL_INTERNAL_ISATTRIBUTE_HPP_
#define RFL_INTERNAL_ISATTRIBUTE_HPP_ #define RFL_INTERNAL_ISATTRIBUTE_HPP_
#include <tuple>
#include <type_traits> #include <type_traits>
#include <utility>
#include "../Attribute.hpp" #include "../Attribute.hpp"
#include "../Field.hpp" //#include "../Field.hpp"
#include "remove_rename.hpp" #include "remove_rename.hpp"
namespace rfl { namespace rfl {
@@ -1,11 +1,9 @@
#ifndef RFL_INTERNAL_ISDEFAULTIFMISSING_HPP_ #ifndef RFL_INTERNAL_ISDEFAULTIFMISSING_HPP_
#define RFL_INTERNAL_ISDEFAULTIFMISSING_HPP_ #define RFL_INTERNAL_ISDEFAULTIFMISSING_HPP_
#include <tuple>
#include <type_traits> #include <type_traits>
#include <utility>
#include "../DefaultIfMissing.hpp" //#include "../DefaultIfMissing.hpp"
namespace rfl { namespace rfl {
namespace internal { namespace internal {
-2
View File
@@ -1,9 +1,7 @@
#ifndef RFL_INTERNAL_ISDESCRIPTION_HPP_ #ifndef RFL_INTERNAL_ISDESCRIPTION_HPP_
#define RFL_INTERNAL_ISDESCRIPTION_HPP_ #define RFL_INTERNAL_ISDESCRIPTION_HPP_
#include <tuple>
#include <type_traits> #include <type_traits>
#include <utility>
#include "../Description.hpp" #include "../Description.hpp"
#include "StringLiteral.hpp" #include "StringLiteral.hpp"
-1
View File
@@ -1,7 +1,6 @@
#ifndef RFL_INTERNAL_ISEMPTY_HPP_ #ifndef RFL_INTERNAL_ISEMPTY_HPP_
#define RFL_INTERNAL_ISEMPTY_HPP_ #define RFL_INTERNAL_ISEMPTY_HPP_
#include <tuple>
#include <type_traits> #include <type_traits>
#include "../Tuple.hpp" #include "../Tuple.hpp"
-2
View File
@@ -1,9 +1,7 @@
#ifndef RFL_INTERNAL_ISFIELD_HPP_ #ifndef RFL_INTERNAL_ISFIELD_HPP_
#define RFL_INTERNAL_ISFIELD_HPP_ #define RFL_INTERNAL_ISFIELD_HPP_
#include <tuple>
#include <type_traits> #include <type_traits>
#include <utility>
#include "../Field.hpp" #include "../Field.hpp"
#include "StringLiteral.hpp" #include "StringLiteral.hpp"
@@ -1,9 +1,7 @@
#ifndef RFL_INTERNAL_ISFLATTENFIELD_HPP_ #ifndef RFL_INTERNAL_ISFLATTENFIELD_HPP_
#define RFL_INTERNAL_ISFLATTENFIELD_HPP_ #define RFL_INTERNAL_ISFLATTENFIELD_HPP_
#include <tuple>
#include <type_traits> #include <type_traits>
#include <utility>
#include "../Flatten.hpp" #include "../Flatten.hpp"
@@ -1,9 +1,7 @@
#ifndef RFL_INTERNAL_ISNOEXTRAFIELDS_HPP_ #ifndef RFL_INTERNAL_ISNOEXTRAFIELDS_HPP_
#define RFL_INTERNAL_ISNOEXTRAFIELDS_HPP_ #define RFL_INTERNAL_ISNOEXTRAFIELDS_HPP_
#include <tuple>
#include <type_traits> #include <type_traits>
#include <utility>
#include "../NoExtraFields.hpp" #include "../NoExtraFields.hpp"
+1 -3
View File
@@ -1,11 +1,9 @@
#ifndef RFL_INTERNAL_ISNOFIELDNAMES_HPP_ #ifndef RFL_INTERNAL_ISNOFIELDNAMES_HPP_
#define RFL_INTERNAL_ISNOFIELDNAMES_HPP_ #define RFL_INTERNAL_ISNOFIELDNAMES_HPP_
#include <tuple>
#include <type_traits> #include <type_traits>
#include <utility>
#include "../NoFieldNames.hpp" //#include "../NoFieldNames.hpp"
namespace rfl { namespace rfl {
namespace internal { namespace internal {
@@ -1,9 +1,7 @@
#ifndef RFL_INTERNAL_ISNOOPTIONALS_HPP_ #ifndef RFL_INTERNAL_ISNOOPTIONALS_HPP_
#define RFL_INTERNAL_ISNOOPTIONALS_HPP_ #define RFL_INTERNAL_ISNOOPTIONALS_HPP_
#include <tuple>
#include <type_traits> #include <type_traits>
#include <utility>
#include "../NoOptionals.hpp" #include "../NoOptionals.hpp"
-2
View File
@@ -1,9 +1,7 @@
#ifndef RFL_INTERNAL_ISRENAME_HPP_ #ifndef RFL_INTERNAL_ISRENAME_HPP_
#define RFL_INTERNAL_ISRENAME_HPP_ #define RFL_INTERNAL_ISRENAME_HPP_
#include <tuple>
#include <type_traits> #include <type_traits>
#include <utility>
#include "../Rename.hpp" #include "../Rename.hpp"
#include "StringLiteral.hpp" #include "StringLiteral.hpp"
@@ -1,9 +1,7 @@
#ifndef RFL_INTERNAL_ISUNDERLYINGENUMS_HPP_ #ifndef RFL_INTERNAL_ISUNDERLYINGENUMS_HPP_
#define RFL_INTERNAL_ISUNDERLYINGENUMS_HPP_ #define RFL_INTERNAL_ISUNDERLYINGENUMS_HPP_
#include <tuple>
#include <type_traits> #include <type_traits>
#include <utility>
#include "../UnderlyingEnums.hpp" #include "../UnderlyingEnums.hpp"
@@ -1,8 +1,6 @@
#ifndef RFL_INTERNAL_MOVE_AND_FLATTEN_FIELD_TUPLE_HPP_ #ifndef RFL_INTERNAL_MOVE_AND_FLATTEN_FIELD_TUPLE_HPP_
#define RFL_INTERNAL_MOVE_AND_FLATTEN_FIELD_TUPLE_HPP_ #define RFL_INTERNAL_MOVE_AND_FLATTEN_FIELD_TUPLE_HPP_
#include <tuple>
#include "../Tuple.hpp" #include "../Tuple.hpp"
#include "../tuple_cat.hpp" #include "../tuple_cat.hpp"
#include "is_flatten_field.hpp" #include "is_flatten_field.hpp"
@@ -1,7 +1,6 @@
#ifndef RFL_INTERNAL_MOVE_FIELD_TUPLE_TO_NAMED_TUPLE_HPP_ #ifndef RFL_INTERNAL_MOVE_FIELD_TUPLE_TO_NAMED_TUPLE_HPP_
#define RFL_INTERNAL_MOVE_FIELD_TUPLE_TO_NAMED_TUPLE_HPP_ #define RFL_INTERNAL_MOVE_FIELD_TUPLE_TO_NAMED_TUPLE_HPP_
#include <tuple>
#include <type_traits> #include <type_traits>
#include "../Field.hpp" #include "../Field.hpp"
@@ -1,7 +1,6 @@
#ifndef RFL_MOVE_FROM_NAMED_TUPLE_HPP_ #ifndef RFL_MOVE_FROM_NAMED_TUPLE_HPP_
#define RFL_MOVE_FROM_NAMED_TUPLE_HPP_ #define RFL_MOVE_FROM_NAMED_TUPLE_HPP_
#include <functional>
#include <type_traits> #include <type_traits>
#include "../Tuple.hpp" #include "../Tuple.hpp"
-1
View File
@@ -1,7 +1,6 @@
#ifndef RFL_MOVE_FROM_TUPLE_HPP_ #ifndef RFL_MOVE_FROM_TUPLE_HPP_
#define RFL_MOVE_FROM_TUPLE_HPP_ #define RFL_MOVE_FROM_TUPLE_HPP_
#include <functional>
#include <type_traits> #include <type_traits>
#include "../Tuple.hpp" #include "../Tuple.hpp"

Some files were not shown because too many files have changed in this diff Show More