|
Apollo
6.0
Open source self driving car software
|
message manager manages protocols. It supports parse and can get protocol data by message id. More...
#include <message_manager.h>

Public Member Functions | |
| MessageManager () | |
| virtual | ~MessageManager ()=default |
| virtual void | Parse (const uint32_t message_id, const uint8_t *data, int32_t length) |
| parse data and store parsed info in protocol data More... | |
| void | ClearSensorData () |
| std::condition_variable * | GetMutableCVar () |
| ProtocolData< SensorType > * | GetMutableProtocolDataById (const uint32_t message_id) |
| get mutable protocol data by message id More... | |
| common::ErrorCode | GetSensorData (SensorType *const sensor_data) |
| get chassis detail. used lock_guard in this function to avoid concurrent read/write issue. More... | |
| void | ResetSendMessages () |
Protected Member Functions | |
| template<class T , bool need_check> | |
| void | AddRecvProtocolData () |
| template<class T , bool need_check> | |
| void | AddSendProtocolData () |
Protected Attributes | |
| std::vector< std::unique_ptr< ProtocolData< SensorType > > > | send_protocol_data_ |
| std::vector< std::unique_ptr< ProtocolData< SensorType > > > | recv_protocol_data_ |
| std::unordered_map< uint32_t, ProtocolData< SensorType > * > | protocol_data_map_ |
| std::unordered_map< uint32_t, CheckIdArg > | check_ids_ |
| std::set< uint32_t > | received_ids_ |
| std::mutex | sensor_data_mutex_ |
| SensorType | sensor_data_ |
| bool | is_received_on_time_ = false |
| std::condition_variable | cvar_ |
message manager manages protocols. It supports parse and can get protocol data by message id.
|
inline |
|
virtualdefault |
|
protected |
|
protected |
| void MessageManager::ClearSensorData | ( | ) |
| std::condition_variable * MessageManager::GetMutableCVar | ( | ) |
| ProtocolData< SensorType > * MessageManager::GetMutableProtocolDataById | ( | const uint32_t | message_id | ) |
get mutable protocol data by message id
| message_id | the id of the message |
| ErrorCode MessageManager::GetSensorData | ( | SensorType *const | sensor_data | ) |
get chassis detail. used lock_guard in this function to avoid concurrent read/write issue.
| chassis_detail | chassis_detail to be filled. |
|
virtual |
parse data and store parsed info in protocol data
| message_id | the id of the message |
| data | a pointer to the data array to be parsed |
| length | the length of data array |
Reimplemented in apollo::drivers::racobit_radar::RacobitRadarMessageManager, apollo::drivers::ultrasonic_radar::UltrasonicRadarMessageManager, and apollo::drivers::conti_radar::ContiRadarMessageManager.
| void MessageManager::ResetSendMessages | ( | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
1.8.13