Skip to content

Commit

Permalink
fix wrong data type
Browse files Browse the repository at this point in the history
Signed-off-by: Timm Ruppert <[email protected]>
  • Loading branch information
TimmRuppert committed Oct 29, 2024
1 parent 44b246e commit 9dcc389
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class NativeBinaryTraceFileReader final : public osi3::TraceFileReader {
std::vector<char> ReadNextMessageFromFile();

template <typename T>
std::unique_ptr<google::protobuf::Message> ParseMessage(const std::string& data) {
std::unique_ptr<google::protobuf::Message> ParseMessage(const std::vector<char>& data) {
auto msg = std::make_unique<T>();
if (!msg->ParseFromArray(data.data(), static_cast<int>(data.size()))) {
throw std::runtime_error("Failed to parse message");
Expand Down
4 changes: 1 addition & 3 deletions src/tracefile/NativeBinaryTraceFileReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#include <filesystem>
#include <sstream>

#include "google/protobuf/descriptor.pb.h"

namespace osi3 {

bool NativeBinaryTraceFileReader::Open(const std::string& filename, const ReaderTopLevelMessage message_type) {
Expand Down Expand Up @@ -47,7 +45,7 @@ bool NativeBinaryTraceFileReader::Open(const std::string& filename) {
return false;
}

parser_ = kParserMap.at(message_type_);
parser_ = kParserMap_.at(message_type_);

trace_file_ = std::ifstream(filename, std::ios::binary);
if (!trace_file_) {
Expand Down

0 comments on commit 9dcc389

Please sign in to comment.