GRPC C++  0.10.0.0
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
grpc::SerializationTraits< Message, UnusedButHereForPartialTemplateSpecialization > Class Template Reference

Defines how to serialize and deserialize some type. More...

#include <serialization_traits.h>

Detailed Description

template<class Message, class UnusedButHereForPartialTemplateSpecialization = void>
class grpc::SerializationTraits< Message, UnusedButHereForPartialTemplateSpecialization >

Defines how to serialize and deserialize some type.

Used for hooking different message serialization API's into GRPC. Each SerializationTraits implementation must provide the following functions: static Status Serialize(const Message& msg, grpc_byte_buffer** buffer, static Status Deserialize(grpc_byte_buffer* buffer, Message* msg, int max_message_size);

Serialize is required to convert message to a grpc_byte_buffer, and to store a pointer to that byte buffer at *buffer. *own_buffer should be set to true if the caller owns said byte buffer, or false if ownership is retained elsewhere.

Deserialize is required to convert buffer into the message stored at msg. max_message_size is passed in as a bound on the maximum number of message bytes Deserialize should accept.

Both functions return a Status, allowing them to explain what went wrong if required.


The documentation for this class was generated from the following file: