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;
132 #endif // CYBER_RECORD_RECORD_READER_H_ void Reset()
Reset the message index of record reader.
Basic data struct of record message.
Definition: record_message.h:34
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
bool ReadMessage(RecordMessage *message, uint64_t begin_time=0, uint64_t end_time=std::numeric_limits< uint64_t >::max())
Read one message from reader.
virtual ~RecordReader()
The destructor.
const std::string & GetProtoDesc(const std::string &channel_name) const override
Get proto descriptor string by channel name.
const std::string & GetMessageType(const std::string &channel_name) const override
Get message type by channel name.
std::unique_ptr< RecordFileReader > FileReaderPtr
Definition: record_reader.h:41
The record reader.
Definition: record_reader.h:39
Base class for record reader and writer.
Definition: record_base.h:35
std::unordered_map< std::string, proto::ChannelCache > ChannelInfoMap
Definition: record_reader.h:42
uint64_t GetMessageNumber(const std::string &channel_name) const override
Get message number by channel name.
std::set< std::string > GetChannelList() const override
Get channel list.
bool IsValid() const
Is this record reader is valid.
Definition: record_reader.h:61
RecordReader(const std::string &file)
The constructor with record file path as parameter.