Kea 2.7.4
translator_class.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_CLASS_H
8#define ISC_TRANSLATOR_CLASS_H 1
9
12
13namespace isc {
14namespace yang {
15
69
76 virtual public TranslatorOptionDefList {
77public:
82 TranslatorClass(sysrepo::Session session, const std::string& model);
83
85 virtual ~TranslatorClass() = default;
86
94 isc::data::ElementPtr getClass(libyang::DataNode const& data_node);
95
108 isc::data::ElementPtr getClassFromAbsoluteXpath(std::string const& xpath);
109
114 void setClass(const std::string& xpath, isc::data::ConstElementPtr elem);
115
116protected:
124 isc::data::ElementPtr getClassKea(libyang::DataNode const& data_node);
125
130 void setClassKea(const std::string& xpath,
132}; // TranslatorClass
133
139class TranslatorClasses : virtual public TranslatorClass {
140public:
145 TranslatorClasses(sysrepo::Session session, const std::string& model);
146
148 virtual ~TranslatorClasses() = default;
149
157 isc::data::ElementPtr getClasses(libyang::DataNode const& data_node);
158
171 isc::data::ElementPtr getClassesFromAbsoluteXpath(std::string const& xpath);
172
177 void setClasses(const std::string& xpath,
179
180protected:
188 isc::data::ElementPtr getClassesKea(libyang::DataNode const& data_node);
189
196 void setClassesKea(const std::string& xpath,
198}; // TranslatorClasses
199
200} // namespace yang
201} // namespace isc
202
203#endif // ISC_TRANSLATOR_CLASS_H
Client class translation between YANG and JSON.
TranslatorClass(sysrepo::Session session, const std::string &model)
Constructor.
void setClassKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setClass for kea-dhcp[46].
void setClass(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set client class from JSON to YANG.
isc::data::ElementPtr getClassFromAbsoluteXpath(std::string const &xpath)
Translate a client class from YANG to JSON.
isc::data::ElementPtr getClass(libyang::DataNode const &data_node)
Translate a client class from YANG to JSON.
virtual ~TranslatorClass()=default
Destructor.
isc::data::ElementPtr getClassKea(libyang::DataNode const &data_node)
getClass JSON for kea-dhcp[46].
A translator class for converting a client class list between YANG and JSON.
isc::data::ElementPtr getClassesKea(libyang::DataNode const &data_node)
getClasses JSON for kea-dhcp[46].
isc::data::ElementPtr getClasses(libyang::DataNode const &data_node)
Translate client classes from YANG to JSON.
void setClassesKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setClasses for kea-dhcp[46].
virtual ~TranslatorClasses()=default
Destructor.
isc::data::ElementPtr getClassesFromAbsoluteXpath(std::string const &xpath)
Translate client classes from YANG to JSON.
void setClasses(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set client classes from JSON to YANG.
TranslatorClasses(sysrepo::Session session, const std::string &model)
Constructor.
A translator class for converting an option data list between YANG and JSON.
Currently supports kea-dhcp[46]-server models.
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.