libosmscout 1.1.1
Loading...
Searching...
No Matches
QtRouteData.h
Go to the documentation of this file.
1#ifndef OSMSCOUT_CLIENT_QT_QTROUTEDATA_H
2#define OSMSCOUT_CLIENT_QT_QTROUTEDATA_H
3
4/*
5 OSMScout - a Qt backend for libosmscout and libosmscout-map
6 Copyright (C) 2010 Tim Teulings
7 Copyright (C) 2018 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
24#include <osmscout/Way.h>
25
28
30
31#include <QObject>
32
33namespace osmscout {
34
40class OSMSCOUT_CLIENT_QT_API QtRouteData : public QObject {
41 Q_OBJECT
42
43private:
44 // Main route data. It may be shared from multiple QtRouteData instances, we have to keep it immutable
45 struct PrivateData{
47 QList<RouteStep> routeSteps;
48 osmscout::Way routeWay;
49 };
50 using PrivateDataRef = std::shared_ptr<PrivateData>;
51
52 PrivateDataRef data;
53
54public:
55 explicit QtRouteData(QObject* parent=nullptr): QObject(parent) {};
57 QtRouteData(const QtRouteData &other);
58
60 QList<RouteStep> &&routeSteps,
61 osmscout::Way &&routeWay,
62 QObject* parent=nullptr);
63
65 ~QtRouteData() override = default;
66
68 QtRouteData& operator=(const QtRouteData&&) = delete;
69
70 explicit operator bool() const {
71 return (bool)data;
72 };
73
74 void clear();
75
76 osmscout::Way routeWayCopy() const;
77 const osmscout::Way& routeWay() const;
78
79 const QList<RouteStep>& routeSteps() const;
81};
82
83}
84
85#endif //OSMSCOUT_CLIENT_QT_QTROUTEDATA_H
#define OSMSCOUT_CLIENT_QT_API
Definition ClientQtImportExport.h:45
const QList< RouteStep > & routeSteps() const
QtRouteData(QObject *parent=nullptr)
Definition QtRouteData.h:55
QtRouteData(const QtRouteData &other)
copy constructor, Qt ownership is copied
QtRouteData & operator=(const QtRouteData &&)=delete
const osmscout::Way & routeWay() const
~QtRouteData() override=default
osmscout::Way routeWayCopy() const
QtRouteData & operator=(const QtRouteData &)
const osmscout::RouteDescription & routeDescription() const
QtRouteData(QtRouteData &&)=delete
QtRouteData(osmscout::RouteDescription &&routeDescription, QList< RouteStep > &&routeSteps, osmscout::Way &&routeWay, QObject *parent=nullptr)
Definition RouteDescription.h:55
Definition Area.h:39