aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/data/slime/empty_value_factory.cpp
blob: 749644081124b659be78989afa2a4c5fe2dddd6e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "empty_value_factory.h"
#include "object_value.h"
#include "array_value.h"
#include <vespa/vespalib/util/stash.h>

namespace vespalib::slime {

Value *
ArrayValueFactory::create(Stash & stash) const {
    ArrayValue & arr = stash.create<ArrayValue>(symbolTable, stash);
    arr.reserve(_reserve);
    return &arr;
}

Value *
ObjectValueFactory::create(Stash & stash) const {
    return & stash.create<ObjectValue>(symbolTable, stash);
}

} // namespace vespalib::slime