##// END OF EJS Templates
Add VariableSynchronizationGroup
perrinel -
r537:8c1ac858caa5
parent child
Show More
@@ -0,0 +1,38
1 #ifndef SCIQLOP_VARIABLESYNCHRONIZATIONGROUP_H
2 #define SCIQLOP_VARIABLESYNCHRONIZATIONGROUP_H
3
4 #include "CoreGlobal.h"
5
6 #include <QLoggingCategory>
7 #include <QObject>
8 #include <QUuid>
9
10 #include <Data/SqpRange.h>
11
12 #include <set>
13
14 #include <QLoggingCategory>
15
16 #include <Common/spimpl.h>
17
18 Q_DECLARE_LOGGING_CATEGORY(LOG_VariableSynchronizationGroup)
19
20 class Variable;
21
22 /// This class aims to hande the cache strategy.
23 class SCIQLOP_CORE_EXPORT VariableSynchronizationGroup : public QObject {
24 Q_OBJECT
25 public:
26 explicit VariableSynchronizationGroup(QObject *parent = 0);
27
28 void addVariableId(QUuid vIdentifier);
29 void removeVariableId(QUuid vIdentifier);
30
31 const std::set<QUuid> &getIds() const noexcept;
32
33 private:
34 class VariableSynchronizationGroupPrivate;
35 spimpl::unique_impl_ptr<VariableSynchronizationGroupPrivate> impl;
36 };
37
38 #endif // SCIQLOP_VARIABLESYNCHRONIZATIONGROUP_H
@@ -0,0 +1,32
1 #include "Variable/VariableSynchronizationGroup.h"
2
3 #include "Variable/Variable.h"
4
5
6 Q_LOGGING_CATEGORY(LOG_VariableSynchronizationGroup, "VariableSynchronizationGroup")
7
8 struct VariableSynchronizationGroup::VariableSynchronizationGroupPrivate {
9
10 std::set<QUuid> m_VariableIdSet;
11 };
12
13
14 VariableSynchronizationGroup::VariableSynchronizationGroup(QObject *parent)
15 : QObject{parent}, impl{spimpl::make_unique_impl<VariableSynchronizationGroupPrivate>()}
16 {
17 }
18
19 void VariableSynchronizationGroup::addVariableId(QUuid vIdentifier)
20 {
21 impl->m_VariableIdSet.insert(vIdentifier);
22 }
23
24 void VariableSynchronizationGroup::removeVariableId(QUuid vIdentifier)
25 {
26 impl->m_VariableIdSet.erase(vIdentifier);
27 }
28
29 const std::set<QUuid> &VariableSynchronizationGroup::getIds() const noexcept
30 {
31 return impl->m_VariableIdSet;
32 }
General Comments 0
You need to be logged in to leave comments. Login now