Kea 2.7.0
translator_option_data.h
Go to the documentation of this file.
1// Copyright (C) 2018-2024 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_OPTION_DATA_H
8#define ISC_TRANSLATOR_OPTION_DATA_H 1
9
10#include <yang/translator.h>
11
12namespace isc {
13namespace yang {
14
73
78class TranslatorOptionData : virtual public Translator {
79public:
84 TranslatorOptionData(sysrepo::Session session, const std::string& model);
85
87 virtual ~TranslatorOptionData() = default;
88
96 isc::data::ElementPtr getOptionData(libyang::DataNode const& data_node);
97
106
111 void setOptionData(const std::string& xpath,
113
114protected:
122 isc::data::ElementPtr getOptionDataKea(libyang::DataNode const& data_node);
123
128 void setOptionDataKea(const std::string& xpath,
130}; // TranslatorOptionData
131
137public:
142 TranslatorOptionDataList(sysrepo::Session session,
143 const std::string& model);
144
146 virtual ~TranslatorOptionDataList() = default;
147
155 isc::data::ConstElementPtr getOptionDataList(libyang::DataNode const& data_node);
156
165
170 void setOptionDataList(const std::string& xpath,
172
173protected:
179 isc::data::ConstElementPtr getOptionDataListKea(libyang::DataNode const& data_node);
180
186 void setOptionDataListKea(const std::string& xpath,
188}; // TranslatorOptionDataList
189
190} // namespace yang
191} // namespace isc
192
193#endif // ISC_TRANSLATOR_OPTION_DATA_H
A translator class for converting an option data list between YANG and JSON.
isc::data::ConstElementPtr getOptionDataListKea(libyang::DataNode const &data_node)
getOptionDataList for kea-dhcp[46].
void setOptionDataList(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set option data list from JSON to YANG.
virtual ~TranslatorOptionDataList()=default
Destructor.
TranslatorOptionDataList(sysrepo::Session session, const std::string &model)
Constructor.
void setOptionDataListKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setOptionDataList for kea-dhcp[46].
isc::data::ConstElementPtr getOptionDataList(libyang::DataNode const &data_node)
Translate option data list from YANG to JSON.
isc::data::ConstElementPtr getOptionDataListFromAbsoluteXpath(std::string const &xpath)
Translate option data list from YANG to JSON.
Option data translation between YANG and JSON.
virtual ~TranslatorOptionData()=default
Destructor.
isc::data::ElementPtr getOptionDataFromAbsoluteXpath(std::string const &xpath)
Translate an option data from YANG to JSON.
isc::data::ElementPtr getOptionDataKea(libyang::DataNode const &data_node)
getOptionData JSON for kea-dhcp[46].
TranslatorOptionData(sysrepo::Session session, const std::string &model)
Constructor.
isc::data::ElementPtr getOptionData(libyang::DataNode const &data_node)
Translate an option data from YANG to JSON.
void setOptionData(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set option data from JSON to YANG.
void setOptionDataKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setOptionData for kea-dhcp[46].
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.