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

#include <data_visitor.h>

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

Public 成员函数

 DataVisitor (const std::vector< VisitorConfig > &configs)
 
 ~DataVisitor ()
 
bool TryFetch (std::shared_ptr< M0 > &m0, std::shared_ptr< M1 > &m1)
 
- Public 成员函数 继承自 apollo::cyber::data::DataVisitorBase
 DataVisitorBase ()
 
void RegisterNotifyCallback (std::function< void()> &&callback)
 

额外继承的成员函数

- Protected 成员函数 继承自 apollo::cyber::data::DataVisitorBase
 DataVisitorBase (const DataVisitorBase &)=delete
 
DataVisitorBaseoperator= (const DataVisitorBase &)=delete
 
- Protected 属性 继承自 apollo::cyber::data::DataVisitorBase
uint64_t next_msg_index_ = 0
 
DataNotifierdata_notifier_ = DataNotifier::Instance()
 
std::shared_ptr< Notifiernotifier_
 

详细描述

template<typename M0, typename M1>
class apollo::cyber::data::DataVisitor< M0, M1, NullType, NullType >

在文件 data_visitor.h134 行定义.

构造及析构函数说明

◆ DataVisitor()

template<typename M0 , typename M1 >
apollo::cyber::data::DataVisitor< M0, M1, NullType, NullType >::DataVisitor ( const std::vector< VisitorConfig > &  configs)
inlineexplicit

在文件 data_visitor.h136 行定义.

137 : buffer_m0_(configs[0].channel_id,
138 new BufferType<M0>(configs[0].queue_size)),
139 buffer_m1_(configs[1].channel_id,
140 new BufferType<M1>(configs[1].queue_size)) {
141 DataDispatcher<M0>::Instance()->AddBuffer(buffer_m0_);
142 DataDispatcher<M1>::Instance()->AddBuffer(buffer_m1_);
144 data_fusion_ = new fusion::AllLatest<M0, M1>(buffer_m0_, buffer_m1_);
145 }
void AddNotifier(uint64_t channel_id, const std::shared_ptr< Notifier > &notifier)
std::shared_ptr< Notifier > notifier_

◆ ~DataVisitor()

template<typename M0 , typename M1 >
apollo::cyber::data::DataVisitor< M0, M1, NullType, NullType >::~DataVisitor ( )
inline

在文件 data_visitor.h147 行定义.

147 {
148 if (data_fusion_) {
149 delete data_fusion_;
150 data_fusion_ = nullptr;
151 }
152 }

成员函数说明

◆ TryFetch()

template<typename M0 , typename M1 >
bool apollo::cyber::data::DataVisitor< M0, M1, NullType, NullType >::TryFetch ( std::shared_ptr< M0 > &  m0,
std::shared_ptr< M1 > &  m1 
)
inline

在文件 data_visitor.h154 行定义.

154 { // NOLINT
155 if (data_fusion_->Fusion(&next_msg_index_, m0, m1)) {
157 return true;
158 }
159 return false;
160 }
virtual bool Fusion(uint64_t *index, std::shared_ptr< M0 > &m0, std::shared_ptr< M1 > &m1, std::shared_ptr< M2 > &m2, std::shared_ptr< M3 > &m3)=0

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