libosmscout  1.1.1
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 
28 #include <osmscout/util/String.h>
29 
30 namespace osmscout {
31 
49  {
51 
52  explicit NavigationMessage(const Timestamp& timestamp);
53  virtual ~NavigationMessage() = default;
54  };
55 
56  using NavigationMessageRef = std::shared_ptr<NavigationMessage>;
57 
62  struct OSMSCOUT_API InitializeMessage CLASS_FINAL : public NavigationMessage
63  {
64  explicit InitializeMessage(const Timestamp& timestamp);
65  };
66 
73  struct OSMSCOUT_API TimeTickMessage CLASS_FINAL : public NavigationMessage
74  {
75  explicit TimeTickMessage(const Timestamp& timestamp);
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
std::shared_ptr< NavigationAgent > NavigationAgentRef
Definition: Engine.h:86
std::chrono::system_clock::time_point Timestamp
Definition: Time.h:27
Definition: Area.h:86
Definition: Area.h:38
#define CLASS_FINAL
Definition: Compiler.h:26
#define OSMSCOUT_API
Definition: CoreImportExport.h:45
const Timestamp timestamp
Definition: Engine.h:50
Definition: Engine.h:78
std::shared_ptr< NavigationMessage > NavigationMessageRef
Definition: Engine.h:56
Definition: Engine.h:48
Definition: Engine.h:88