TnEHProvider
tn_ehp.h
Go to the documentation of this file.
1 
10 #ifndef __TN_EHP_H__
11 #define __TN_EHP_H__
12 
13 #include <string>
14 #include <memory>
15 #include <vector>
16 #include <functional>
17 
18 #include <foundation/common/service_status.h>
19 #include <foundation/log/logging_structs.h>
20 
21 #include "tn_export.h"
22 #include "tn_settings.h"
23 #include "tn_generic_hal.h"
24 
27 
31 
32 #include "tn_api_version.h"
33 
34 namespace tn
35 {
36 namespace ehp
37 {
41 static const APIVersion _APIVersion{"0", "2", "0"};
42 
43 typedef std::function<void(const MMFeedbackPtr& mm_feedback)> MapMatchingFeedbackUpdate_cb;
44 typedef std::function<void(const ADASMessagePtrs& adas_messages)> ADASMessagesUpdate_cb;
45 typedef std::function<void(const TnAnalyticsEvent& analytics_event)> AnalyticsEventUpdate_cb;
46 typedef std::function<void(const TnDiagnosticsEvent& diagnostics_event)> DiagnosticsEventUpdate_cb;
47 typedef std::function<void(const tn::foundation::Message& log_message)> LogMessageUpdate_cb;
48 
54 {
55 public:
56  virtual ~TnEHProvider()
57  {
58  }
59 
60 public:
69  virtual void updatePosition(const VehicleLocationInfo& vehicle_location) = 0;
70 
71  // we can add more set interface here to set sensor data, such as GNSS, RTK,Vechile, Camera, Radar
72 
81  virtual void getEHMapVersion(std::string& streaming_data_version, std::string& onboard_data_version) = 0;
82 
93  virtual tn::foundation::ServiceStatus shutdown() = 0;
94 
102  virtual tn::foundation::ServiceStatus pause() = 0;
103 
111  virtual tn::foundation::ServiceStatus resume() = 0;
112 
124 
135  virtual void setAdasCallback(ADASMessagesUpdate_cb mm_cb) = 0;
136 
147  virtual void setAnalyticsCallback(AnalyticsEventUpdate_cb analytics_cb) = 0;
148 
159  virtual void setDiagnosticsCallback(DiagnosticsEventUpdate_cb diagnostics_cb) = 0;
160 
171  virtual void setLogCallback(LogMessageUpdate_cb log_meesage_cb) = 0;
172 
179  virtual std::string getEhpVersion() = 0;
180 };
181 
186 {
187 public:
197  static std::shared_ptr<TnEHProvider> createInstance(const TnEHProviderSettings& settings,
198  std::weak_ptr<GenericHAL> generic_hal);
199 };
200 
201 } // namespace ehp
202 } // namespace tn
203 
204 #endif //__TN_EHP_H__
tn::ehp::TnEHProvider::updatePosition
virtual void updatePosition(const VehicleLocationInfo &vehicle_location)=0
update the latest vehicle location.
tn_adas_message.h
the adas message definition Copyright (c) 2021 Telenav, Inc All rights reserved This program is UNPUB...
tn::ehp::TnEHProviderSettings
The defination of settings, include region, config path, data path vector.
Definition: tn_settings.h:29
tn::ehp::TnEHProvider
Telenav electronic horizontal provider library.
Definition: tn_ehp.h:54
tn::ehp::TnEHProvider::getEhpVersion
virtual std::string getEhpVersion()=0
get Ehp version
tn_api_version.h
tn::ehp::TnEHProviderFactory
The Telenav EH provider factory.
Definition: tn_ehp.h:186
tn_diagnostics_event.h
the diagnostics event related information definition Copyright (c) 2021 Telenav, Inc All rights reser...
tn::ehp::MMFeedbackPtr
std::shared_ptr< MMFeedback > MMFeedbackPtr
Definition: tn_mm_feedback.h:180
tn::ehp::TnEHProvider::shutdown
virtual tn::foundation::ServiceStatus shutdown()=0
The shutdown() will stop the running service and release all resources owned by it.
tn::ehp::TnEHProvider::~TnEHProvider
virtual ~TnEHProvider()
Definition: tn_ehp.h:56
tn::ehp::VehicleLocationInfo
Vehicle current location information.
Definition: tn_vehicle_location_info.h:22
tn::ehp::LogMessageUpdate_cb
std::function< void(const tn::foundation::Message &log_message)> LogMessageUpdate_cb
Definition: tn_ehp.h:47
tn::ehp::DiagnosticsEventUpdate_cb
std::function< void(const TnDiagnosticsEvent &diagnostics_event)> DiagnosticsEventUpdate_cb
Definition: tn_ehp.h:46
tn_settings.h
The definations of settings for tnehprovider. Copyright (c) 2021 Telenav, Inc All rights reserved Thi...
tn::ehp::ADASMessagePtrs
std::vector< std::shared_ptr< ADASMessage > > ADASMessagePtrs
Definition: tn_adas_message.h:57
tn::ehp::TnEHProvider::resume
virtual tn::foundation::ServiceStatus resume()=0
The resume() will resume paused service.
tn::ehp::MapMatchingFeedbackUpdate_cb
std::function< void(const MMFeedbackPtr &mm_feedback)> MapMatchingFeedbackUpdate_cb
Definition: tn_ehp.h:43
tn::ehp::TnAnalyticsEvent
Definition: tn_analytics_event.h:38
tn_export.h
definitions for export and import Copyright (c) 2021 Telenav, Inc All rights reserved This program is...
tn_vehicle_location_info.h
tn::ehp::TnDiagnosticsEvent
Definition: tn_diagnostics_event.h:35
tn::ehp::TnEHProvider::getEHMapVersion
virtual void getEHMapVersion(std::string &streaming_data_version, std::string &onboard_data_version)=0
get electronic horizon map data version.
tn::ehp::TnEHProvider::setMMFeedbackCallback
virtual void setMMFeedbackCallback(MapMatchingFeedbackUpdate_cb mm_cb)=0
set mapmatching result callback, set function pointer to ehprovider, we can use it to return MM feedb...
tn::ehp::TnEHProvider::setLogCallback
virtual void setLogCallback(LogMessageUpdate_cb log_meesage_cb)=0
set log messgae callback, set function pointer to ehprovider, we can use it to return log message
tn_mm_feedback.h
position result definition,the position result from Telenav. Can be used for the DR engine....
tn
Definition: tn_adas_message.h:15
tn_analytics_event.h
the analytics event related information definition Copyright (c) 2021 Telenav, Inc All rights reserve...
tn::ehp::TnEHProvider::setAdasCallback
virtual void setAdasCallback(ADASMessagesUpdate_cb mm_cb)=0
set adas messgae callback, set function pointer to ehprovider, we can use it to return adas message
tn::ehp::TnEHProvider::setDiagnosticsCallback
virtual void setDiagnosticsCallback(DiagnosticsEventUpdate_cb diagnostics_cb)=0
set diagnostics callback, set function pointer to ehprovider, we can use it to return diagnostics
TN_EHP_API_DECL
#define TN_EHP_API_DECL
Definition: tn_export.h:46
tn::ehp::AnalyticsEventUpdate_cb
std::function< void(const TnAnalyticsEvent &analytics_event)> AnalyticsEventUpdate_cb
Definition: tn_ehp.h:45
tn::ehp::TnEHProvider::setAnalyticsCallback
virtual void setAnalyticsCallback(AnalyticsEventUpdate_cb analytics_cb)=0
set analytcis callback, set function pointer to ehprovider, we can use it to return analytics
tn::ehp::ADASMessagesUpdate_cb
std::function< void(const ADASMessagePtrs &adas_messages)> ADASMessagesUpdate_cb
Definition: tn_ehp.h:44
tn::ehp::TnEHProvider::pause
virtual tn::foundation::ServiceStatus pause()=0
The pause() will force service to stop running until resume() is called.
tn::ehp::TnEHProviderFactory::createInstance
static std::shared_ptr< TnEHProvider > createInstance(const TnEHProviderSettings &settings, std::weak_ptr< GenericHAL > generic_hal)
Creates and initializes a new TnEHProvider instance.