Kea 2.5.7
translator_database.h
Go to the documentation of this file.
1// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef ISC_TRANSLATOR_DATABASE_H
8#define ISC_TRANSLATOR_DATABASE_H 1
9
10#include <yang/translator.h>
11
12namespace isc {
13namespace yang {
14
96
103class TranslatorDatabase : virtual public Translator {
104public:
109 TranslatorDatabase(sysrepo::Session session, const std::string& model);
110
112 virtual ~TranslatorDatabase() = default;
113
121 isc::data::ElementPtr getDatabase(libyang::DataNode const& data_node);
122
135 isc::data::ElementPtr getDatabaseFromAbsoluteXpath(std::string const& xpath);
136
144 void setDatabase(const std::string& xpath,
146 bool skip = false);
147
148protected:
156 isc::data::ElementPtr getDatabaseKea(libyang::DataNode const& data_node);
157
164 void setDatabaseKea(const std::string& xpath,
166 bool skip);
167}; // TranslatorDatabase
168
174public:
179 TranslatorDatabases(sysrepo::Session session, const std::string& model);
180
182 virtual ~TranslatorDatabases() = default;
183
192 isc::data::ElementPtr getDatabases(libyang::DataNode const& data_node,
193 std::string const& xpath);
194
208
215 void setDatabases(const std::string& xpath,
217
218protected:
227 isc::data::ElementPtr getDatabasesKea(libyang::DataNode const& data_node,
228 std::string const& xpath);
229
236 void setDatabasesKea(const std::string& xpath,
238}; // TranslatorDatabases
239
240} // namespace yang
241} // namespace isc
242
243#endif // ISC_TRANSLATOR_DATABASE_H
Database access translation between YANG and JSON.
isc::data::ElementPtr getDatabaseKea(libyang::DataNode const &data_node)
getDatabase JSON for kea-dhcp[46]-server models.
isc::data::ElementPtr getDatabase(libyang::DataNode const &data_node)
Translate a database access from YANG to JSON.
isc::data::ElementPtr getDatabaseFromAbsoluteXpath(std::string const &xpath)
Translate a database access from YANG to JSON.
void setDatabase(const std::string &xpath, isc::data::ConstElementPtr elem, bool skip=false)
Translate and set database access from JSON to YANG.
virtual ~TranslatorDatabase()=default
Destructor.
void setDatabaseKea(const std::string &xpath, isc::data::ConstElementPtr elem, bool skip)
setDatabase for kea-dhcp[46]-server models.
A translator class for converting a database access list between YANG and JSON.
void setDatabasesKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setDatabases for kea-dhcp[46]-server models.
isc::data::ElementPtr getDatabasesFromAbsoluteXpath(std::string const &xpath)
Translate database accesses from YANG to JSON.
void setDatabases(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set database accesses from JSON to YANG.
isc::data::ElementPtr getDatabases(libyang::DataNode const &data_node, std::string const &xpath)
Translate database accesses from YANG to JSON.
virtual ~TranslatorDatabases()=default
Destructor.
isc::data::ElementPtr getDatabasesKea(libyang::DataNode const &data_node, std::string const &xpath)
getDatabases JSON for kea-dhcp[46]-server models.
Between YANG and JSON translator class for basic values.
Definition: translator.h:23
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:29
boost::shared_ptr< Element > ElementPtr
Definition: data.h:28
Defines the logger used by the top-level component of kea-lfc.