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 Class Reference

Represents a subscription made in a MQTTClient object. It plays a role in managing MQTTTopic objects and makes possible representing the subscriptions and topics in a tree like structure. More...

#include <MQTTSubscription.h>

Inheritance diagram for MQTTSubscription:
[legend]
Collaboration diagram for MQTTSubscription:
[legend]

Signals

void loaded (const QString &)
 
- Signals inherited from AbstractAspect
void aspectDescriptionAboutToChange (const AbstractAspect *)
 Emitted before the name, comment or caption spec is changed. More...
 
void aspectDescriptionChanged (const AbstractAspect *)
 Emitted after the name, comment or caption spec have changed. More...
 
void aspectAboutToBeAdded (const AbstractAspect *parent, const AbstractAspect *before, const AbstractAspect *child)
 Emitted before a new child is inserted. More...
 
void aspectAdded (const AbstractAspect *)
 Emitted after a new Aspect has been added to the tree. More...
 
void aspectAboutToBeRemoved (const AbstractAspect *)
 Emitted before an aspect is removed from its parent. More...
 
void aspectRemoved (const AbstractAspect *parent, const AbstractAspect *before, const AbstractAspect *child)
 Emitted from the parent after removing a child. More...
 
void aspectHiddenAboutToChange (const AbstractAspect *)
 Emitted before the hidden attribute is changed. More...
 
void aspectHiddenChanged (const AbstractAspect *)
 Emitted after the hidden attribute has changed. More...
 
void statusInfo (const QString &)
 Emitted whenever some aspect in the tree wants to give status information to the user. More...
 
void renameRequested ()
 
void selected (const AbstractAspect *)
 
void deselected (const AbstractAspect *)
 
void childAspectSelectedInView (const AbstractAspect *)
 
void childAspectDeselectedInView (const AbstractAspect *)
 

Public Member Functions

 MQTTSubscription (const QString &name)
 
 ~MQTTSubscription () override
 
void setMQTTClient (MQTTClient *)
 Sets the MQTTClient the subscription belongs to. More...
 
QString subscriptionName () const
 Returns the subscription's name. More...
 
const QVector< MQTTTopic * > topics () const
 Returns the object's MQTTTopic children. More...
 
MQTTClientmqttClient () const
 Returns the object's parent. More...
 
void messageArrived (const QString &, const QString &)
 Called when a message arrived to a topic contained by the MQTTSubscription If the topic can't be found among the children, a new MQTTTopic is instantiated Passes the messages to the appropriate MQTTTopic. More...
 
QIcon icon () const override
 Returns the icon of MQTTSubscription. More...
 
void save (QXmlStreamWriter *) const override
 
bool load (XmlStreamReader *, bool preview) override
 
- Public Member Functions inherited from Folder
 Folder (const QString &name, AspectType type=AspectType::Folder)
 
QMenu * createContextMenu () override
 Return a new context menu. More...
 
void setPathesToLoad (const QStringList &)
 
const QStringList & pathesToLoad () const
 
bool isDraggable () const override
 
QVector< AspectTypedropableOn () const override
 
void processDropEvent (const QVector< quintptr > &) override
 
- Public Member Functions inherited from AbstractAspect
 AbstractAspect (const QString &name, AspectType type)
 
 ~AbstractAspect () override
 
QString name () const
 
QString comment () const
 
void setCreationTime (const QDateTime &)
 
QDateTime creationTime () const
 
virtual Projectproject ()
 Return the Project this Aspect belongs to, or 0 if it is currently not part of one. More...
 
virtual QString path () const
 Return the path that leads from the top-most Aspect (usually a Project) to me. More...
 
void setHidden (bool)
 Set "hidden" property, i.e. whether to exclude this aspect from being shown in the explorer. More...
 
bool hidden () const
 
void setIsLoading (bool)
 
bool isLoading () const
 
AspectType type () const
 
bool inherits (AspectType type) const
 
AbstractAspectparentAspect () const
 Return my parent Aspect or 0 if I currently don't have one. More...
 
AbstractAspectparent (AspectType type) const
 In the parent-child hierarchy, return the first parent of type. More...
 
void setParentAspect (AbstractAspect *)
 
Folderfolder ()
 Return the folder the Aspect is contained in or 0 if there is none. More...
 
bool isDescendantOf (AbstractAspect *other)
 Return whether the there is a path upwards to the given aspect. More...
 
void addChild (AbstractAspect *)
 Add the given Aspect to my list of children. More...
 
void addChildFast (AbstractAspect *)
 Add the given Aspect to my list of children without any checks and without putting this step onto the undo-stack. More...
 
virtual void finalizeAdd ()
 
QVector< AbstractAspect * > children (AspectType type, ChildIndexFlags flags={}) const
 
void insertChildBefore (AbstractAspect *child, AbstractAspect *before)
 Insert the given Aspect at a specific position in my list of children. More...
 
void insertChildBeforeFast (AbstractAspect *child, AbstractAspect *before)
 Insert the given Aspect at a specific position in my list of children.without any checks and without putting this step onto the undo-stack. More...
 
void reparent (AbstractAspect *newParent, int newIndex=-1)
 Move a child to another parent aspect and transfer ownership. More...
 
void removeChild (AbstractAspect *)
 Remove the given Aspect from my list of children. More...
 
void removeAllChildren ()
 Remove all child Aspects. More...
 
virtual QVector< AbstractAspect * > dependsOn () const
 
template<class T >
T * ancestor () const
 Return the closest ancestor of class T (or NULL if none found). More...
 
template<class T >
QVector< T * > children (ChildIndexFlags flags={}) const
 
template<class T >
T * child (int index, ChildIndexFlags flags={}) const
 
template<class T >
T * child (const QString &name) const
 Get child by name and class. More...
 
template<class T >
int childCount (ChildIndexFlags flags={}) const
 Return the number of child Aspects inheriting from given class. More...
 
template<class T >
int indexOfChild (const AbstractAspect *child, ChildIndexFlags flags={}) const
 Return (0 based) index of child in the list of children inheriting from class T. More...
 
void setSelected (bool)
 
void setUndoAware (bool)
 
virtual QUndoStack * undoStack () const
 Return the undo stack of the Project, or 0 if this Aspect is not part of a Project. More...
 
void exec (QUndoCommand *)
 Execute the given command, pushing it on the undoStack() if available. More...
 
void exec (QUndoCommand *command, const char *preChangeSignal, const char *postChangeSignal, QGenericArgument val0=QGenericArgument(), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument())
 Execute command and arrange for signals to be sent before/after it is redone or undone. More...
 
void beginMacro (const QString &text)
 Begin an undo stack macro (series of commands) More...
 
void endMacro ()
 End the current undo stack macro. More...
 

Private Attributes

QString m_subscriptionName
 
MQTTClientm_MQTTClient {nullptr}
 

Additional Inherited Members

- Public Types inherited from AbstractAspect
enum class  ChildIndexFlag { IncludeHidden = 0x01 , Recursive = 0x02 , Compress = 0x04 }
 Flags which control numbering scheme of children. More...
 
- Public Slots inherited from AbstractAspect
bool setName (const QString &, bool autoUnique=true)
 AbstractAspect::setName sets the name of the abstract aspect. More...
 
void setComment (const QString &)
 
void remove ()
 Remove me from my parent's list of children. More...
 
- Protected Slots inherited from AbstractAspect
virtual void childSelected (const AbstractAspect *)
 
virtual void childDeselected (const AbstractAspect *)
 
- Protected Member Functions inherited from Folder
bool readChildAspectElement (XmlStreamReader *, bool preview)
 Read child aspect from XML. More...
 
- Protected Member Functions inherited from AbstractAspect
void info (const QString &text)
 Implementations should call this whenever status information should be given to the user. More...
 
bool readBasicAttributes (XmlStreamReader *)
 Load name and creation time from XML. More...
 
void writeBasicAttributes (QXmlStreamWriter *) const
 Save name and creation time to XML. More...
 
void writeCommentElement (QXmlStreamWriter *) const
 Save the comment to XML. More...
 
bool readCommentElement (XmlStreamReader *)
 Load comment from an XML element. More...
 
- Protected Attributes inherited from AbstractAspect
const AspectType m_type
 

Detailed Description

Represents a subscription made in a MQTTClient object. It plays a role in managing MQTTTopic objects and makes possible representing the subscriptions and topics in a tree like structure.

File : MQTTSubscription.cpp Project : LabPlot

Description : Represents a subscription made in MQTTClient

Copyright : (C) 2018 Kovacs Ferencz (kferi.nosp@m.ke98.nosp@m.@gmai.nosp@m.l.co.nosp@m.m)

  • 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. *
  • This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. *
  • You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA *

Definition at line 38 of file MQTTSubscription.h.

Constructor & Destructor Documentation

◆ MQTTSubscription()

MQTTSubscription::MQTTSubscription ( const QString &  name)
explicit

Definition at line 42 of file MQTTSubscription.cpp.

References AbstractAspect::name().

◆ ~MQTTSubscription()

MQTTSubscription::~MQTTSubscription ( )
override

Definition at line 47 of file MQTTSubscription.cpp.

References m_subscriptionName.

Member Function Documentation

◆ icon()

QIcon MQTTSubscription::icon ( ) const
overridevirtual

Returns the icon of MQTTSubscription.

Reimplemented from Folder.

Definition at line 127 of file MQTTSubscription.cpp.

◆ load()

bool MQTTSubscription::load ( XmlStreamReader reader,
bool  preview 
)
overridevirtual

◆ loaded

void MQTTSubscription::loaded ( const QString &  )
signal

Referenced by MQTTClient::load(), and load().

◆ messageArrived()

void MQTTSubscription::messageArrived ( const QString &  message,
const QString &  topicName 
)

Called when a message arrived to a topic contained by the MQTTSubscription If the topic can't be found among the children, a new MQTTTopic is instantiated Passes the messages to the appropriate MQTTTopic.

Parameters
messagethe message to pass
topicNamethe name of the topic the message was sent to

Definition at line 77 of file MQTTSubscription.cpp.

References AbstractAspect::addChildFast(), MQTTClient::isPaused(), m_MQTTClient, MQTTTopic, MQTTClient::NewData, topics(), and MQTTClient::updateType().

◆ mqttClient()

MQTTClient * MQTTSubscription::mqttClient ( ) const

Returns the object's parent.

Returns
a pointer to the parent MQTTTopic of the object

Definition at line 65 of file MQTTSubscription.cpp.

References m_MQTTClient.

Referenced by GuiObserver::selectedAspectsChanged().

◆ save()

void MQTTSubscription::save ( QXmlStreamWriter *  writer) const
overridevirtual

◆ setMQTTClient()

void MQTTSubscription::setMQTTClient ( MQTTClient client)

Sets the MQTTClient the subscription belongs to.

Parameters
client

Definition at line 120 of file MQTTSubscription.cpp.

References m_MQTTClient.

◆ subscriptionName()

QString MQTTSubscription::subscriptionName ( ) const

Returns the subscription's name.

Returns
m_subscriptionName

Definition at line 111 of file MQTTSubscription.cpp.

References m_subscriptionName.

Referenced by load().

◆ topics()

const QVector< MQTTTopic * > MQTTSubscription::topics ( ) const

Returns the object's MQTTTopic children.

Returns
a vector of pointers to the children of the MQTTSubscription

Definition at line 56 of file MQTTSubscription.cpp.

Referenced by MQTTClient::addBeforeRemoveSubscription(), messageArrived(), and MQTTClient::removeMQTTSubscription().

Member Data Documentation

◆ m_MQTTClient

MQTTClient* MQTTSubscription::m_MQTTClient {nullptr}
private

Definition at line 57 of file MQTTSubscription.h.

Referenced by messageArrived(), mqttClient(), and setMQTTClient().

◆ m_subscriptionName

QString MQTTSubscription::m_subscriptionName
private

Definition at line 56 of file MQTTSubscription.h.

Referenced by load(), save(), subscriptionName(), and ~MQTTSubscription().


The documentation for this class was generated from the following files: