diff options
Diffstat (limited to 'common/domain/applicationdomaintype.h')
-rw-r--r-- | common/domain/applicationdomaintype.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h index ca1ec1b..ce35af0 100644 --- a/common/domain/applicationdomaintype.h +++ b/common/domain/applicationdomaintype.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <QSharedPointer> | 23 | #include <QSharedPointer> |
24 | #include <QVariant> | 24 | #include <QVariant> |
25 | #include <QByteArray> | 25 | #include <QByteArray> |
26 | #include <QDebug> | ||
26 | #include "bufferadaptor.h" | 27 | #include "bufferadaptor.h" |
27 | 28 | ||
28 | namespace Sink { | 29 | namespace Sink { |
@@ -56,16 +57,18 @@ public: | |||
56 | 57 | ||
57 | virtual ~ApplicationDomainType(); | 58 | virtual ~ApplicationDomainType(); |
58 | 59 | ||
59 | virtual QVariant getProperty(const QByteArray &key) const; | 60 | QVariant getProperty(const QByteArray &key) const;; |
60 | virtual void setProperty(const QByteArray &key, const QVariant &value); | 61 | void setProperty(const QByteArray &key, const QVariant &value); |
61 | virtual QByteArrayList changedProperties() const; | 62 | void setChangedProperties(const QSet<QByteArray> &changeset); |
63 | QByteArrayList changedProperties() const; | ||
62 | qint64 revision() const; | 64 | qint64 revision() const; |
63 | QByteArray resourceInstanceIdentifier() const; | 65 | QByteArray resourceInstanceIdentifier() const; |
64 | QByteArray identifier() const; | 66 | QByteArray identifier() const; |
65 | 67 | ||
66 | private: | 68 | private: |
69 | friend QDebug operator<<(QDebug, const ApplicationDomainType &); | ||
67 | QSharedPointer<BufferAdaptor> mAdaptor; | 70 | QSharedPointer<BufferAdaptor> mAdaptor; |
68 | QHash<QByteArray, QVariant> mChangeSet; | 71 | QSet<QByteArray> mChangeSet; |
69 | /* | 72 | /* |
70 | * Each domain object needs to store the resource, identifier, revision triple so we can link back to the storage location. | 73 | * Each domain object needs to store the resource, identifier, revision triple so we can link back to the storage location. |
71 | */ | 74 | */ |
@@ -83,6 +86,16 @@ inline bool operator==(const ApplicationDomainType& lhs, const ApplicationDomain | |||
83 | && lhs.resourceInstanceIdentifier() == rhs.resourceInstanceIdentifier(); | 86 | && lhs.resourceInstanceIdentifier() == rhs.resourceInstanceIdentifier(); |
84 | } | 87 | } |
85 | 88 | ||
89 | inline QDebug operator<< (QDebug d, const ApplicationDomainType &type) | ||
90 | { | ||
91 | d << "ApplicationDomainType(\n"; | ||
92 | for (const auto &property : type.mAdaptor->availableProperties()) { | ||
93 | d << " " << property << "\t" << type.getProperty(property) << "\n"; | ||
94 | } | ||
95 | d << ")"; | ||
96 | return d; | ||
97 | } | ||
98 | |||
86 | struct SINKCOMMON_EXPORT Entity : public ApplicationDomainType { | 99 | struct SINKCOMMON_EXPORT Entity : public ApplicationDomainType { |
87 | typedef QSharedPointer<Entity> Ptr; | 100 | typedef QSharedPointer<Entity> Ptr; |
88 | using ApplicationDomainType::ApplicationDomainType; | 101 | using ApplicationDomainType::ApplicationDomainType; |