Skip to content

Commit

Permalink
* serialize_class() now can recv const basic_any&
Browse files Browse the repository at this point in the history
  • Loading branch information
VisualGMQ committed Nov 9, 2023
1 parent f9e4215 commit 67fd4bf
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions include/mirrow/serd/dynamic/backends/tomlplusplus.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ namespace drefl {

namespace internal {
void default_class_serialize_method(toml::node&, std::string_view,
mirrow::drefl::any&);
mirrow::drefl::basic_any&);
void default_container_serialize_method(toml::node&, std::string_view,
mirrow::drefl::any&);
mirrow::drefl::basic_any&);
void default_class_deserialize_method(const toml::node&,
mirrow::drefl::reference_any&);
void default_container_deserialize_method(const toml::node&,
Expand All @@ -32,7 +32,7 @@ void default_container_deserialize_method(const toml::node&,
class serd_method_registry final {
public:
using serial_type = std::function<void(toml::node&, std::string_view name,
mirrow::drefl::any&)>;
mirrow::drefl::basic_any&)>;
using deserial_type =
std::function<void(const toml::node&, mirrow::drefl::reference_any&)>;
using key_type = mirrow::drefl::type_info;
Expand Down Expand Up @@ -103,7 +103,7 @@ class serd_method_registry final {

static void default_numeric_serialize_method(toml::node& node,
std::string_view name,
mirrow::drefl::any& data) {
mirrow::drefl::basic_any& data) {
auto type = data.type();
if (!type.is_fundamental()) {
MIRROW_LOG("can't serialize a non-numeric type");
Expand Down Expand Up @@ -147,7 +147,7 @@ class serd_method_registry final {

static void default_string_serialize_method(toml::node& node,
std::string_view name,
mirrow::drefl::any& data) {
mirrow::drefl::basic_any& data) {
auto type = data.type();
MIRROW_ASSERT(type.is_class() && type.as_class().is_string(),
"can't serialize a non-string type");
Expand Down Expand Up @@ -227,7 +227,7 @@ class serd_method_registry final {
}
};

toml::table serialize_class(mirrow::drefl::any& data);
toml::table serialize_class(mirrow::drefl::basic_any& data);

namespace internal {

Expand Down Expand Up @@ -273,7 +273,7 @@ inline void serialize_one_data(toml::node& node,

inline void default_container_serialize_method(
toml::node& node, [[maybe_unused]] std::string_view name,
mirrow::drefl::any& data) {
mirrow::drefl::basic_any& data) {
auto type = data.type();
MIRROW_ASSERT(
type.is_array() || (type.is_class() && type.as_class().is_container()),
Expand All @@ -289,7 +289,7 @@ inline void default_container_serialize_method(

inline void default_class_serialize_method(
toml::node& node, [[maybe_unused]] std::string_view name,
mirrow::drefl::any& data) {
mirrow::drefl::basic_any& data) {
auto type = data.type();

MIRROW_ASSERT(node.is_table(),
Expand Down Expand Up @@ -378,7 +378,7 @@ inline void default_class_deserialize_method(

} // namespace internal

inline toml::table serialize_class(mirrow::drefl::any& data) {
inline toml::table serialize_class(mirrow::drefl::basic_any& data) {
auto type = data.type();

MIRROW_ASSERT(type.is_class(), "can't serialize non-class type");
Expand Down

0 comments on commit 67fd4bf

Please sign in to comment.