]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[65-libyang-class] Addressed class comments 65-libyang-class
authorFrancis Dupont <fdupont@isc.org>
Mon, 22 Oct 2018 11:21:03 +0000 (13:21 +0200)
committerFrancis Dupont <fdupont@isc.org>
Mon, 22 Oct 2018 11:22:21 +0000 (07:22 -0400)
src/lib/yang/tests/translator_class_unittests.cc
src/lib/yang/translator_class.h
src/lib/yang/yang.dox

index d6eea31ffdb3cc2de43776ed06abbc254c0d3031..c7a9b5999fa6cd4c3e0fc2e11ef896b15a88ed5c 100644 (file)
@@ -41,7 +41,7 @@ public:
 TEST_F(TranslatorClassesTest, getEmpty) {
     useModel(KEA_DHCP4_SERVER);
 
-    // Get the client class list and checks it is empty.
+    // Get the client class list and check if it is empty.
     const string& xpath = "/kea-dhcp4-server:config/client-classes";
     ConstElementPtr classes;
     EXPECT_NO_THROW(classes = t_obj_->getClasses(xpath));
@@ -69,7 +69,7 @@ TEST_F(TranslatorClassesTest, get) {
     expected->set("test", Element::create(string("not member('ALL')")));
     EXPECT_TRUE(expected->equals(*cclass));
 
-    // Get the client class list and checks the client class is in it.
+    // Get the client class list and check if the client class is in it.
     ConstElementPtr classes;
     EXPECT_NO_THROW(classes = t_obj_->getClasses(xpath));
     ASSERT_TRUE(classes);
@@ -110,7 +110,7 @@ TEST_F(TranslatorClassesTest, set) {
     ElementPtr cclass = Element::createMap();
     cclass->set("name", Element::create(string("foo")));
     cclass->set("test", Element::create(string("''==''")));
-    cclass->set("only-if-required",Element::create(false));
+    cclass->set("only-if-required", Element::create(false));
     classes->add(cclass);
     EXPECT_NO_THROW(t_obj_->setClasses(xpath, classes));
 
index 23087edcfdd3acce4ed1bd637b36082dc4cb56ae..27ab642095fa213f2ea946982d98e006aef794c1 100644 (file)
@@ -160,7 +160,6 @@ protected:
 
     /// @brief setClasses for kea-dhcp[46].
     ///
-    ///
     /// @param xpath The xpath of classes.
     /// @param elem The JSON element.
     /// @throw BadValue on client class without name.
index f816765c6f4a6335eb07e73fb19b41551bd064a5..c21e72f11e14d5272b85430848cdc2a3a1422890 100644 (file)
@@ -56,6 +56,18 @@ Note pools show two shortcomings in IETF models:
  - option sets make to track changes nearly impossible: the only easy
   code is to translate the whole configuration.
  - prefix and start - end forms of pool ranges are both mandatory.
+  (reported to authors' so should be fixed in the next version).
+
+All structure translators depend on @c isc::yang::TranslatorBasic and
+some of them depend on other structures, for instance
+@c isc::yang::TranslatorPool depends on
+@c isc::yang::TranslatorOptionDataList which itself as all list translators
+depends on the corresponding list item translator
+@c isc::yang::TranslatorOptionData. This multiple inheritance forms
+a graph with the basic and the configuration translators at the two ends.
+Multiple inheritance and its "diamond" issue are handled by C++ with
+the "virtual" inheritance: depending classes must be virtually inherited
+and explicitly constructed.
 
 @section yangTranslatorSubnet Subnet translator