summaryrefslogtreecommitdiffstats
path: root/common/entityreader.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/entityreader.h')
-rw-r--r--common/entityreader.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/common/entityreader.h b/common/entityreader.h
index 1e7b086..a641106 100644
--- a/common/entityreader.h
+++ b/common/entityreader.h
@@ -30,9 +30,9 @@
30namespace Sink { 30namespace Sink {
31 31
32namespace EntityReaderUtils { 32namespace EntityReaderUtils {
33 SINK_EXPORT QSharedPointer<Sink::ApplicationDomain::BufferAdaptor> getLatest(const Sink::Storage::NamedDatabase &db, const QByteArray &uid, DomainTypeAdaptorFactoryInterface &adaptorFactory, qint64 &retrievedRevision); 33 SINK_EXPORT QSharedPointer<Sink::ApplicationDomain::BufferAdaptor> getLatest(const Sink::Storage::DataStore::NamedDatabase &db, const QByteArray &uid, DomainTypeAdaptorFactoryInterface &adaptorFactory, qint64 &retrievedRevision);
34 SINK_EXPORT QSharedPointer<Sink::ApplicationDomain::BufferAdaptor> get(const Sink::Storage::NamedDatabase &db, const QByteArray &key, DomainTypeAdaptorFactoryInterface &adaptorFactory, qint64 &retrievedRevision); 34 SINK_EXPORT QSharedPointer<Sink::ApplicationDomain::BufferAdaptor> get(const Sink::Storage::DataStore::NamedDatabase &db, const QByteArray &key, DomainTypeAdaptorFactoryInterface &adaptorFactory, qint64 &retrievedRevision);
35 SINK_EXPORT QSharedPointer<Sink::ApplicationDomain::BufferAdaptor> getPrevious(const Sink::Storage::NamedDatabase &db, const QByteArray &uid, qint64 revision, DomainTypeAdaptorFactoryInterface &adaptorFactory, qint64 &retrievedRevision); 35 SINK_EXPORT QSharedPointer<Sink::ApplicationDomain::BufferAdaptor> getPrevious(const Sink::Storage::DataStore::NamedDatabase &db, const QByteArray &uid, qint64 revision, DomainTypeAdaptorFactoryInterface &adaptorFactory, qint64 &retrievedRevision);
36}; 36};
37 37
38/** 38/**
@@ -41,7 +41,7 @@ namespace EntityReaderUtils {
41 * All callbacks will be called before the end of the function. 41 * All callbacks will be called before the end of the function.
42 * The caller must ensure passed in references remain valid for the lifetime of the object. 42 * The caller must ensure passed in references remain valid for the lifetime of the object.
43 * 43 *
44 * This class is meaent to be instantiated temporarily during reads on the stack. 44 * This class is meant to be instantiated temporarily during reads on the stack.
45 * 45 *
46 * Note that all objects returned in callbacks are only valid during the execution of the callback and may start pointing into invalid memory if shallow-copied. 46 * Note that all objects returned in callbacks are only valid during the execution of the callback and may start pointing into invalid memory if shallow-copied.
47 */ 47 */
@@ -51,8 +51,7 @@ class SINK_EXPORT EntityReader
51 typedef std::function<bool(const typename DomainType::Ptr &domainObject, Sink::Operation operation, const QMap<QByteArray, QVariant> &aggregateValues)> ResultCallback; 51 typedef std::function<bool(const typename DomainType::Ptr &domainObject, Sink::Operation operation, const QMap<QByteArray, QVariant> &aggregateValues)> ResultCallback;
52 52
53public: 53public:
54 EntityReader(const QByteArray &resourceType, const QByteArray &mResourceInstanceIdentifier, Sink::Storage::Transaction &transaction); 54 EntityReader(Storage::EntityStore &store);
55 EntityReader(DomainTypeAdaptorFactoryInterface &domainTypeAdaptorFactory, const QByteArray &resourceInstanceIdentifier, Sink::Storage::Transaction &transaction);
56 55
57 /** 56 /**
58 * Reads the latest revision of an entity identified by @param uid 57 * Reads the latest revision of an entity identified by @param uid
@@ -90,10 +89,7 @@ private:
90 qint64 replaySet(ResultSet &resultSet, int offset, int batchSize, const ResultCallback &callback); 89 qint64 replaySet(ResultSet &resultSet, int offset, int batchSize, const ResultCallback &callback);
91 90
92private: 91private:
93 QByteArray mResourceInstanceIdentifier; 92 Sink::Storage::EntityStore &mEntityStore;
94 Sink::Storage::Transaction &mTransaction;
95 std::shared_ptr<DomainTypeAdaptorFactoryInterface> mDomainTypeAdaptorFactoryPtr;
96 DomainTypeAdaptorFactoryInterface &mDomainTypeAdaptorFactory;
97}; 93};
98 94
99} 95}