blob: f306f6171ef0905cdc27a7fd68a0230ed81489ca (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "queryreplicator.h"
#include "stackdumpquerycreator.h"
namespace search::query {
/**
* Holds functions for creating query trees, either from a stack dump
* or from another query tree. The traits specify the concrete
* subclasses to be used when building the tree.
*/
template <class NodeTypes>
struct QueryTreeCreator {
static Node::UP replicate(const Node &node) {
return QueryReplicator<NodeTypes>().replicate(node);
}
static Node::UP create(search::SimpleQueryStackDumpIterator &iterator) {
return StackDumpQueryCreator<NodeTypes>().create(iterator);
}
private:
QueryTreeCreator();
};
}
|