labplot  2.8.2
About: LabPlot is an application for plotting and analysis of 2D and 3D functions and data. It is a complete rewrite of LabPlot1 and lacks in the first release a lot of features available in the predecessor. On the other hand, the GUI and the usability is more superior.
  Fossies Dox: labplot-2.8.2.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

MQTTSubscription.h
Go to the documentation of this file.
1 /***************************************************************************
2 File : MQTTSubscription.h
3 Project : LabPlot
4 Description : Represents a subscription made in MQTTClient
5 --------------------------------------------------------------------
6 Copyright : (C) 2018 Kovacs Ferencz (kferike98@gmail.com)
7 
8 ***************************************************************************/
9 
10 /***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 * This program is distributed in the hope that it will be useful, *
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
20 * GNU General Public License for more details. *
21 * *
22 * You should have received a copy of the GNU General Public License *
23 * along with this program; if not, write to the Free Software *
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
25 * Boston, MA 02110-1301 USA *
26 * *
27 ***************************************************************************/
28 
29 #ifndef MQTTSUBSCRIPTION_H
30 #define MQTTSUBSCRIPTION_H
31 
32 #include "backend/core/Folder.h"
33 
34 class MQTTClient;
35 class MQTTTopic;
36 class QString;
37 
38 class MQTTSubscription : public Folder {
39  Q_OBJECT
40 
41 public:
42  explicit MQTTSubscription(const QString& name);
43  ~MQTTSubscription() override;
44 
46  QString subscriptionName() const;
47  const QVector<MQTTTopic*> topics() const;
48  MQTTClient* mqttClient() const;
49  void messageArrived(const QString&, const QString&);
50 
51  QIcon icon() const override;
52  void save(QXmlStreamWriter*) const override;
53  bool load(XmlStreamReader*, bool preview) override;
54 
55 private:
58 
59 signals:
60  void loaded(const QString &);
61 };
62 
63 #endif // MQTTSUBSCRIPTION_H
QString name() const
Folder in a project.
Definition: Folder.h:35
The MQTT Client connects to the broker set in ImportFileWidget. It manages the MQTTSubscriptions,...
Definition: MQTTClient.h:48
Represents a subscription made in a MQTTClient object. It plays a role in managing MQTTTopic objects ...
QIcon icon() const override
Returns the icon of MQTTSubscription.
const QVector< MQTTTopic * > topics() const
Returns the object's MQTTTopic children.
MQTTClient * mqttClient() const
Returns the object's parent.
void setMQTTClient(MQTTClient *)
Sets the MQTTClient the subscription belongs to.
void messageArrived(const QString &, const QString &)
Called when a message arrived to a topic contained by the MQTTSubscription If the topic can't be foun...
QString m_subscriptionName
QString subscriptionName() const
Returns the subscription's name.
void loaded(const QString &)
~MQTTSubscription() override
bool load(XmlStreamReader *, bool preview) override
MQTTClient * m_MQTTClient
void save(QXmlStreamWriter *) const override
MQTTSubscription(const QString &name)
Represents a topic of a subscription made in MQTTClient.
Definition: MQTTTopic.h:39
XML stream parser that supports errors as well as warnings. This class also adds line and column numb...