swift
listjournal.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2020 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_MISC_SHAREDSTATE_LISTJOURNAL_H
7 #define SWIFT_MISC_SHAREDSTATE_LISTJOURNAL_H
8 
9 #include <QMutex>
10 #include <QObject>
11 
14 #include "misc/swiftmiscexport.h"
15 #include "misc/variantlist.h"
16 
18 {
19  class IDataLink;
20 
25  class SWIFT_MISC_EXPORT CGenericListJournal : public QObject
26  {
27  Q_OBJECT
28 
29  public:
31  void initialize(IDataLink *);
32 
33  protected:
35  CGenericListJournal(QObject *parent) : QObject(parent) {}
36 
37  private:
38  CVariant handleRequest(const CVariant &filter);
39  void handleEvent(const CVariant &param);
40 
41  QSharedPointer<CActiveMutator> m_mutator = CActiveMutator::create(this, &CGenericListJournal::handleRequest);
42  QSharedPointer<CPassiveObserver> m_observer = CPassiveObserver::create(this, &CGenericListJournal::handleEvent);
43  CVariantList m_value;
44  };
45 
51  template <typename T>
53  {
54  protected:
56  CListJournal(QObject *parent) : CGenericListJournal(parent) {}
57  };
58 } // namespace swift::misc::shared_state
59 
60 #endif // SWIFT_MISC_SHAREDSTATE_LISTJOURNAL_H
Wrapper around QVariant which provides transparent access to CValueObject methods of the contained ob...
Definition: variant.h:66
Value object encapsulating a list of variants.
Definition: variantlist.h:29
static auto create(T *parent, F requestHandler)
Factory method.
Definition: activemutator.h:39
Non-template base class for CListJournal.
Definition: listjournal.h:26
CGenericListJournal(QObject *parent)
Constructor.
Definition: listjournal.h:35
Base class for an object that shares state with a corresponding CListObserver subclass object.
Definition: listjournal.h:53
CListJournal(QObject *parent)
Constructor.
Definition: listjournal.h:56
static auto create(T *parent, F eventHandler)
Factory method.
Utilities for sharing state between multiple objects.
Definition: application.h:48
#define SWIFT_MISC_EXPORT
Export a class or function from the library.