Namespace for conversion utlities and predefined proto-structs conversion hooks for well-known std/userver types.
Classes | |
class | Context |
Read/write operation context. More... | |
class | ContextWithErrors |
Read/write operation context with error information. More... | |
class | ReadContext |
Read operation context passed to user-defined ReadProtoStruct global functions. More... | |
struct | To |
An ADL helper which allows compiler to find functions to read proto structs from protobuf messages. More... | |
class | WriteContext |
Write operation context passed to user-defined WriteProtoStruct global functions. More... | |
Functions | |
template<typename TStructField, typename TMessageField> requires ScalarCompatibleWith<TStructField, TMessageField> | |
TStructField | ReadProtoField (ReadContext &ctx, To< TStructField >, int field_number, const TMessageField &message_field) |
template<typename TStructField, typename TMessageField> requires ScalarCompatibleWith<std::remove_cvref_t<TStructField>, TMessageField> | |
void | WriteProtoField (WriteContext &ctx, TStructField &&struct_field, int field_number, TMessageField &message_field) |
std::chrono::time_point< std::chrono::system_clock > | ReadProtoStruct (ReadContext &ctx, To< std::chrono::time_point< std::chrono::system_clock > >, const ::google::protobuf::Timestamp &msg) |
void | WriteProtoStruct (WriteContext &, const std::chrono::time_point< std::chrono::system_clock > &obj, ::google::protobuf::Timestamp &msg) |
std::chrono::year_month_day | ReadProtoStruct (ReadContext &ctx, To< std::chrono::year_month_day >, const ::google::type::Date &msg) |
void | WriteProtoStruct (WriteContext &ctx, const std::chrono::year_month_day &obj, ::google::type::Date &msg) |
proto_structs::Any | ReadProtoStruct (ReadContext &, To< proto_structs::Any >, const ::google::protobuf::Any &msg) |
void | WriteProtoStruct (WriteContext &, const proto_structs::Any &obj, ::google::protobuf::Any &msg) |
void | WriteProtoStruct (WriteContext &, proto_structs::Any &&obj, ::google::protobuf::Any &msg) |
template<typename TRep, typename TPeriod> | |
std::chrono::duration< TRep, TPeriod > | ReadProtoStruct (ReadContext &ctx, To< std::chrono::duration< TRep, TPeriod > >, const ::google::protobuf::Duration &msg) |
template<typename TRep, typename TPeriod> | |
void | WriteProtoStruct (WriteContext &, const std::chrono::duration< TRep, TPeriod > &obj, ::google::protobuf::Duration &msg) |
template<typename TDuration> | |
std::chrono::hh_mm_ss< TDuration > | ReadProtoStruct (ReadContext &ctx, To< std::chrono::hh_mm_ss< TDuration > >, const ::google::type::TimeOfDay &msg) |
template<typename TDuration> | |
void | WriteProtoStruct (WriteContext &ctx, const std::chrono::hh_mm_ss< TDuration > &obj, ::google::type::TimeOfDay &msg) |
template<typename TKey, typename TValue, typename TCompare, typename TAllocator, typename TProtoKey, typename TProtoValue> | |
std::map< TKey, TValue, TCompare, TAllocator > | ReadProtoField (ReadContext &ctx, To< std::map< TKey, TValue, TCompare, TAllocator > >, int field_number, const ::google::protobuf::Map< TProtoKey, TProtoValue > &message_field) |
template<typename TKey, typename TValue, typename TCompare, typename TAllocator, typename TProtoKey, typename TProtoValue> | |
void | WriteProtoField (WriteContext &ctx, const std::map< TKey, TValue, TCompare, TAllocator > &struct_field, int field_number, ::google::protobuf::Map< TProtoKey, TProtoValue > &message_field) |
template<typename TKey, typename TValue, typename TCompare, typename TAllocator, typename TProtoKey, typename TProtoValue> | |
void | WriteProtoField (WriteContext &ctx, std::map< TKey, TValue, TCompare, TAllocator > &&struct_field, int field_number, ::google::protobuf::Map< TProtoKey, TProtoValue > &message_field) |
template<typename TKey, typename TValue, typename THash, typename TKeyEqual, typename TAllocator, typename TProtoKey, typename TProtoValue> | |
std::unordered_map< TKey, TValue, THash, TKeyEqual, TAllocator > | ReadProtoField (ReadContext &ctx, To< std::unordered_map< TKey, TValue, THash, TKeyEqual, TAllocator > >, int field_number, const ::google::protobuf::Map< TProtoKey, TProtoValue > &message_field) |
template<typename TKey, typename TValue, typename THash, typename TKeyEqual, typename TAllocator, typename TProtoKey, typename TProtoValue> | |
void | WriteProtoField (WriteContext &ctx, const std::unordered_map< TKey, TValue, THash, TKeyEqual, TAllocator > &struct_field, int field_number, ::google::protobuf::Map< TProtoKey, TProtoValue > &message_field) |
template<typename TKey, typename TValue, typename THash, typename TKeyEqual, typename TAllocator, typename TProtoKey, typename TProtoValue> | |
void | WriteProtoField (WriteContext &ctx, std::unordered_map< TKey, TValue, THash, TKeyEqual, TAllocator > &&struct_field, int field_number, ::google::protobuf::Map< TProtoKey, TProtoValue > &message_field) |
template<typename TItem, typename TAllocator, proto_structs::traits::ProtoRepeated TRepeated> | |
std::vector< TItem, TAllocator > | ReadProtoField (ReadContext &ctx, To< std::vector< TItem, TAllocator > >, int field_number, const TRepeated &message_field) |
template<typename TItem, typename TAllocator, proto_structs::traits::ProtoRepeated TRepeated> | |
void | WriteProtoField (WriteContext &ctx, const std::vector< TItem, TAllocator > &struct_field, int field_number, TRepeated &message_field) |
template<typename TItem, typename TAllocator, proto_structs::traits::ProtoRepeated TRepeated> | |
void | WriteProtoField (WriteContext &ctx, std::vector< TItem, TAllocator > &&struct_field, int field_number, TRepeated &message_field) |
template<int Prec, typename TRoundPolicy> | |
decimal64::Decimal< Prec, TRoundPolicy > | ReadProtoStruct (ReadContext &ctx, To< decimal64::Decimal< Prec, TRoundPolicy > >, const ::google::type::Decimal &msg) |
template<int Prec, typename TRoundPolicy> | |
void | WriteProtoStruct (WriteContext &, const decimal64::Decimal< Prec, TRoundPolicy > &obj, ::google::type::Decimal &msg) |
template<typename TField> | |
UnbreakableDependencyCycle | ReadProtoField (ReadContext &, To< UnbreakableDependencyCycle >, int, const TField &) |
template<typename TField> | |
void | WriteProtoField (WriteContext &, const UnbreakableDependencyCycle &, int, TField &) |
template<typename TField> | |
void | WriteProtoField (WriteContext &, UnbreakableDependencyCycle &&, int, TField &) |
template<typename T, proto_structs::traits::ProtoMessage TMessage> | |
utils::Box< T > | ReadProtoStruct (ReadContext &ctx, To< utils::Box< T > >, const TMessage &msg) |
template<typename T, proto_structs::traits::ProtoMessage TMessage> | |
void | WriteProtoStruct (WriteContext &ctx, const utils::Box< T > &obj, TMessage &msg) |
template<typename T, proto_structs::traits::ProtoMessage TMessage> | |
void | WriteProtoStruct (WriteContext &ctx, utils::Box< T > &&obj, TMessage &msg) |
template<typename TStructField, typename TMessageField> | |
utils::Box< TStructField > | ReadProtoField (ReadContext &ctx, To< utils::Box< TStructField > >, int field_number, const TMessageField &message_field) |
template<typename TStructField, typename TMessageField> | |
void | WriteProtoField (WriteContext &ctx, const utils::Box< TStructField > &struct_field, int field_number, TMessageField &message_field) |
template<typename TStructField, typename TMessageField> | |
void | WriteProtoField (WriteContext &ctx, utils::Box< TStructField > &&struct_field, int field_number, TMessageField &message_field) |
template<typename TDuration> | |
utils::datetime::TimeOfDay< TDuration > | ReadProtoStruct (ReadContext &ctx, To< utils::datetime::TimeOfDay< TDuration > >, const ::google::type::TimeOfDay &msg) |
template<typename TDuration> | |
void | WriteProtoStruct (WriteContext &ctx, const utils::datetime::TimeOfDay< TDuration > &obj, ::google::type::TimeOfDay &msg) |
template<typename TTag, typename TStructField, utils::StrongTypedefOps Ops, typename TEnable, typename TMessageField> | |
utils::StrongTypedef< TTag, TStructField, Ops, TEnable > | ReadProtoField (ReadContext &ctx, To< utils::StrongTypedef< TTag, TStructField, Ops, TEnable > >, int field_number, const TMessageField &message_field) |
template<typename TTag, typename TStructField, utils::StrongTypedefOps Ops, typename TEnable, typename TMessageField> | |
void | WriteProtoField (WriteContext &ctx, const utils::StrongTypedef< TTag, TStructField, Ops, TEnable > &struct_field, int field_number, TMessageField &message_field) |
template<typename TTag, typename TStructField, utils::StrongTypedefOps Ops, typename TEnable, typename TMessageField> | |
void | WriteProtoField (WriteContext &ctx, utils::StrongTypedef< TTag, TStructField, Ops, TEnable > &&struct_field, int field_number, TMessageField &message_field) |
Variables | |
constexpr int | kMaxYearInGoogleDate = 9999 |
constexpr int | kMinYearInGoogleDate = 1 |
UnbreakableDependencyCycle proto_structs::io::ReadProtoField | ( | ReadContext & | , |
To< UnbreakableDependencyCycle > | , | ||
int | , | ||
const TField & | ) |
Definition at line 16 of file unbreakable_dependency_cycle_conv.hpp.
std::map< TKey, TValue, TCompare, TAllocator > proto_structs::io::ReadProtoField | ( | ReadContext & | ctx, |
To< std::map< TKey, TValue, TCompare, TAllocator > > | , | ||
int | field_number, | ||
const ::google::protobuf::Map< TProtoKey, TProtoValue > & | message_field ) |
Definition at line 21 of file map_conv.hpp.
std::unordered_map< TKey, TValue, THash, TKeyEqual, TAllocator > proto_structs::io::ReadProtoField | ( | ReadContext & | ctx, |
To< std::unordered_map< TKey, TValue, THash, TKeyEqual, TAllocator > > | , | ||
int | field_number, | ||
const ::google::protobuf::Map< TProtoKey, TProtoValue > & | message_field ) |
Definition at line 22 of file unordered_map_conv.hpp.
std::vector< TItem, TAllocator > proto_structs::io::ReadProtoField | ( | ReadContext & | ctx, |
To< std::vector< TItem, TAllocator > > | , | ||
int | field_number, | ||
const TRepeated & | message_field ) |
Definition at line 38 of file vector_conv.hpp.
TStructField proto_structs::io::ReadProtoField | ( | ReadContext & | ctx, |
To< TStructField > | , | ||
int | field_number, | ||
const TMessageField & | message_field ) |
Definition at line 221 of file context.hpp.
utils::Box< TStructField > proto_structs::io::ReadProtoField | ( | ReadContext & | ctx, |
To< utils::Box< TStructField > > | , | ||
int | field_number, | ||
const TMessageField & | message_field ) |
Definition at line 31 of file box_conv.hpp.
utils::StrongTypedef< TTag, TStructField, Ops, TEnable > proto_structs::io::ReadProtoField | ( | ReadContext & | ctx, |
To< utils::StrongTypedef< TTag, TStructField, Ops, TEnable > > | , | ||
int | field_number, | ||
const TMessageField & | message_field ) |
Definition at line 13 of file strong_typedef_conv.hpp.
proto_structs::Any proto_structs::io::ReadProtoStruct | ( | ReadContext & | , |
To< proto_structs::Any > | , | ||
const ::google::protobuf::Any & | msg ) |
decimal64::Decimal< Prec, TRoundPolicy > proto_structs::io::ReadProtoStruct | ( | ReadContext & | ctx, |
To< decimal64::Decimal< Prec, TRoundPolicy > > | , | ||
const ::google::type::Decimal & | msg ) |
Definition at line 18 of file decimal_conv.hpp.
std::chrono::duration< TRep, TPeriod > proto_structs::io::ReadProtoStruct | ( | ReadContext & | ctx, |
To< std::chrono::duration< TRep, TPeriod > > | , | ||
const ::google::protobuf::Duration & | msg ) |
Definition at line 20 of file duration_conv.hpp.
std::chrono::hh_mm_ss< TDuration > proto_structs::io::ReadProtoStruct | ( | ReadContext & | ctx, |
To< std::chrono::hh_mm_ss< TDuration > > | , | ||
const ::google::type::TimeOfDay & | msg ) |
Definition at line 21 of file hh_mm_ss_conv.hpp.
std::chrono::time_point< std::chrono::system_clock > proto_structs::io::ReadProtoStruct | ( | ReadContext & | ctx, |
To< std::chrono::time_point< std::chrono::system_clock > > | , | ||
const ::google::protobuf::Timestamp & | msg ) |
Definition at line 11 of file time_point.cpp.
std::chrono::year_month_day proto_structs::io::ReadProtoStruct | ( | ReadContext & | ctx, |
To< std::chrono::year_month_day > | , | ||
const ::google::type::Date & | msg ) |
Definition at line 16 of file year_month_day.cpp.
utils::Box< T > proto_structs::io::ReadProtoStruct | ( | ReadContext & | ctx, |
To< utils::Box< T > > | , | ||
const TMessage & | msg ) |
Definition at line 15 of file box_conv.hpp.
utils::datetime::TimeOfDay< TDuration > proto_structs::io::ReadProtoStruct | ( | ReadContext & | ctx, |
To< utils::datetime::TimeOfDay< TDuration > > | , | ||
const ::google::type::TimeOfDay & | msg ) |
Definition at line 16 of file time_of_day_conv.hpp.
void proto_structs::io::WriteProtoField | ( | WriteContext & | , |
const UnbreakableDependencyCycle & | , | ||
int | , | ||
TField & | ) |
Definition at line 26 of file unbreakable_dependency_cycle_conv.hpp.
void proto_structs::io::WriteProtoField | ( | WriteContext & | , |
UnbreakableDependencyCycle && | , | ||
int | , | ||
TField & | ) |
Definition at line 34 of file unbreakable_dependency_cycle_conv.hpp.
void proto_structs::io::WriteProtoField | ( | WriteContext & | ctx, |
const std::map< TKey, TValue, TCompare, TAllocator > & | struct_field, | ||
int | field_number, | ||
::google::protobuf::Map< TProtoKey, TProtoValue > & | message_field ) |
Definition at line 37 of file map_conv.hpp.
void proto_structs::io::WriteProtoField | ( | WriteContext & | ctx, |
const std::unordered_map< TKey, TValue, THash, TKeyEqual, TAllocator > & | struct_field, | ||
int | field_number, | ||
::google::protobuf::Map< TProtoKey, TProtoValue > & | message_field ) |
Definition at line 41 of file unordered_map_conv.hpp.
void proto_structs::io::WriteProtoField | ( | WriteContext & | ctx, |
const std::vector< TItem, TAllocator > & | struct_field, | ||
int | field_number, | ||
TRepeated & | message_field ) |
Definition at line 50 of file vector_conv.hpp.
void proto_structs::io::WriteProtoField | ( | WriteContext & | ctx, |
const utils::Box< TStructField > & | struct_field, | ||
int | field_number, | ||
TMessageField & | message_field ) |
Definition at line 36 of file box_conv.hpp.
void proto_structs::io::WriteProtoField | ( | WriteContext & | ctx, |
const utils::StrongTypedef< TTag, TStructField, Ops, TEnable > & | struct_field, | ||
int | field_number, | ||
TMessageField & | message_field ) |
Definition at line 24 of file strong_typedef_conv.hpp.
void proto_structs::io::WriteProtoField | ( | WriteContext & | ctx, |
std::map< TKey, TValue, TCompare, TAllocator > && | struct_field, | ||
int | field_number, | ||
::google::protobuf::Map< TProtoKey, TProtoValue > & | message_field ) |
Definition at line 53 of file map_conv.hpp.
void proto_structs::io::WriteProtoField | ( | WriteContext & | ctx, |
std::unordered_map< TKey, TValue, THash, TKeyEqual, TAllocator > && | struct_field, | ||
int | field_number, | ||
::google::protobuf::Map< TProtoKey, TProtoValue > & | message_field ) |
Definition at line 58 of file unordered_map_conv.hpp.
void proto_structs::io::WriteProtoField | ( | WriteContext & | ctx, |
std::vector< TItem, TAllocator > && | struct_field, | ||
int | field_number, | ||
TRepeated & | message_field ) |
Definition at line 60 of file vector_conv.hpp.
void proto_structs::io::WriteProtoField | ( | WriteContext & | ctx, |
TStructField && | struct_field, | ||
int | field_number, | ||
TMessageField & | message_field ) |
Definition at line 237 of file context.hpp.
void proto_structs::io::WriteProtoField | ( | WriteContext & | ctx, |
utils::Box< TStructField > && | struct_field, | ||
int | field_number, | ||
TMessageField & | message_field ) |
Definition at line 46 of file box_conv.hpp.
void proto_structs::io::WriteProtoField | ( | WriteContext & | ctx, |
utils::StrongTypedef< TTag, TStructField, Ops, TEnable > && | struct_field, | ||
int | field_number, | ||
TMessageField & | message_field ) |
Definition at line 34 of file strong_typedef_conv.hpp.
void proto_structs::io::WriteProtoStruct | ( | WriteContext & | , |
const decimal64::Decimal< Prec, TRoundPolicy > & | obj, | ||
::google::type::Decimal & | msg ) |
Definition at line 37 of file decimal_conv.hpp.
void proto_structs::io::WriteProtoStruct | ( | WriteContext & | , |
const proto_structs::Any & | obj, | ||
::google::protobuf::Any & | msg ) |
void proto_structs::io::WriteProtoStruct | ( | WriteContext & | , |
const std::chrono::duration< TRep, TPeriod > & | obj, | ||
::google::protobuf::Duration & | msg ) |
Definition at line 47 of file duration_conv.hpp.
void proto_structs::io::WriteProtoStruct | ( | WriteContext & | , |
const std::chrono::time_point< std::chrono::system_clock > & | obj, | ||
::google::protobuf::Timestamp & | msg ) |
Definition at line 41 of file time_point.cpp.
void proto_structs::io::WriteProtoStruct | ( | WriteContext & | , |
proto_structs::Any && | obj, | ||
::google::protobuf::Any & | msg ) |
void proto_structs::io::WriteProtoStruct | ( | WriteContext & | ctx, |
const std::chrono::hh_mm_ss< TDuration > & | obj, | ||
::google::type::TimeOfDay & | msg ) |
Definition at line 49 of file hh_mm_ss_conv.hpp.
void proto_structs::io::WriteProtoStruct | ( | WriteContext & | ctx, |
const std::chrono::year_month_day & | obj, | ||
::google::type::Date & | msg ) |
Definition at line 43 of file year_month_day.cpp.
void proto_structs::io::WriteProtoStruct | ( | WriteContext & | ctx, |
const utils::Box< T > & | obj, | ||
TMessage & | msg ) |
Definition at line 20 of file box_conv.hpp.
void proto_structs::io::WriteProtoStruct | ( | WriteContext & | ctx, |
const utils::datetime::TimeOfDay< TDuration > & | obj, | ||
::google::type::TimeOfDay & | msg ) |
Definition at line 22 of file time_of_day_conv.hpp.
void proto_structs::io::WriteProtoStruct | ( | WriteContext & | ctx, |
utils::Box< T > && | obj, | ||
TMessage & | msg ) |
Definition at line 25 of file box_conv.hpp.
|
constexpr |
Definition at line 12 of file year_month_day.cpp.
|
constexpr |
Definition at line 13 of file year_month_day.cpp.