libosmscout 1.1.1
Loading...
Searching...
No Matches
Engine.h
Go to the documentation of this file.
1#ifndef OSMSCOUT_NAVIGATION_ENGINE_H
2#define OSMSCOUT_NAVIGATION_ENGINE_H
3
4/*
5 This source is part of the libosmscout library
6 Copyright (C) 2018 Tim Teulings
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#include <list>
24#include <vector>
25
26#include <osmscout/GeoCoord.h>
27
29
30namespace osmscout {
31
37
49 {
51
53 virtual ~NavigationMessage() = default;
54 };
55
56 using NavigationMessageRef = std::shared_ptr<NavigationMessage>;
57
62 struct OSMSCOUT_API InitializeMessage CLASS_FINAL : public NavigationMessage
63 {
65 };
66
73 struct OSMSCOUT_API TimeTickMessage CLASS_FINAL : public NavigationMessage
74 {
76 };
77
79 {
80 public:
81 virtual ~NavigationAgent() = default;
82
83 virtual std::list<NavigationMessageRef> Process(const NavigationMessageRef& message) = 0;
84 };
85
86 using NavigationAgentRef = std::shared_ptr<NavigationAgent>;
87
89 {
90 private:
91 std::vector<NavigationAgentRef> agents;
92
93 public:
94 explicit NavigationEngine(std::initializer_list<NavigationAgentRef> agents);
95 std::list<NavigationMessageRef> Process(const NavigationMessageRef& message) const;
96 };
97}
98
99#endif
#define OSMSCOUT_API
Definition CoreImportExport.h:45
Definition Area.h:88
InitializeMessage(const Timestamp &timestamp)
TimeTickMessage(const Timestamp &timestamp)
Definition Engine.h:79
virtual ~NavigationAgent()=default
virtual std::list< NavigationMessageRef > Process(const NavigationMessageRef &message)=0
std::list< NavigationMessageRef > Process(const NavigationMessageRef &message) const
NavigationEngine(std::initializer_list< NavigationAgentRef > agents)
Definition Area.h:39
std::chrono::system_clock::time_point Timestamp
Definition Time.h:27
std::shared_ptr< NavigationAgent > NavigationAgentRef
Definition Engine.h:86
std::shared_ptr< NavigationMessage > NavigationMessageRef
Definition Engine.h:56
Definition Engine.h:49
virtual ~NavigationMessage()=default
NavigationMessage(const Timestamp &timestamp)
const Timestamp timestamp
Definition Engine.h:50