/
qgsgpsconnectionregistry.h
65 lines (52 loc) · 2.45 KB
/
qgsgpsconnectionregistry.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/***************************************************************************
qgsgpsconnectionregistry.h - description
--------------------------
begin : December 27th, 2009
copyright : (C) 2009 by Marco Hugentobler
email : marco at hugis dot net
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSGPSCONNECTIONREGISTRY_H
#define QGSGPSCONNECTIONREGISTRY_H
#include <QList>
#include <QSet>
#include "qgis_core.h"
class QgsGPSConnection;
/** \ingroup core
* A class to register / unregister existing GPS connections such that the information
* is available to all classes and plugins.
*
* QgsGPSConnectionRegistry is not usually directly created, but rather accessed through
* QgsApplication::gpsConnectionRegistry().
*/
class CORE_EXPORT QgsGPSConnectionRegistry
{
public:
/**
* Constructor for QgsGPSConnectionRegistry.
*/
QgsGPSConnectionRegistry() = default;
~QgsGPSConnectionRegistry();
//! QgsGPSConnectionRegistry cannot be copied.
QgsGPSConnectionRegistry( const QgsGPSConnectionRegistry &rh ) = delete;
//! QgsGPSConnectionRegistry cannot be copied.
QgsGPSConnectionRegistry &operator=( const QgsGPSConnectionRegistry &rh ) = delete;
//! Inserts a connection into the registry. The connection is owned by the registry class until it is unregistered again
void registerConnection( QgsGPSConnection *c );
//! Unregisters connection. The registry does no longer own the connection
void unregisterConnection( QgsGPSConnection *c );
QList< QgsGPSConnection *> connectionList() const;
private:
#ifdef SIP_RUN
QgsGPSConnectionRegistry( const QgsGPSConnectionRegistry &rh );
#endif
QSet<QgsGPSConnection *> mConnections;
};
#endif // QGSGPSCONNECTIONREGISTRY_H