summaryrefslogtreecommitdiffstats
path: root/common/domain
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-02-21 15:47:50 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-02-21 15:47:50 +0100
commitd2d8a85aa6c56195368f7ec563a98afb6861acd9 (patch)
treebabd7454902b7e3a83b82b04cf5ffca5720aca12 /common/domain
parent17f0dd179e9fd57b41b29abe84e7e49f9a7ac8a8 (diff)
downloadsink-d2d8a85aa6c56195368f7ec563a98afb6861acd9.tar.gz
sink-d2d8a85aa6c56195368f7ec563a98afb6861acd9.zip
Remember aggregated ids
Diffstat (limited to 'common/domain')
-rw-r--r--common/domain/applicationdomaintype.cpp16
-rw-r--r--common/domain/applicationdomaintype.h6
2 files changed, 22 insertions, 0 deletions
diff --git a/common/domain/applicationdomaintype.cpp b/common/domain/applicationdomaintype.cpp
index 8bb74e3..c315e33 100644
--- a/common/domain/applicationdomaintype.cpp
+++ b/common/domain/applicationdomaintype.cpp
@@ -184,6 +184,7 @@ ApplicationDomainType& ApplicationDomainType::operator=(const ApplicationDomainT
184 mResourceInstanceIdentifier = other.mResourceInstanceIdentifier; 184 mResourceInstanceIdentifier = other.mResourceInstanceIdentifier;
185 mIdentifier = other.mIdentifier; 185 mIdentifier = other.mIdentifier;
186 mRevision = other.mRevision; 186 mRevision = other.mRevision;
187 mAggreatedIds = other.mAggreatedIds;
187 return *this; 188 return *this;
188} 189}
189 190
@@ -262,6 +263,21 @@ QByteArray ApplicationDomainType::identifier() const
262 return mIdentifier; 263 return mIdentifier;
263} 264}
264 265
266bool ApplicationDomainType::isAggregate() const
267{
268 return !mAggreatedIds.isEmpty();
269}
270
271QVector<QByteArray> ApplicationDomainType::aggregatedIds() const
272{
273 return mAggreatedIds;
274}
275
276QVector<QByteArray> &ApplicationDomainType::aggregatedIds()
277{
278 return mAggreatedIds;
279}
280
265SinkResource::SinkResource(const QByteArray &identifier) 281SinkResource::SinkResource(const QByteArray &identifier)
266 : ApplicationDomainType("", identifier, 0, QSharedPointer<BufferAdaptor>(new MemoryBufferAdaptor())) 282 : ApplicationDomainType("", identifier, 0, QSharedPointer<BufferAdaptor>(new MemoryBufferAdaptor()))
267{ 283{
diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h
index b4db54e..dcd401c 100644
--- a/common/domain/applicationdomaintype.h
+++ b/common/domain/applicationdomaintype.h
@@ -268,6 +268,10 @@ public:
268 void setResource(const QByteArray &identifier); 268 void setResource(const QByteArray &identifier);
269 QByteArray identifier() const; 269 QByteArray identifier() const;
270 270
271 bool isAggregate() const;
272 QVector<QByteArray> aggregatedIds() const;
273 QVector<QByteArray> &aggregatedIds();
274
271private: 275private:
272 friend QDebug operator<<(QDebug, const ApplicationDomainType &); 276 friend QDebug operator<<(QDebug, const ApplicationDomainType &);
273 QSharedPointer<BufferAdaptor> mAdaptor; 277 QSharedPointer<BufferAdaptor> mAdaptor;
@@ -278,6 +282,8 @@ private:
278 QByteArray mResourceInstanceIdentifier; 282 QByteArray mResourceInstanceIdentifier;
279 QByteArray mIdentifier; 283 QByteArray mIdentifier;
280 qint64 mRevision; 284 qint64 mRevision;
285
286 QVector<QByteArray> mAggreatedIds;
281}; 287};
282 288
283/* 289/*