diff --git a/fbe/user_model/bank_dom.cpp b/fbe/user_model/bank_dom.cpp index d4e60c0..2b5541a 100644 --- a/fbe/user_model/bank_dom.cpp +++ b/fbe/user_model/bank_dom.cpp @@ -1,22 +1,24 @@ +//------------------------------------------------------------------------------ // Automatically generated by the Fast Binary Encoding compiler, do not modify! // https://github.com/chronoxor/FastBinaryEncoding // Source: user_model.fbe -// Version: 1.7.0.0 +// FBE version: 1.14.1.0 +//------------------------------------------------------------------------------ #include "bank_dom.h" namespace bank_dom { Transaction::Transaction() - : from("") - , to("") + : counterparty("") + , receiving(false) , amount((uint32_t)0ull) , time((uint64_t)0ull) {} -Transaction::Transaction(const std::string& arg_from, const std::string& arg_to, uint32_t arg_amount, uint64_t arg_time) - : from(arg_from) - , to(arg_to) +Transaction::Transaction(const std::string& arg_counterparty, bool arg_receiving, uint32_t arg_amount, uint64_t arg_time) + : counterparty(arg_counterparty) + , receiving(arg_receiving) , amount(arg_amount) , time(arg_time) {} @@ -36,8 +38,8 @@ bool Transaction::operator<(const Transaction& other) const noexcept void Transaction::swap(Transaction& other) noexcept { using std::swap; - swap(from, other.from); - swap(to, other.to); + swap(counterparty, other.counterparty); + swap(receiving, other.receiving); swap(amount, other.amount); swap(time, other.time); } @@ -45,8 +47,8 @@ void Transaction::swap(Transaction& other) noexcept std::ostream& operator<<(std::ostream& stream, const Transaction& value) { stream << "Transaction("; - stream << "from="; stream << "\"" << value.from << "\""; - stream << ",to="; stream << "\"" << value.to << "\""; + stream << "counterparty="; stream << "\"" << value.counterparty << "\""; + stream << ",receiving="; stream << (value.receiving ? "true" : "false"); stream << ",amount="; stream << value.amount; stream << ",time="; stream << value.time; stream << ")"; diff --git a/fbe/user_model/bank_dom.h b/fbe/user_model/bank_dom.h index 04f8375..75014ef 100644 --- a/fbe/user_model/bank_dom.h +++ b/fbe/user_model/bank_dom.h @@ -1,7 +1,9 @@ +//------------------------------------------------------------------------------ // Automatically generated by the Fast Binary Encoding compiler, do not modify! // https://github.com/chronoxor/FastBinaryEncoding // Source: user_model.fbe -// Version: 1.7.0.0 +// FBE version: 1.14.1.0 +//------------------------------------------------------------------------------ #pragma once @@ -27,15 +29,15 @@ namespace bank_dom { struct Transaction { - std::string from; - std::string to; + std::string counterparty; + bool receiving; uint32_t amount; uint64_t time; size_t fbe_type() const noexcept { return 1; } Transaction(); - Transaction(const std::string& arg_from, const std::string& arg_to, uint32_t arg_amount, uint64_t arg_time); + Transaction(const std::string& arg_counterparty, bool arg_receiving, uint32_t arg_amount, uint64_t arg_time); Transaction(const Transaction& other) = default; Transaction(Transaction&& other) = default; ~Transaction() = default; @@ -60,10 +62,12 @@ struct Transaction } // namespace bank_dom -namespace std { +#if defined(FMT_VERSION) && (FMT_VERSION >= 90000) +template <> struct fmt::formatter : ostream_formatter {}; +#endif template<> -struct hash +struct std::hash { typedef bank_dom::Transaction argument_type; typedef size_t result_type; @@ -75,8 +79,6 @@ struct hash } }; -} // namespace std - namespace bank_dom { struct Logs @@ -111,10 +113,12 @@ struct Logs } // namespace bank_dom -namespace std { +#if defined(FMT_VERSION) && (FMT_VERSION >= 90000) +template <> struct fmt::formatter : ostream_formatter {}; +#endif template<> -struct hash +struct std::hash { typedef bank_dom::Logs argument_type; typedef size_t result_type; @@ -126,8 +130,6 @@ struct hash } }; -} // namespace std - namespace bank_dom { struct User @@ -164,10 +166,12 @@ struct User } // namespace bank_dom -namespace std { +#if defined(FMT_VERSION) && (FMT_VERSION >= 90000) +template <> struct fmt::formatter : ostream_formatter {}; +#endif template<> -struct hash +struct std::hash { typedef bank_dom::User argument_type; typedef size_t result_type; @@ -179,8 +183,6 @@ struct hash } }; -} // namespace std - namespace bank_dom { struct Global @@ -216,10 +218,12 @@ struct Global } // namespace bank_dom -namespace std { +#if defined(FMT_VERSION) && (FMT_VERSION >= 90000) +template <> struct fmt::formatter : ostream_formatter {}; +#endif template<> -struct hash +struct std::hash { typedef bank_dom::Global argument_type; typedef size_t result_type; @@ -231,8 +235,6 @@ struct hash } }; -} // namespace std - namespace bank_dom { } // namespace bank_dom diff --git a/fbe/user_model/bank_dom_final_models.cpp b/fbe/user_model/bank_dom_final_models.cpp index cc15906..41ac0bb 100644 --- a/fbe/user_model/bank_dom_final_models.cpp +++ b/fbe/user_model/bank_dom_final_models.cpp @@ -1,15 +1,17 @@ +//------------------------------------------------------------------------------ // Automatically generated by the Fast Binary Encoding compiler, do not modify! // https://github.com/chronoxor/FastBinaryEncoding // Source: user_model.fbe -// Version: 1.7.0.0 +// FBE version: 1.14.1.0 +//------------------------------------------------------------------------------ #include "bank_dom_final_models.h" namespace FBE { FinalModel<::bank_dom::Transaction>::FinalModel(FBEBuffer& buffer, size_t offset) noexcept : _buffer(buffer), _offset(offset) - , from(buffer, 0) - , to(buffer, 0) + , counterparty(buffer, 0) + , receiving(buffer, 0) , amount(buffer, 0) , time(buffer, 0) {} @@ -17,8 +19,8 @@ FinalModel<::bank_dom::Transaction>::FinalModel(FBEBuffer& buffer, size_t offset size_t FinalModel<::bank_dom::Transaction>::fbe_allocation_size(const ::bank_dom::Transaction& fbe_value) const noexcept { size_t fbe_result = 0 - + from.fbe_allocation_size(fbe_value.from) - + to.fbe_allocation_size(fbe_value.to) + + counterparty.fbe_allocation_size(fbe_value.counterparty) + + receiving.fbe_allocation_size(fbe_value.receiving) + amount.fbe_allocation_size(fbe_value.amount) + time.fbe_allocation_size(fbe_value.time) ; @@ -38,14 +40,14 @@ size_t FinalModel<::bank_dom::Transaction>::verify_fields() const noexcept size_t fbe_current_offset = 0; size_t fbe_field_size; - from.fbe_offset(fbe_current_offset); - fbe_field_size = from.verify(); + counterparty.fbe_offset(fbe_current_offset); + fbe_field_size = counterparty.verify(); if (fbe_field_size == std::numeric_limits::max()) return std::numeric_limits::max(); fbe_current_offset += fbe_field_size; - to.fbe_offset(fbe_current_offset); - fbe_field_size = to.verify(); + receiving.fbe_offset(fbe_current_offset); + fbe_field_size = receiving.verify(); if (fbe_field_size == std::numeric_limits::max()) return std::numeric_limits::max(); fbe_current_offset += fbe_field_size; @@ -79,13 +81,13 @@ size_t FinalModel<::bank_dom::Transaction>::get_fields(::bank_dom::Transaction& size_t fbe_current_size = 0; size_t fbe_field_size; - from.fbe_offset(fbe_current_offset); - fbe_field_size = from.get(fbe_value.from); + counterparty.fbe_offset(fbe_current_offset); + fbe_field_size = counterparty.get(fbe_value.counterparty); fbe_current_offset += fbe_field_size; fbe_current_size += fbe_field_size; - to.fbe_offset(fbe_current_offset); - fbe_field_size = to.get(fbe_value.to); + receiving.fbe_offset(fbe_current_offset); + fbe_field_size = receiving.get(fbe_value.receiving); fbe_current_offset += fbe_field_size; fbe_current_size += fbe_field_size; @@ -116,13 +118,13 @@ size_t FinalModel<::bank_dom::Transaction>::set_fields(const ::bank_dom::Transac size_t fbe_current_size = 0; size_t fbe_field_size; - from.fbe_offset(fbe_current_offset); - fbe_field_size = from.set(fbe_value.from); + counterparty.fbe_offset(fbe_current_offset); + fbe_field_size = counterparty.set(fbe_value.counterparty); fbe_current_offset += fbe_field_size; fbe_current_size += fbe_field_size; - to.fbe_offset(fbe_current_offset); - fbe_field_size = to.set(fbe_value.to); + receiving.fbe_offset(fbe_current_offset); + fbe_field_size = receiving.set(fbe_value.receiving); fbe_current_offset += fbe_field_size; fbe_current_size += fbe_field_size; diff --git a/fbe/user_model/bank_dom_final_models.h b/fbe/user_model/bank_dom_final_models.h index 335df6f..089d0f1 100644 --- a/fbe/user_model/bank_dom_final_models.h +++ b/fbe/user_model/bank_dom_final_models.h @@ -1,7 +1,9 @@ +//------------------------------------------------------------------------------ // Automatically generated by the Fast Binary Encoding compiler, do not modify! // https://github.com/chronoxor/FastBinaryEncoding // Source: user_model.fbe -// Version: 1.7.0.0 +// FBE version: 1.14.1.0 +//------------------------------------------------------------------------------ #pragma once @@ -60,8 +62,8 @@ private: mutable size_t _offset; public: - FinalModel from; - FinalModel to; + FinalModel counterparty; + FinalModel receiving; FinalModel amount; FinalModel time; }; diff --git a/fbe/user_model/bank_dom_models.cpp b/fbe/user_model/bank_dom_models.cpp index 9d18299..c62f767 100644 --- a/fbe/user_model/bank_dom_models.cpp +++ b/fbe/user_model/bank_dom_models.cpp @@ -1,24 +1,26 @@ +//------------------------------------------------------------------------------ // Automatically generated by the Fast Binary Encoding compiler, do not modify! // https://github.com/chronoxor/FastBinaryEncoding // Source: user_model.fbe -// Version: 1.7.0.0 +// FBE version: 1.14.1.0 +//------------------------------------------------------------------------------ #include "bank_dom_models.h" namespace FBE { FieldModel<::bank_dom::Transaction>::FieldModel(FBEBuffer& buffer, size_t offset) noexcept : _buffer(buffer), _offset(offset) - , from(buffer, 4 + 4) - , to(buffer, from.fbe_offset() + from.fbe_size()) - , amount(buffer, to.fbe_offset() + to.fbe_size()) + , counterparty(buffer, 4 + 4) + , receiving(buffer, counterparty.fbe_offset() + counterparty.fbe_size()) + , amount(buffer, receiving.fbe_offset() + receiving.fbe_size()) , time(buffer, amount.fbe_offset() + amount.fbe_size()) {} size_t FieldModel<::bank_dom::Transaction>::fbe_body() const noexcept { size_t fbe_result = 4 + 4 - + from.fbe_size() - + to.fbe_size() + + counterparty.fbe_size() + + receiving.fbe_size() + amount.fbe_size() + time.fbe_size() ; @@ -37,8 +39,8 @@ size_t FieldModel<::bank_dom::Transaction>::fbe_extra() const noexcept _buffer.shift(fbe_struct_offset); size_t fbe_result = fbe_body() - + from.fbe_extra() - + to.fbe_extra() + + counterparty.fbe_extra() + + receiving.fbe_extra() + amount.fbe_extra() + time.fbe_extra() ; @@ -75,17 +77,17 @@ bool FieldModel<::bank_dom::Transaction>::verify_fields(size_t fbe_struct_size) { size_t fbe_current_size = 4 + 4; - if ((fbe_current_size + from.fbe_size()) > fbe_struct_size) + if ((fbe_current_size + counterparty.fbe_size()) > fbe_struct_size) return true; - if (!from.verify()) + if (!counterparty.verify()) return false; - fbe_current_size += from.fbe_size(); + fbe_current_size += counterparty.fbe_size(); - if ((fbe_current_size + to.fbe_size()) > fbe_struct_size) + if ((fbe_current_size + receiving.fbe_size()) > fbe_struct_size) return true; - if (!to.verify()) + if (!receiving.verify()) return false; - fbe_current_size += to.fbe_size(); + fbe_current_size += receiving.fbe_size(); if ((fbe_current_size + amount.fbe_size()) > fbe_struct_size) return true; @@ -141,17 +143,17 @@ void FieldModel<::bank_dom::Transaction>::get_fields(::bank_dom::Transaction& fb { size_t fbe_current_size = 4 + 4; - if ((fbe_current_size + from.fbe_size()) <= fbe_struct_size) - from.get(fbe_value.from, ""); + if ((fbe_current_size + counterparty.fbe_size()) <= fbe_struct_size) + counterparty.get(fbe_value.counterparty, ""); else - fbe_value.from = ""; - fbe_current_size += from.fbe_size(); + fbe_value.counterparty = ""; + fbe_current_size += counterparty.fbe_size(); - if ((fbe_current_size + to.fbe_size()) <= fbe_struct_size) - to.get(fbe_value.to, ""); + if ((fbe_current_size + receiving.fbe_size()) <= fbe_struct_size) + receiving.get(fbe_value.receiving, false); else - fbe_value.to = ""; - fbe_current_size += to.fbe_size(); + fbe_value.receiving = false; + fbe_current_size += receiving.fbe_size(); if ((fbe_current_size + amount.fbe_size()) <= fbe_struct_size) amount.get(fbe_value.amount, (uint32_t)0ull); @@ -203,8 +205,8 @@ void FieldModel<::bank_dom::Transaction>::set(const ::bank_dom::Transaction& fbe void FieldModel<::bank_dom::Transaction>::set_fields(const ::bank_dom::Transaction& fbe_value) noexcept { - from.set(fbe_value.from); - to.set(fbe_value.to); + counterparty.set(fbe_value.counterparty); + receiving.set(fbe_value.receiving); amount.set(fbe_value.amount); time.set(fbe_value.time); } diff --git a/fbe/user_model/bank_dom_models.h b/fbe/user_model/bank_dom_models.h index 311a1a1..c98f52b 100644 --- a/fbe/user_model/bank_dom_models.h +++ b/fbe/user_model/bank_dom_models.h @@ -1,7 +1,9 @@ +//------------------------------------------------------------------------------ // Automatically generated by the Fast Binary Encoding compiler, do not modify! // https://github.com/chronoxor/FastBinaryEncoding // Source: user_model.fbe -// Version: 1.7.0.0 +// FBE version: 1.14.1.0 +//------------------------------------------------------------------------------ #pragma once @@ -72,8 +74,8 @@ private: size_t _offset; public: - FieldModel from; - FieldModel to; + FieldModel counterparty; + FieldModel receiving; FieldModel amount; FieldModel time; }; diff --git a/fbe/user_model/fbe.cpp b/fbe/user_model/fbe.cpp index 59d516a..c11db02 100644 --- a/fbe/user_model/fbe.cpp +++ b/fbe/user_model/fbe.cpp @@ -1,10 +1,24 @@ +//------------------------------------------------------------------------------ // Automatically generated by the Fast Binary Encoding compiler, do not modify! // https://github.com/chronoxor/FastBinaryEncoding // Source: FBE -// Version: 1.7.0.0 +// FBE version: 1.14.1.0 +//------------------------------------------------------------------------------ #include "fbe.h" +#if defined(_WIN32) || defined(_WIN64) +#include +#include +#undef DELETE +#undef ERROR +#undef HOST_NOT_FOUND +#undef Yield +#undef min +#undef max +#undef uuid_t +#endif + namespace FBE { std::string buffer_t::base64encode() const diff --git a/fbe/user_model/fbe.h b/fbe/user_model/fbe.h index b6d11be..46384d3 100644 --- a/fbe/user_model/fbe.h +++ b/fbe/user_model/fbe.h @@ -1,7 +1,9 @@ +//------------------------------------------------------------------------------ // Automatically generated by the Fast Binary Encoding compiler, do not modify! // https://github.com/chronoxor/FastBinaryEncoding // Source: FBE -// Version: 1.7.0.0 +// FBE version: 1.14.1.0 +//------------------------------------------------------------------------------ #pragma once @@ -41,7 +43,6 @@ #include #undef HOST_NOT_FOUND #elif defined(_WIN32) || defined(_WIN64) -#include #undef DELETE #undef ERROR #undef HOST_NOT_FOUND @@ -321,10 +322,20 @@ private: } // namespace FBE -namespace std { +#if defined(FMT_VERSION) && (FMT_VERSION >= 90000) +template <> +struct fmt::formatter : formatter +{ + template + auto format(const FBE::decimal_t& value, FormatContext& ctx) const + { + return formatter::format((double)value, ctx); + } +}; +#endif template <> -struct hash +struct std::hash { typedef FBE::decimal_t argument_type; typedef size_t result_type; @@ -337,8 +348,6 @@ struct hash } }; -} // namespace std - namespace FBE { // Register a new enum-based flags macro @@ -530,10 +539,20 @@ private: } // namespace FBE -namespace std { +#if defined(FMT_VERSION) && (FMT_VERSION >= 90000) +template <> +struct fmt::formatter : formatter +{ + template + auto format(const FBE::uuid_t& value, FormatContext& ctx) const + { + return formatter::format(value.string(), ctx); + } +}; +#endif template <> -struct hash +struct std::hash { typedef FBE::uuid_t argument_type; typedef size_t result_type; @@ -548,8 +567,6 @@ struct hash } }; -} // namespace std - namespace FBE { // Fast Binary Encoding buffer based on the dynamic byte buffer diff --git a/fbe/user_model/fbe_final_models.cpp b/fbe/user_model/fbe_final_models.cpp index 27902f8..3e90925 100644 --- a/fbe/user_model/fbe_final_models.cpp +++ b/fbe/user_model/fbe_final_models.cpp @@ -1,7 +1,9 @@ +//------------------------------------------------------------------------------ // Automatically generated by the Fast Binary Encoding compiler, do not modify! // https://github.com/chronoxor/FastBinaryEncoding // Source: FBE -// Version: 1.7.0.0 +// FBE version: 1.14.1.0 +//------------------------------------------------------------------------------ #include "fbe_final_models.h" diff --git a/fbe/user_model/fbe_final_models.h b/fbe/user_model/fbe_final_models.h index f032be0..4c0457f 100644 --- a/fbe/user_model/fbe_final_models.h +++ b/fbe/user_model/fbe_final_models.h @@ -1,7 +1,9 @@ +//------------------------------------------------------------------------------ // Automatically generated by the Fast Binary Encoding compiler, do not modify! // https://github.com/chronoxor/FastBinaryEncoding // Source: FBE -// Version: 1.7.0.0 +// FBE version: 1.14.1.0 +//------------------------------------------------------------------------------ #pragma once diff --git a/fbe/user_model/fbe_final_models.inl b/fbe/user_model/fbe_final_models.inl index d3035a8..0ef2274 100644 --- a/fbe/user_model/fbe_final_models.inl +++ b/fbe/user_model/fbe_final_models.inl @@ -1,7 +1,9 @@ +//------------------------------------------------------------------------------ // Automatically generated by the Fast Binary Encoding compiler, do not modify! // https://github.com/chronoxor/FastBinaryEncoding // Source: FBE -// Version: 1.7.0.0 +// FBE version: 1.14.1.0 +//------------------------------------------------------------------------------ namespace FBE { @@ -536,8 +538,8 @@ inline size_t FinalModelMap::get(std::map& values) c FinalModel fbe_model_value(_buffer, fbe_offset() + 4); for (size_t i = fbe_map_size; i-- > 0;) { - TKey key; - TValue value; + TKey key = TKey(); + TValue value = TValue(); size_t offset_key = fbe_model_key.get(key); fbe_model_key.fbe_shift(offset_key); fbe_model_value.fbe_shift(offset_key); @@ -568,8 +570,8 @@ inline size_t FinalModelMap::get(std::unordered_map& FinalModel fbe_model_value(_buffer, fbe_offset() + 4); for (size_t i = fbe_map_size; i-- > 0;) { - TKey key; - TValue value; + TKey key = TKey(); + TValue value = TValue(); size_t offset_key = fbe_model_key.get(key); fbe_model_key.fbe_shift(offset_key); fbe_model_value.fbe_shift(offset_key); diff --git a/fbe/user_model/fbe_models.cpp b/fbe/user_model/fbe_models.cpp index dd4ecb9..949f484 100644 --- a/fbe/user_model/fbe_models.cpp +++ b/fbe/user_model/fbe_models.cpp @@ -1,7 +1,9 @@ +//------------------------------------------------------------------------------ // Automatically generated by the Fast Binary Encoding compiler, do not modify! // https://github.com/chronoxor/FastBinaryEncoding // Source: FBE -// Version: 1.7.0.0 +// FBE version: 1.14.1.0 +//------------------------------------------------------------------------------ #include "fbe_models.h" diff --git a/fbe/user_model/fbe_models.h b/fbe/user_model/fbe_models.h index 9326a5d..968f789 100644 --- a/fbe/user_model/fbe_models.h +++ b/fbe/user_model/fbe_models.h @@ -1,7 +1,9 @@ +//------------------------------------------------------------------------------ // Automatically generated by the Fast Binary Encoding compiler, do not modify! // https://github.com/chronoxor/FastBinaryEncoding // Source: FBE -// Version: 1.7.0.0 +// FBE version: 1.14.1.0 +//------------------------------------------------------------------------------ #pragma once diff --git a/fbe/user_model/fbe_models.inl b/fbe/user_model/fbe_models.inl index 1ddba97..d3b671e 100644 --- a/fbe/user_model/fbe_models.inl +++ b/fbe/user_model/fbe_models.inl @@ -1,7 +1,9 @@ +//------------------------------------------------------------------------------ // Automatically generated by the Fast Binary Encoding compiler, do not modify! // https://github.com/chronoxor/FastBinaryEncoding // Source: FBE -// Version: 1.7.0.0 +// FBE version: 1.14.1.0 +//------------------------------------------------------------------------------ namespace FBE { @@ -618,8 +620,8 @@ inline void FieldModelMap::get(std::map& values) con auto fbe_model = (*this)[0]; for (size_t i = fbe_map_size; i-- > 0;) { - TKey key; - TValue value; + TKey key = TKey(); + TValue value = TValue(); fbe_model.first.get(key); fbe_model.second.get(value); values.emplace(key, value); @@ -640,8 +642,8 @@ inline void FieldModelMap::get(std::unordered_map& v auto fbe_model = (*this)[0]; for (size_t i = fbe_map_size; i-- > 0;) { - TKey key; - TValue value; + TKey key = TKey(); + TValue value = TValue(); fbe_model.first.get(key); fbe_model.second.get(value); values.emplace(key, value);