Top namespace for the proto-structs library.
|
| template<traits::ProtoMessage TMessage, traits::ProtoStruct TStruct> |
| void | MessageToStruct (const TMessage &msg, TStruct &obj) |
| | Converts protobuf message msg to struct obj.
|
| |
| template<traits::ProtoStruct TStruct, traits::ProtoMessage TMessage> |
| TStruct | MessageToStruct (const TMessage &msg) |
| | Converts protobuf message msg to specified structure type.
|
| |
template<typename TStruct, traits::ProtoMessage TMessage>
requires traits::ProtoStruct<std::remove_cvref_t<TStruct>> |
| void | StructToMessage (TStruct &&obj, TMessage &msg) |
| | Converts struct instance obj to protobuf message msg.
|
| |
template<traits::ProtoMessage TMessage, typename TStruct>
requires traits::ProtoStruct<std::remove_cvref_t<TStruct>> |
| TMessage | StructToMessage (TStruct &&obj) |
| | Converts struct instance obj to protobuf message msg of the specified type.
|
| |
template<typename TStruct>
requires traits::CompatibleStruct<std::remove_cvref_t<TStruct>> |
| traits::CompatibleMessageType< std::remove_cvref_t< TStruct > > | StructToMessage (TStruct &&obj) |
| | Converts struct instance obj to it's compatible protobuf message.
|
| |
template<traits::ProtoStruct TStruct, traits::ProtoMessage TMessage>
| TStruct proto_structs::MessageToStruct |
( |
const TMessage & | msg | ) |
|
|
nodiscard |
Converts protobuf message msg to specified structure type.
- Template Parameters
-
| TStruct | struct type |
| TMessage | protobuf message type |
- Exceptions
-
Function calls ReadStruct(obj, msg) under the hood which should be foundable by argument-dependent lookup.
Definition at line 39 of file convert.hpp.
template<traits::ProtoMessage TMessage, traits::ProtoStruct TStruct>
| void proto_structs::MessageToStruct |
( |
const TMessage & | msg, |
|
|
TStruct & | obj ) |
Converts protobuf message msg to struct obj.
- Template Parameters
-
| TMessage | protobuf message type |
| TStruct | struct type |
- Exceptions
-
- Note
- If function throws an exception, obj is not modified
Function calls ReadStruct(obj, msg) under the hood which should be foundable by argument-dependent lookup.
Definition at line 26 of file convert.hpp.
template<traits::ProtoMessage TMessage, typename TStruct>
requires traits::ProtoStruct<std::remove_cvref_t<TStruct>>
| TMessage proto_structs::StructToMessage |
( |
TStruct && | obj | ) |
|
|
nodiscard |
Converts struct instance obj to protobuf message msg of the specified type.
- Template Parameters
-
| TStruct | struct type |
| TMessage | protobuf message type |
- Exceptions
-
Function calls WriteStruct(std::forward<TStruct>(obj), msg) under the hood which should be foundable by argument-dependent lookup.
Definition at line 70 of file convert.hpp.
template<typename TStruct>
requires traits::CompatibleStruct<std::remove_cvref_t<TStruct>>
| traits::CompatibleMessageType< std::remove_cvref_t< TStruct > > proto_structs::StructToMessage |
( |
TStruct && | obj | ) |
|
|
nodiscard |
Converts struct instance obj to it's compatible protobuf message.
- Template Parameters
-
- Exceptions
-
Compatability information should be provided for TStruct with proto_structs::compatible_message, otherwise compilation will fail.
Function calls WriteStruct(std::forward<TStruct>(obj), msg) under the hood which should be foundable by argument-dependent lookup.
Definition at line 87 of file convert.hpp.
template<typename TStruct, traits::ProtoMessage TMessage>
requires traits::ProtoStruct<std::remove_cvref_t<TStruct>>
| void proto_structs::StructToMessage |
( |
TStruct && | obj, |
|
|
TMessage & | msg ) |
Converts struct instance obj to protobuf message msg.
- Template Parameters
-
| TStruct | struct type |
| TMessage | protobuf message type |
- Exceptions
-
- Warning
- If function throws an exception, msg is left in a valid but unspecified state
Function calls WriteStruct(std::forward<TStruct>(obj), msg) under the hood which should be foundable by argument-dependent lookup.
Definition at line 55 of file convert.hpp.