aboutsummaryrefslogtreecommitdiffstats
path: root/document/src/vespa/document/fieldvalue/iteratorhandler.cpp
blob: 7af1eec52b2b42222995b267bd40222a555d9689 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.


#include "iteratorhandler.h"

namespace document::fieldvalue {

IteratorHandler::IteratorHandler()
    : _weight(1),
      _arrayIndexStack(1, 0),
      _variables()
{
}

IteratorHandler::~IteratorHandler() = default;


void
IteratorHandler::handlePrimitive(uint32_t fid, const FieldValue & fv) {
    onPrimitive(fid, Content(fv, getWeight()));
}
bool
IteratorHandler::handleComplex(const FieldValue & fv) {
    return onComplex(Content(fv, getWeight()));
}
void
IteratorHandler::handleCollectionStart(const FieldValue & fv) {
    _arrayIndexStack.push_back(0);
    onCollectionStart(Content(fv, getWeight()));
}
void
IteratorHandler::handleCollectionEnd(const FieldValue & fv) {
    onCollectionEnd(Content(fv, getWeight()));
    _arrayIndexStack.pop_back();
}
void
IteratorHandler::handleStructStart(const FieldValue & fv) {
    onStructStart(Content(fv, getWeight()));
}
void
IteratorHandler::handleStructEnd(const FieldValue & fv) {
    onStructEnd(Content(fv, getWeight()));
}

void
IteratorHandler::onPrimitive(uint32_t fid, const Content & fv) {
    (void) fid;
    (void) fv;
}

}