SRS-control
0.1.4
Loading...
Searching...
No Matches
ProtoSerializer.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <
srs/converters/ProtoSerializerBase.hpp
>
4
5
namespace
srs::process
6
{
7
const
auto
protobuf_deserializer_converter
= [](
const
proto::Data& proto_data, std::string& output_data) ->
int
8
{
9
namespace
protobuf = google::protobuf;
10
namespace
io = protobuf::io;
11
auto
output_stream = io::StringOutputStream{ &output_data };
12
proto_data.SerializeToZeroCopyStream(&output_stream);
13
return
0;
14
};
15
16
class
ProtoSerializer
:
public
ProtoSerializerBase
<decltype(protobuf_deserializer_converter)>
17
{
18
public
:
19
explicit
ProtoSerializer
(asio::thread_pool& thread_pool)
20
:
ProtoSerializerBase
{ thread_pool,
"ProtoSerializer"
,
protobuf_deserializer_converter
}
21
{
22
}
23
static
constexpr
auto
ConverterOption
= std::array{
proto
};
24
};
25
}
// namespace srs
ProtoSerializerBase.hpp
srs::process::ProtoSerializerBase< decltype(protobuf_deserializer_converter)>::ProtoSerializerBase
ProtoSerializerBase(asio::thread_pool &thread_pool, std::string name, decltype(protobuf_deserializer_converter) converter)
Definition
ProtoSerializerBase.hpp:13
srs::process::ProtoSerializer::ProtoSerializer
ProtoSerializer(asio::thread_pool &thread_pool)
Definition
ProtoSerializer.hpp:19
srs::process::ProtoSerializer::ConverterOption
static constexpr auto ConverterOption
Definition
ProtoSerializer.hpp:23
srs::process
Definition
DataConverterBase.hpp:10
srs::process::DataConvertOptions::proto
@ proto
Definition
DataConvertOptions.hpp:17
srs::process::protobuf_deserializer_converter
const auto protobuf_deserializer_converter
Definition
ProtoSerializer.hpp:7
backend
srs
converters
ProtoSerializer.hpp
Impressum
Datenschutzerklärung
Generated by
1.13.2