MauiKit Image Tools

modules/geolocation/cities.h
1//
2// Created by gabridc on 5/6/21.
3//
4#pragma once
5#include <QDebug>
6
7#include <QObject>
8#include <QThread>
9
10#include "kdtree.hpp"
11
12#include "imagetools_export.h"
13
14class City;
15class CitiesDB;
16class KDTree_Cities
17{
18
19public:
20 KDTree_Cities *instance()
21 {
22 static KDTree_Cities instance;
23 return &instance;
24 }
25
26private:
27 KDTree_Cities();
28};
29
30/**
31 * @brief A wrapper to give access to al the cities information in the data base
32 */
33class IMAGETOOLS_EXPORT Cities : public QObject
34{
35 Q_OBJECT
36
37public:
38
39 static Cities *getInstance()
40 {
41 qWarning() << "GETTIG CITIES INSTANCE" << QThread::currentThread();
42
43 if (m_instance)
44 return m_instance;
45
46 m_instance = new Cities;
47 return m_instance;
48 }
49
50 City *findCity(double latitude, double longitude);
51 City *city(const QString&);
52
53private:
54 static Cities *m_instance;
55
56 Cities(QObject * parent = nullptr);
57
58 ~Cities();
59 Cities(const Cities &) = delete;
60 Cities &operator=(const Cities &) = delete;
61 Cities(Cities &&) = delete;
62 Cities &operator=(Cities &&) = delete;
63
64 static KDTree *m_citiesTree;
65
66 void parseCities();
67
68 CitiesDB *db();
70
72 void citiesReady();
73};
A wrapper to give access to al the cities information in the data base.
A class for representing the GPS coordinates and information of a city.
Q_SIGNALSQ_SIGNALS
QThread * currentThread()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:32:36 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.