Kea  1.9.9-git
translator_option_def.h
Go to the documentation of this file.
1 // Copyright (C) 2018 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_DEF_H
8 #define ISC_TRANSLATOR_OPTION_DEF_H 1
9 
10 #include <yang/translator.h>
11 #include <list>
12 
13 namespace isc {
14 namespace yang {
15 
72 
78 class TranslatorOptionDef : virtual public TranslatorBasic {
79 public:
80 
85 #ifndef HAVE_PRE_0_7_6_SYSREPO
86  TranslatorOptionDef(sysrepo::S_Session session, const std::string& model);
87 #else
88  TranslatorOptionDef(S_Session session, const std::string& model);
89 #endif
90 
92  virtual ~TranslatorOptionDef();
93 
99  isc::data::ElementPtr getOptionDef(const std::string& xpath);
100 
105  void setOptionDef(const std::string& xpath,
107 
108 protected:
115  isc::data::ElementPtr getOptionDefKea(const std::string& xpath);
116 
122  void setOptionDefKea(const std::string& xpath,
124 };
125 
126 // @brief A translator class for converting an option definition list
127 // between YANG and JSON.
128 //
132 public:
133 
138 #ifndef HAVE_PRE_0_7_6_SYSREPO
139  TranslatorOptionDefList(sysrepo::S_Session session,
140  const std::string& model);
141 #else
142  TranslatorOptionDefList(S_Session session, const std::string& model);
143 #endif
144 
146  virtual ~TranslatorOptionDefList();
147 
152  isc::data::ConstElementPtr getOptionDefList(const std::string& xpath);
153 
158  void setOptionDefList(const std::string& xpath,
160 
161 protected:
167  isc::data::ConstElementPtr getOptionDefListKea(const std::string& xpath);
168 
175  void setOptionDefListKea(const std::string& xpath,
177 };
178 
179 }; // end of namespace isc::yang
180 }; // end of namespace isc
181 
182 #endif // ISC_TRANSLATOR_OPTION_DEF_H
Between YANG and JSON translator class for basic values.
Definition: translator.h:27
Currently supports kea-dhcp[46]-server models.
boost::shared_ptr< Element > ElementPtr
Definition: data.h:20
isc::data::ConstElementPtr getOptionDefList(const std::string &xpath)
Get and translate option definition list from YANG to JSON.
virtual ~TranslatorOptionDef()
Destructor.
void setOptionDefKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setOptionDef implementation specific to kea-dhcp[46]-server models.
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
TranslatorOptionDefList(sysrepo::S_Session session, const std::string &model)
Constructor.
void setOptionDefList(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set option definition list from JSON to YANG.
Defines the logger used by the top-level component of kea-dhcp-ddns.
TranslatorOptionDef(sysrepo::S_Session session, const std::string &model)
Constructor.
isc::data::ConstElementPtr getOptionDefListKea(const std::string &xpath)
getOptionDefList implementation specific to kea-dhcp[46]-server models.
isc::data::ElementPtr getOptionDefKea(const std::string &xpath)
getOptionDef implementation specific to kea-dhcp[46]-server models.
void setOptionDefListKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setOptionDefList implementation specific to kea-dhcp[46]-server models.
isc::data::ElementPtr getOptionDef(const std::string &xpath)
Get and translate an option definition from YANG to JSON.
Option definition translation between YANG and JSON.
void setOptionDef(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set option definition from JSON to YANG.