aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/data/slime/empty_value_factory.h
blob: 8c8fe221a02e5dd43d6e99bf16b11f6b5dd2c081 (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "value_factory.h"
#include "nix_value.h"

namespace vespalib::slime {

struct NixValueFactory final : public ValueFactory {
    Value *create(Stash &) const override { return NixValue::instance(); }
};

struct ArrayValueFactory final : public ValueFactory {
    SymbolTable &symbolTable;
    size_t _reserve;
    ArrayValueFactory(SymbolTable &table, size_t reserve) noexcept : symbolTable(table), _reserve(reserve) {}
    Value *create(Stash & stash) const override;
};

struct ObjectValueFactory final : public ValueFactory {
    SymbolTable &symbolTable;
    ObjectValueFactory(SymbolTable &table) noexcept : symbolTable(table) {}
    Value *create(Stash & stash) const override;
};

} // namespace vespalib::slime