summaryrefslogtreecommitdiffstats
path: root/common/indexer.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-10-20 13:34:38 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-10-21 09:18:50 +0200
commitda0c37dbad121252effa85941de4d49222176179 (patch)
tree6ea9831e80fc18dcae00cdf2788680bb8f4d1935 /common/indexer.cpp
parent0dcc8e2985acbff52c497648e4fbb54e47bf3b51 (diff)
downloadsink-da0c37dbad121252effa85941de4d49222176179.tar.gz
sink-da0c37dbad121252effa85941de4d49222176179.zip
A new indexer subsystem that can be used for indexes that are more
complex than a simple key-value pair.
Diffstat (limited to 'common/indexer.cpp')
-rw-r--r--common/indexer.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/common/indexer.cpp b/common/indexer.cpp
new file mode 100644
index 0000000..1b223b3
--- /dev/null
+++ b/common/indexer.cpp
@@ -0,0 +1,39 @@
1/*
2 * Copyright (C) 2015 Christian Mollekopf <chrigi_1@fastmail.fm>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19#include "indexer.h"
20
21using namespace Sink;
22
23void Indexer::setup(TypeIndex *index, Storage::DataStore::Transaction *transaction)
24{
25 mTypeIndex = index;
26 mTransaction = transaction;
27}
28
29Storage::DataStore::Transaction &Indexer::transaction()
30{
31 Q_ASSERT(mTransaction);
32 return *mTransaction;
33}
34
35TypeIndex &Indexer::index()
36{
37 Q_ASSERT(mTypeIndex);
38 return *mTypeIndex;
39}