Apollo 10.0
自动驾驶开放平台
apollo::cyber::data::fusion::AllLatest< M0, M1, M2, NullType > 模板类 参考

#include <all_latest.h>

类 apollo::cyber::data::fusion::AllLatest< M0, M1, M2, NullType > 继承关系图:
apollo::cyber::data::fusion::AllLatest< M0, M1, M2, NullType > 的协作图:

Public 成员函数

 AllLatest (const ChannelBuffer< M0 > &buffer_0, const ChannelBuffer< M1 > &buffer_1, const ChannelBuffer< M2 > &buffer_2)
 
bool Fusion (uint64_t *index, std::shared_ptr< M0 > &m0, std::shared_ptr< M1 > &m1, std::shared_ptr< M2 > &m2) override
 
- Public 成员函数 继承自 apollo::cyber::data::fusion::DataFusion< M0, M1, M2 >
virtual ~DataFusion ()
 
virtual bool Fusion (uint64_t *index, std::shared_ptr< M0 > &m0, std::shared_ptr< M1 > &m1, std::shared_ptr< M2 > &m2, std::shared_ptr< NullType > &m3)=0
 

详细描述

template<typename M0, typename M1, typename M2>
class apollo::cyber::data::fusion::AllLatest< M0, M1, M2, NullType >

在文件 all_latest.h93 行定义.

构造及析构函数说明

◆ AllLatest()

template<typename M0 , typename M1 , typename M2 >
apollo::cyber::data::fusion::AllLatest< M0, M1, M2, NullType >::AllLatest ( const ChannelBuffer< M0 > &  buffer_0,
const ChannelBuffer< M1 > &  buffer_1,
const ChannelBuffer< M2 > &  buffer_2 
)
inline

在文件 all_latest.h98 行定义.

101 : buffer_m0_(buffer_0),
102 buffer_m1_(buffer_1),
103 buffer_m2_(buffer_2),
104 buffer_fusion_(buffer_m0_.channel_id(),
105 new CacheBuffer<std::shared_ptr<FusionDataType>>(
106 buffer_0.Buffer()->Capacity() - uint64_t(1))) {
107 buffer_m0_.Buffer()->SetFusionCallback(
108 [this](const std::shared_ptr<M0>& m0) {
109 std::shared_ptr<M1> m1;
110 std::shared_ptr<M2> m2;
111 if (!buffer_m1_.Latest(m1) || !buffer_m2_.Latest(m2)) {
112 return;
113 }
114
115 auto data = std::make_shared<FusionDataType>(m0, m1, m2);
116 std::lock_guard<std::mutex> lg(buffer_fusion_.Buffer()->Mutex());
117 buffer_fusion_.Buffer()->Fill(data);
118 });
119 }
bool Latest(std::shared_ptr< T > &m)
std::shared_ptr< BufferType > Buffer() const

成员函数说明

◆ Fusion()

template<typename M0 , typename M1 , typename M2 >
bool apollo::cyber::data::fusion::AllLatest< M0, M1, M2, NullType >::Fusion ( uint64_t *  index,
std::shared_ptr< M0 > &  m0,
std::shared_ptr< M1 > &  m1,
std::shared_ptr< M2 > &  m2 
)
inlineoverride

在文件 all_latest.h121 行定义.

122 {
123 std::shared_ptr<FusionDataType> fusion_data;
124 if (!buffer_fusion_.Fetch(index, fusion_data)) {
125 return false;
126 }
127 m0 = std::get<0>(*fusion_data);
128 m1 = std::get<1>(*fusion_data);
129 m2 = std::get<2>(*fusion_data);
130 return true;
131 }
bool Fetch(uint64_t *index, std::shared_ptr< T > &m)

该类的文档由以下文件生成: