diff --git a/cartographer/io/proto_stream.h b/cartographer/io/proto_stream.h index aef09c5..8cf2fa0 100644 --- a/cartographer/io/proto_stream.h +++ b/cartographer/io/proto_stream.h @@ -20,6 +20,7 @@ #include #include "cartographer/common/port.h" +#include "google/protobuf/message.h" namespace cartographer { namespace io { @@ -39,8 +40,7 @@ class ProtoStreamWriter { ProtoStreamWriter& operator=(const ProtoStreamWriter&) = delete; // Serializes, compressed and writes the 'proto' to the file. - template - void WriteProto(const MessageType& proto) { + void WriteProto(const google::protobuf::Message& proto) { std::string uncompressed_data; proto.SerializeToString(&uncompressed_data); Write(uncompressed_data); @@ -64,8 +64,7 @@ class ProtoStreamReader { ProtoStreamReader(const ProtoStreamReader&) = delete; ProtoStreamReader& operator=(const ProtoStreamReader&) = delete; - template - bool ReadProto(MessageType* proto) { + bool ReadProto(google::protobuf::Message* proto) { std::string decompressed_data; return Read(&decompressed_data) && proto->ParseFromString(decompressed_data);