flow.h
Go to the documentation of this file.
1 #ifndef DNAI_MODELS_GUI_FLOW_H
2 #define DNAI_MODELS_GUI_FLOW_H
3 
4 #include <QObject>
7 #include "data/flow.h"
8 
9 namespace dnai
10 {
11  namespace models
12  {
13  namespace gui
14  {
15  class Flow : public QObject, public interfaces::IModelData<data::Flow>, public interfaces::ASerializable<Flow>
16  {
17  public:
18  void serialize(QJsonObject& obj) const override;
19  protected:
20  void _deserialize(const QJsonObject& obj) override;
21  public:
22  const data::Flow& data() const override;
23  bool setData(const data::Flow& data) override;
24 
25  Flow &operator=(const Flow &link) = default;
26  bool operator!=(const Flow &link) const
27  {
28  return !(*this == link);
29  }
30  bool operator==(const Flow &link) const
31  {
32  return (link.data() == m_data);
33  }
34  private:
36  };
37  }
38  }
39 }
40 
41 #endif //DNAI_MODELS_GUI_FLOW_H
Allow inherited class to serialize and deserialize itself.
Definition: iserializable.h:33
const data::Flow & data() const override
Return the data component.
Definition: flow.cpp:24
void serialize(QJsonObject &obj) const override
Implement this function to serialize into QJsonObject.
Definition: flow.cpp:12
void _deserialize(const QJsonObject &obj) override
Implement this function in order to use deserialize(const QJsonObject &obj)
Definition: flow.cpp:18
Definition: imodeldata.h:9
Flow & operator=(const Flow &link)=default
bool operator==(const Flow &link) const
Definition: flow.h:30
Definition: flow.h:15
bool setData(const data::Flow &data) override
Definition: flow.cpp:29
Definition: api.h:13
Definition: flow.h:14
bool operator!=(const Flow &link) const
Definition: flow.h:26
data::Flow m_data
Definition: flow.h:35