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

#pragma once

#include "state_explorer.h"
#include <vespa/vespalib/stllike/string.h>
#include <vespa/vespalib/data/slime/slime.h>
#include <vector>
#include <memory>

namespace vespalib {

/**
 * Simple class exposing the contents of a Slime object through the
 * StateExplorer interface (to be used when testing clients of the
 * StateExplorer interface).
 **/
class SlimeExplorer : public StateExplorer
{
private:
    const slime::Inspector &_self;

public:
    SlimeExplorer(const slime::Inspector &self) : _self(self) {}
    virtual void get_state(const slime::Inserter &inserter, bool full) const override;
    virtual std::vector<vespalib::string> get_children_names() const override;
    virtual std::unique_ptr<StateExplorer> get_child(vespalib::stringref name) const override;
};

} // namespace vespalib