17#ifndef CYBER_RECORD_RECORD_READER_H_
18#define CYBER_RECORD_RECORD_READER_H_
24#include <unordered_map>
26#include "cyber/proto/record.pb.h"
61 bool IsValid()
const {
return is_valid_; }
73 uint64_t end_time = std::numeric_limits<uint64_t>::max());
97 const std::string& channel_name)
const override;
107 const std::string& channel_name)
const override;
117 bool ReadNextChunk(uint64_t begin_time, uint64_t end_time);
119 bool is_valid_ =
false;
120 bool reach_end_ =
false;
121 std::unique_ptr<proto::ChunkBody> chunk_ =
nullptr;
123 int message_index_ = 0;
Base class for record reader and writer.
void Reset()
Reset the message index of record reader.
std::unordered_map< std::string, proto::ChannelCache > ChannelInfoMap
const std::string & GetProtoDesc(const std::string &channel_name) const override
Get proto descriptor string by channel name.
bool ReadMessage(RecordMessage *message, uint64_t begin_time=0, uint64_t end_time=std::numeric_limits< uint64_t >::max())
Read one message from reader.
bool IsValid() const
Is this record reader is valid.
std::unique_ptr< RecordFileReader > FileReaderPtr
uint64_t GetMessageNumber(const std::string &channel_name) const override
Get message number by channel name.
const std::string & GetMessageType(const std::string &channel_name) const override
Get message type by channel name.
std::set< std::string > GetChannelList() const override
Get channel list.
virtual ~RecordReader()
The destructor.
Basic data struct of record message.