Apollo  6.0
Open source self driving car software
Public Types | Public Member Functions | List of all members
apollo::cyber::record::RecordReader Class Reference

The record reader. More...

#include <record_reader.h>

Inheritance diagram for apollo::cyber::record::RecordReader:
Inheritance graph
Collaboration diagram for apollo::cyber::record::RecordReader:
Collaboration graph

Public Types

using FileReaderPtr = std::unique_ptr< RecordFileReader >
 
using ChannelInfoMap = std::unordered_map< std::string, proto::ChannelCache >
 

Public Member Functions

 RecordReader (const std::string &file)
 The constructor with record file path as parameter. More...
 
virtual ~RecordReader ()
 The destructor. More...
 
bool IsValid () const
 Is this record reader is valid. More...
 
bool ReadMessage (RecordMessage *message, uint64_t begin_time=0, uint64_t end_time=std::numeric_limits< uint64_t >::max())
 Read one message from reader. More...
 
void Reset ()
 Reset the message index of record reader. More...
 
uint64_t GetMessageNumber (const std::string &channel_name) const override
 Get message number by channel name. More...
 
const std::string & GetMessageType (const std::string &channel_name) const override
 Get message type by channel name. More...
 
const std::string & GetProtoDesc (const std::string &channel_name) const override
 Get proto descriptor string by channel name. More...
 
std::set< std::string > GetChannelList () const override
 Get channel list. More...
 
- Public Member Functions inherited from apollo::cyber::record::RecordBase
virtual ~RecordBase ()=default
 Destructor. More...
 
const proto::Header & GetHeader () const
 Get record header. More...
 
const std::string GetFile () const
 Get record file path. More...
 

Additional Inherited Members

- Protected Attributes inherited from apollo::cyber::record::RecordBase
std::string file_
 
proto::Header header_
 
bool is_opened_ = false
 

Detailed Description

The record reader.

Member Typedef Documentation

◆ ChannelInfoMap

using apollo::cyber::record::RecordReader::ChannelInfoMap = std::unordered_map<std::string, proto::ChannelCache>

◆ FileReaderPtr

Constructor & Destructor Documentation

◆ RecordReader()

apollo::cyber::record::RecordReader::RecordReader ( const std::string &  file)
explicit

The constructor with record file path as parameter.

Parameters
file

◆ ~RecordReader()

virtual apollo::cyber::record::RecordReader::~RecordReader ( )
virtual

The destructor.

Member Function Documentation

◆ GetChannelList()

std::set<std::string> apollo::cyber::record::RecordReader::GetChannelList ( ) const
overridevirtual

Get channel list.

Returns
List container with all channel name string.

Implements apollo::cyber::record::RecordBase.

◆ GetMessageNumber()

uint64_t apollo::cyber::record::RecordReader::GetMessageNumber ( const std::string &  channel_name) const
overridevirtual

Get message number by channel name.

Parameters
channel_name
Returns
Message number.

Implements apollo::cyber::record::RecordBase.

◆ GetMessageType()

const std::string& apollo::cyber::record::RecordReader::GetMessageType ( const std::string &  channel_name) const
overridevirtual

Get message type by channel name.

Parameters
channel_name
Returns
Message type.

Implements apollo::cyber::record::RecordBase.

◆ GetProtoDesc()

const std::string& apollo::cyber::record::RecordReader::GetProtoDesc ( const std::string &  channel_name) const
overridevirtual

Get proto descriptor string by channel name.

Parameters
channel_name
Returns
Proto descriptor string by channel name.

Implements apollo::cyber::record::RecordBase.

◆ IsValid()

bool apollo::cyber::record::RecordReader::IsValid ( ) const
inline

Is this record reader is valid.

Returns
True for valid, false for not.

◆ ReadMessage()

bool apollo::cyber::record::RecordReader::ReadMessage ( RecordMessage message,
uint64_t  begin_time = 0,
uint64_t  end_time = std::numeric_limits< uint64_t >::max() 
)

Read one message from reader.

Parameters
message
begin_time
end_time
Returns
True for success, false for not.

◆ Reset()

void apollo::cyber::record::RecordReader::Reset ( )

Reset the message index of record reader.


The documentation for this class was generated from the following file: