CEventBasedNotifier.h
Go to the documentation of this file.
1 #ifndef istd_CEventBasedNotifier_included
2 #define istd_CEventBasedNotifier_included
3 
4 
5 // Qt includes
6 #include <QtCore/QObject>
7 
8 // ACF includes
9 #include <istd/CChangeNotifier.h>
10 #include <istd/TOptDelPtr.h>
11 
12 
13 namespace istd
14 {
15 
16 
17 class CAsyncNotifier;
18 
19 
26 {
27 public:
28  explicit CEventBasedNotifier(istd::IChangeable* slavePtr, const IChangeable::ChangeSet* changeSetPtr = &IChangeable::GetAnyChange());
29  virtual ~CEventBasedNotifier();
30 
31 private:
33 
34  CAsyncNotifier* m_asyncNotifierPtr;
35 };
36 
37 
43 class CAsyncNotifier: protected QObject
44 {
45  Q_OBJECT
46 
47  friend class CEventBasedNotifier;
48 
49 public:
51 
52 protected:
53  CAsyncNotifier(istd::IChangeable* slavePtr, const IChangeable::ChangeSet& changeSet);
54 
55 protected Q_SLOTS:
56  void DoBeginChanges();
57 
58 Q_SIGNALS:
59  void EmitBeginChanges();
60 
61 private:
65  istd::IChangeable* m_slavePtr;
66 
70  IChangeable::ChangeSet m_changeIds;
71 
75  bool m_isBeginCalled;
76 };
77 
78 
79 } // namespace istd
80 
81 
82 #endif // !istd_CEventBasedNotifier_included
83 
84 
static const ChangeSet & GetAnyChange()
Get anonymous change set.
Definition: IChangeable.h:381
Implementation of model changes notification between different threads.
Common interface for data model objects, which can be changed.
Definition: IChangeable.h:24
Set of change flags (its IDs).
Definition: IChangeable.h:30
CEventBasedNotifier(istd::IChangeable *slavePtr, const IChangeable::ChangeSet *changeSetPtr=&IChangeable::GetAnyChange())
CAsyncNotifier(istd::IChangeable *slavePtr, const IChangeable::ChangeSet &changeSet)

© 2007-2017 Witold Gantzke and Kirill Lepskiy