From: Francis Dupont Date: Mon, 22 Oct 2018 11:21:03 +0000 (+0200) Subject: [65-libyang-class] Addressed class comments X-Git-Tag: 65-libyang-shared-network-translator_base~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a71dd634c4e875e381490ec8c50ea62647da37e6;p=thirdparty%2Fkea.git [65-libyang-class] Addressed class comments --- diff --git a/src/lib/yang/tests/translator_class_unittests.cc b/src/lib/yang/tests/translator_class_unittests.cc index d6eea31ffd..c7a9b5999f 100644 --- a/src/lib/yang/tests/translator_class_unittests.cc +++ b/src/lib/yang/tests/translator_class_unittests.cc @@ -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)); diff --git a/src/lib/yang/translator_class.h b/src/lib/yang/translator_class.h index 23087edcfd..27ab642095 100644 --- a/src/lib/yang/translator_class.h +++ b/src/lib/yang/translator_class.h @@ -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. diff --git a/src/lib/yang/yang.dox b/src/lib/yang/yang.dox index f816765c6f..c21e72f11e 100644 --- a/src/lib/yang/yang.dox +++ b/src/lib/yang/yang.dox @@ -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