34
// Summarizes the configuration options known to the dummy provider.
35
35
struct Configuration
37
inline static const char* key_update_period()
39
return "dummy::UpdatePeriodInMs";
42
inline static const char* key_reference_position_lat()
44
return "ReferenceLocationLat";
47
inline static const char* key_reference_position_lon()
49
return "ReferenceLocationLon";
37
// All configuration keys known to the dummy provider.
40
static constexpr const char* update_period
44
static constexpr const char* reference_position_lat
46
"ReferenceLocationLat"
48
static constexpr const char* reference_position_lon
50
"ReferenceLocationLon"
52
static constexpr const char* reference_position_alt
54
"ReferenceLocationAlt"
56
static constexpr const char* reference_horizontal_accuracy
58
"ReferenceHorizontalAccuracy"
60
static constexpr const char* reference_vertical_accuracy
62
"ReferenceVerticalAccuracy"
64
static constexpr const char* reference_velocity
68
static constexpr const char* reference_heading
74
// Updates are delivered every update_period milliseconds.
52
75
std::chrono::milliseconds update_period{500};
77
// The reference position that is delivered in every upate cycle.
54
78
Position reference_position
56
wgs84::Latitude{9. * units::Degrees},
57
wgs84::Longitude{53. * units::Degrees},
58
wgs84::Altitude{-2. * units::Meters}
94
// The reference velocity that is delivered in every update cycle.
95
Velocity reference_velocity
97
9 * units::MetersPerSecond
100
// The reference heading that is delivered in every update cycle.
101
Heading reference_heading
65
110
// For integration with the Provider factory.
66
111
static std::string class_name();
112
// Instantiates a new provider instance, populating the configuration object
113
// from the provided property bundle. Please see dummy::Configuration::Keys
114
// for the list of known options.
67
115
static Provider::Ptr create_instance(const ProviderFactory::Configuration&);
117
// Creates a new provider instance from the given configuration.
69
118
Provider(const Configuration& config = Configuration{});
70
Provider(const Provider&) = delete;
71
Provider& operator=(const Provider&) = delete;
119
// Cleans up all resources and stops the updates.
72
120
~Provider() noexcept;
122
// Always returns true.
75
123
bool matches_criteria(const Criteria&);
125
// Starts up the updater thread and delivers position updates
77
126
void start_position_updates();
127
// Stops the updater thread.
78
128
void stop_position_updates();