dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
ipconnectionconfiguration.h
Go to the documentation of this file.
1 
12 /*
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 3 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful, but
19  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  * for more details.
22  *
23  * You should have received a copy of the GNU General Public License along
24  * with this program; if not, see <http://www.gnu.org/licenses/>
25  */
26 
27 #ifndef IPconnectionCONFIGURATION_H
28 #define IPconnectionCONFIGURATION_H
29 
31 #include <QString>
32 #include <QSettings>
33 #include <QVector>
34 #include <QMetaType>
35 
36 using namespace Core;
37 
39 {
40  Q_OBJECT
41 
42 public:
43  explicit IPConnectionConfiguration(QString classId, QSettings *qSettings = nullptr,
44  QObject *parent = nullptr);
45 
46  virtual ~IPConnectionConfiguration();
47  void saveConfig() const;
48  void readConfig();
50 
51  enum Protocol {
54  };
55 
56  struct Host
57  {
58  Protocol protocol = ProtocolTcp;
59  QString hostname = "localhost";
60  int port = 9000;
61 
62  inline bool operator==(const Host &rhs) const
63  {
64  return protocol == rhs.protocol && port == rhs.port && hostname == rhs.hostname;
65  }
66  };
67 
68  QVector<Host> &hosts() { return m_hosts; }
69  void setHosts(QVector<Host> &hosts) { m_hosts = hosts; }
70 
71 private:
72  QVector<Host> m_hosts;
73 };
74 
76 
77 #endif // IPconnectionCONFIGURATION_H
void setHosts(QVector< Host > &hosts)
bool operator==(const Host &rhs) const
Q_DECLARE_METATYPE(Core::Internal::MenuActionContainer *) using namespace Core
UAVDataObject * clone(quint32 instID)