store/query: access query only through store

Make Mu::Query only accessible through store, so we can lock the db for the
duration of a (full, multipass) query.
This commit is contained in:
Dirk-Jan C. Binnema
2022-01-30 14:28:30 +02:00
parent cc3be78dc5
commit 5fc8a8f83e
4 changed files with 158 additions and 59 deletions

View File

@ -30,26 +30,7 @@
namespace Mu {
class Query {
public:
/**
* Construct a new Query instance.
*
* @param store a MuStore object
*/
Query(const Store& store);
/**
* DTOR
*
*/
~Query();
/**
* Move CTOR
*
* @param other
*/
Query(Query&& other);
public:
/**
* Run a query on the store
*
@ -87,7 +68,28 @@ class Query {
*/
std::string parse(const std::string& expr, bool xapian) const;
private:
private:
friend class Store;
/**
* Construct a new Query instance.
*
* @param store a MuStore object
*/
Query(const Store& store);
/**
* DTOR
*
*/
~Query();
/**
* Move CTOR
*
* @param other
*/
Query(Query&& other);
struct Private;
std::unique_ptr<Private> priv_;
};