|
Apollo
6.0
Open source self driving car software
|
The record writer. More...
#include <record_writer.h>


Public Types | |
| using | MessageNumberMap = std::unordered_map< std::string, uint64_t > |
| using | MessageTypeMap = std::unordered_map< std::string, std::string > |
| using | MessageProtoDescMap = std::unordered_map< std::string, std::string > |
| using | FileWriterPtr = std::unique_ptr< RecordFileWriter > |
Public Member Functions | |
| RecordWriter () | |
| The default constructor. More... | |
| RecordWriter (const proto::Header &header) | |
| The constructor with record header as parameter. More... | |
| virtual | ~RecordWriter () |
| Virtual Destructor. More... | |
| bool | Open (const std::string &file) |
| Open a record to write. More... | |
| void | Close () |
| Clean the record. More... | |
| bool | WriteChannel (const std::string &channel_name, const std::string &message_type, const std::string &proto_desc) |
| Write a channel to record. More... | |
| template<typename MessageT > | |
| bool | WriteMessage (const std::string &channel_name, const MessageT &message, const uint64_t time_nanosec, const std::string &proto_desc="") |
| Write a message to record. More... | |
| bool | SetSizeOfFileSegmentation (uint64_t size_kilobytes) |
| Set max size (KB) to segment record file. More... | |
| bool | SetIntervalOfFileSegmentation (uint64_t time_sec) |
| Set max interval (Second) to segment record file. 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... | |
| bool | IsNewChannel (const std::string &channel_name) const |
| Is a new channel recording or not. More... | |
| template<> | |
| bool | WriteMessage (const std::string &channel_name, const std::string &message, const uint64_t time_nanosec, const std::string &proto_desc) |
| template<> | |
| bool | WriteMessage (const std::string &channel_name, const std::shared_ptr< message::RawMessage > &message, const uint64_t time_nanosec, const std::string &proto_desc) |
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 |
The record writer.
| using apollo::cyber::record::RecordWriter::FileWriterPtr = std::unique_ptr<RecordFileWriter> |
| using apollo::cyber::record::RecordWriter::MessageNumberMap = std::unordered_map<std::string, uint64_t> |
| using apollo::cyber::record::RecordWriter::MessageProtoDescMap = std::unordered_map<std::string, std::string> |
| using apollo::cyber::record::RecordWriter::MessageTypeMap = std::unordered_map<std::string, std::string> |
| apollo::cyber::record::RecordWriter::RecordWriter | ( | ) |
The default constructor.
|
explicit |
The constructor with record header as parameter.
| header |
|
virtual |
Virtual Destructor.
| void apollo::cyber::record::RecordWriter::Close | ( | ) |
Clean the record.
|
overridevirtual |
Get channel list.
Implements apollo::cyber::record::RecordBase.
|
overridevirtual |
Get message number by channel name.
| channel_name |
Implements apollo::cyber::record::RecordBase.
|
overridevirtual |
Get message type by channel name.
| channel_name |
Implements apollo::cyber::record::RecordBase.
|
overridevirtual |
Get proto descriptor string by channel name.
| channel_name |
Implements apollo::cyber::record::RecordBase.
| bool apollo::cyber::record::RecordWriter::IsNewChannel | ( | const std::string & | channel_name | ) | const |
Is a new channel recording or not.
| bool apollo::cyber::record::RecordWriter::Open | ( | const std::string & | file | ) |
Open a record to write.
| file |
| bool apollo::cyber::record::RecordWriter::SetIntervalOfFileSegmentation | ( | uint64_t | time_sec | ) |
Set max interval (Second) to segment record file.
| time_sec |
| bool apollo::cyber::record::RecordWriter::SetSizeOfFileSegmentation | ( | uint64_t | size_kilobytes | ) |
Set max size (KB) to segment record file.
| size_kilobytes |
| bool apollo::cyber::record::RecordWriter::WriteChannel | ( | const std::string & | channel_name, |
| const std::string & | message_type, | ||
| const std::string & | proto_desc | ||
| ) |
Write a channel to record.
| channel_name | |
| message_type | |
| proto_desc |
| bool apollo::cyber::record::RecordWriter::WriteMessage | ( | const std::string & | channel_name, |
| const MessageT & | message, | ||
| const uint64_t | time_nanosec, | ||
| const std::string & | proto_desc = "" |
||
| ) |
Write a message to record.
| MessageT |
| channel_name | |
| message | |
| time_nanosec | |
| proto_desc |
|
inline |
|
inline |
1.8.13