19 #include "async_grpc/rpc_handler.h" 21 #include "cartographer/cloud/proto/map_builder_service.pb.h" 23 #include "google/protobuf/empty.pb.h" 29 void LoadStateHandler::OnRequest(
const proto::LoadStateRequest& request) {
30 switch (request.state_chunk_case()) {
31 case proto::LoadStateRequest::kPoseGraph:
32 reader_.AddProto(request.pose_graph());
34 case proto::LoadStateRequest::kAllTrajectoryBuilderOptions:
35 reader_.AddProto(request.all_trajectory_builder_options());
37 case proto::LoadStateRequest::kSerializedData:
38 reader_.AddProto(request.serialized_data());
41 LOG(FATAL) <<
"Unhandled proto::LoadStateRequest case.";
45 void LoadStateHandler::OnReadsDone() {
46 GetContext<MapBuilderContextInterface>()->map_builder().LoadState(&
reader_,
48 Send(common::make_unique<google::protobuf::Empty>());
std::unique_ptr< InMemoryProtoStreamReader > reader_