libosmscout 1.1.1
Loading...
Searching...
No Matches
RouteStateAgent.h
Go to the documentation of this file.
1#ifndef OSMSCOUT_NAVIGATION_ROUTE_STATE_AGENT_H
2#define OSMSCOUT_NAVIGATION_ROUTE_STATE_AGENT_H
3
4/*
5 This source is part of the libosmscout library
6 Copyright (C) 2018 Tim Teulings
7 Copyright (C) 2019 Lukas Karas
8
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2.1 of the License, or (at your option) any later version.
13
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public
20 License along with this library; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23
27
28#include <optional>
29
30namespace osmscout {
31
35 struct OSMSCOUT_API RerouteRequestMessage CLASS_FINAL : public NavigationMessage
36 {
38 const std::optional<Bearing> initialBearing;
39 const GeoCoord to;
40
42 const GeoCoord &from,
43 const std::optional<Bearing> &initialBearing,
44 const GeoCoord &to);
45 };
46
47 struct OSMSCOUT_API TargetReachedMessage CLASS_FINAL : public NavigationMessage
48 {
51 const Bearing targetBearing;
52 const Distance targetDistance;
53
55 const GeoCoord &coord,
56 const GeoCoord &target,
57 const Bearing &targetBearing,
58 const Distance &targetDistance);
59 };
60
61 class OSMSCOUT_API RouteStateAgent CLASS_FINAL : public NavigationAgent
62 {
63 private:
64 Timestamp lastUpdate;
65 PositionAgent::PositionState state;
66 std::optional<Bearing> bearing;
67 GeoCoord target;
68 bool targetSetup{false};
69
70 public:
71 explicit RouteStateAgent();
72 std::list<NavigationMessageRef> Process(const NavigationMessageRef& message) override;
73 };
74}
75#endif
#define OSMSCOUT_API
Definition CoreImportExport.h:45
Definition Area.h:88
const GeoCoord coord
Definition RouteStateAgent.h:49
const std::optional< Bearing > initialBearing
Definition RouteStateAgent.h:38
const Bearing targetBearing
Definition RouteStateAgent.h:51
const GeoCoord from
Definition RouteStateAgent.h:37
TargetReachedMessage(const Timestamp &timestamp, const GeoCoord &coord, const GeoCoord &target, const Bearing &targetBearing, const Distance &targetDistance)
const GeoCoord to
Definition RouteStateAgent.h:39
std::list< NavigationMessageRef > Process(const NavigationMessageRef &message) override
const Distance targetDistance
Definition RouteStateAgent.h:52
const GeoCoord target
Definition RouteStateAgent.h:50
std::vector< VoiceSample > message
Definition VoiceInstructionAgent.h:99
RerouteRequestMessage(const Timestamp &timestamp, const GeoCoord &from, const std::optional< Bearing > &initialBearing, const GeoCoord &to)
Definition Engine.h:79
Definition Area.h:39
std::chrono::system_clock::time_point Timestamp
Definition Time.h:27
std::shared_ptr< NavigationMessage > NavigationMessageRef
Definition Engine.h:56
Definition Engine.h:49
const Timestamp timestamp
Definition Engine.h:50