blob: b2f4a33cca142fefc05e4905ae8e8b6be7c09659 [file] [log] [blame]
Václav Kubernátab612e92019-11-26 19:51:31 +01001/*
2 * Copyright (C) 2019 CESNET, https://photonics.cesnet.cz/
3 *
4 * Written by Václav Kubernát <kubernat@cesnet.cz>
5 *
6*/
7
8#pragma once
9
10#include <boost/optional.hpp>
11#include <map>
12#include <memory>
13#include <set>
14#include "ast_values.hpp"
15#include "datastore_access.hpp"
16#include "schema.hpp"
17
18
19/*! \class DataQuery
20 * \brief A class used for querying data from a datastore for usage in tab-completion.
21 *
22*/
23class DataQuery {
24public:
25 DataQuery(DatastoreAccess& datastore);
26 /*! \brief Lists all possible instances of key/value pairs for a list specified by the arguments.
27 * \param location Location of the list.
28 * \param node Name (and optional module name) of the list.
29 * \return A vector of maps, which represent the instances. The map is keyed by the name of the list key. The values in the map, are values of the list keys.
30 */
31 std::vector<ListInstance> listKeys(const dataPath_& location, const ModuleNodePair& node) const;
32
33private:
34 DatastoreAccess& m_datastore;
35 std::shared_ptr<Schema> m_schema;
36};