cartographer
io
proto_stream_interface.h
Go to the documentation of this file.
1
/*
2
* Copyright 2018 The Cartographer Authors
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#ifndef CARTOGRAPHER_IO_PROTO_STREAM_INTERFACE_H_
18
#define CARTOGRAPHER_IO_PROTO_STREAM_INTERFACE_H_
19
20
#include "
cartographer/common/port.h
"
21
#include "google/protobuf/message.h"
22
23
namespace
cartographer
{
24
namespace
io {
25
26
// A writer for writing proto messages to a pbstream.
27
class
ProtoStreamWriterInterface
{
28
public
:
29
virtual
~ProtoStreamWriterInterface
() {}
30
31
// Serializes, compressed and writes the 'proto' to the file.
32
virtual
void
WriteProto
(
const
google::protobuf::Message& proto) = 0;
33
34
// This should be called to check whether writing was successful.
35
virtual
bool
Close
() = 0;
36
};
37
38
// A reader of the format produced by ProtoStreamWriter.
39
class
ProtoStreamReaderInterface
{
40
public
:
41
ProtoStreamReaderInterface
() =
default
;
42
virtual
~ProtoStreamReaderInterface
() {}
43
44
// Deserialize compressed proto from the pb stream.
45
virtual
bool
ReadProto(google::protobuf::Message* proto) = 0;
46
47
// 'End-of-file' marker for the pb stream.
48
virtual
bool
eof()
const
= 0;
49
};
50
51
}
// namespace io
52
}
// namespace cartographer
53
54
#endif // CARTOGRAPHER_IO_PROTO_STREAM_INTERFACE_H_
cartographer::io::ProtoStreamReaderInterface
Definition:
proto_stream_interface.h:39
cartographer::io::ProtoStreamWriterInterface::~ProtoStreamWriterInterface
virtual ~ProtoStreamWriterInterface()
Definition:
proto_stream_interface.h:29
cartographer
Definition:
map_builder_stub.cc:31
cartographer::io::ProtoStreamReaderInterface::~ProtoStreamReaderInterface
virtual ~ProtoStreamReaderInterface()
Definition:
proto_stream_interface.h:42
port.h
cartographer::io::ProtoStreamWriterInterface::Close
virtual bool Close()=0
cartographer::io::ProtoStreamWriterInterface::WriteProto
virtual void WriteProto(const google::protobuf::Message &proto)=0
cartographer::io::ProtoStreamWriterInterface
Definition:
proto_stream_interface.h:27
cartographer
Author(s): The Cartographer Authors
autogenerated on Mon Feb 28 2022 22:00:58