blob: 719ac40c7beea6aad02149f1b883b05e0b53cf4d (
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
30
31
32
33
34
35
36
37
38
39
|
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "bucketresultnode.h"
#include "rawresultnode.h"
namespace search {
namespace expression {
class RawBucketResultNode : public BucketResultNode
{
private:
ResultNode::CP _from;
ResultNode::CP _to;
static RawBucketResultNode _nullResult;
size_t onGetRawByteSize() const override { return sizeof(_from) + sizeof(_to); }
public:
struct GetValue {
BufferRef _tmp;
ConstBufferRef operator () (const ResultNode & r) { return r.getString(_tmp); }
};
DECLARE_EXPRESSIONNODE(RawBucketResultNode);
DECLARE_NBO_SERIALIZE;
RawBucketResultNode();
RawBucketResultNode(ResultNode::UP from, ResultNode::UP to) : _from(from.release()), _to(to.release()) {}
~RawBucketResultNode();
size_t hash() const override;
int onCmp(const Identifiable & b) const override;
int contains(const RawBucketResultNode & b) const;
int contains(const ConstBufferRef & v) const;
void visitMembers(vespalib::ObjectVisitor &visitor) const override;
const RawBucketResultNode& getNullBucket() const override { return getNull(); }
static const RawBucketResultNode & getNull() { return _nullResult; }
};
}
}
|