17 #ifndef CYBER_RECORD_RECORD_VIEWER_H_ 18 #define CYBER_RECORD_RECORD_VIEWER_H_ 51 uint64_t
end_time = std::numeric_limits<uint64_t>::max(),
52 const std::set<std::string>& channels = {});
62 RecordViewer(
const std::vector<RecordReaderPtr>& readers,
64 uint64_t
end_time = std::numeric_limits<uint64_t>::max(),
65 const std::set<std::string>& channels = std::set<std::string>());
86 uint64_t
end_time()
const {
return end_time_; }
98 class Iterator :
public std::iterator<std::input_iterator_tag, RecordMessage,
99 int, RecordMessage*, RecordMessage&> {
107 explicit Iterator(RecordViewer* viewer,
bool end =
false);
161 RecordViewer* viewer_ =
nullptr;
162 value_type message_instance_;
188 uint64_t begin_time_ = 0;
189 uint64_t end_time_ = std::numeric_limits<uint64_t>::max();
191 std::set<std::string> channels_;
193 std::set<std::string> channel_list_;
194 std::vector<RecordReaderPtr> readers_;
195 std::vector<bool> readers_finished_;
197 uint64_t curr_begin_time_ = 0;
198 std::multimap<uint64_t, std::shared_ptr<RecordMessage>> msg_buffer_;
200 const uint64_t kStepTimeNanoSec = 1000000000UL;
201 const std::size_t kBufferMinSize = 128;
208 #endif // CYBER_RECORD_RECORD_VIEWER_H_ Basic data struct of record message.
Definition: record_message.h:34
RecordViewer(const RecordReaderPtr &reader, uint64_t begin_time=0, uint64_t end_time=std::numeric_limits< uint64_t >::max(), const std::set< std::string > &channels={})
The constructor with single reader.
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
pointer operator->()
Overloading operator ->.
bool operator!=(const Iterator &rhs) const
Overloading operator !=.
bool IsValid() const
Is this record reader is valid.
uint64_t end_time() const
Get end time.
Definition: record_viewer.h:86
Iterator()
The default constructor of iterator.
Definition: record_viewer.h:112
std::shared_ptr< RecordReader > RecordReaderPtr
Definition: record_viewer.h:40
uint64_t begin_time() const
Get begin time.
Definition: record_viewer.h:79
The iterator.
Definition: record_viewer.h:98
Iterator end()
Get the end iterator.
virtual ~Iterator()
The default destructor of iterator.
Definition: record_viewer.h:117
The record viewer.
Definition: record_viewer.h:38
Iterator begin()
Get the begin iterator.
bool Init(const char *binary_name)
Iterator & operator++()
Overloading operator ++.
bool operator==(Iterator const &other) const
Overloading operator ==.
reference operator*()
Overloading operator *.
std::set< std::string > GetChannelList() const
Get channel list.
Definition: record_viewer.h:93