]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[65-libyang-adaptor] Method descriptions extended.
authorTomek Mrugalski <tomasz@isc.org>
Mon, 17 Sep 2018 15:32:20 +0000 (17:32 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Mon, 17 Sep 2018 15:52:31 +0000 (17:52 +0200)
src/lib/yang/adaptor.cc
src/lib/yang/adaptor.h

index 96bb3b1b6d5725b9246776e15f7532e62c245ee0..7ed4ad78ca7fb264a13fbb4fec853c052e5329b3 100644 (file)
@@ -47,7 +47,7 @@ Adaptor::fromParent(const string& name, ConstElementPtr parent,
         return;
     }
     BOOST_FOREACH(ElementPtr item, list->listValue()) {
-        // don't override?
+        // don't override. Skip this entry if it already has the parameter.
         if (item->contains(name)) {
             continue;
         }
index f5cb6d5383e4aad98ba58dca6427e3f3547cea53..8d2089c6a4eaf3e2ec3d157c48731339b6c39d30 100644 (file)
@@ -41,12 +41,20 @@ public:
     /// Get user-context and/or comment and return it with the comment
     /// if exists moved inside the user-context (without checking if
     /// there is already a comment as it should never be the case).
+    ///
+    /// This behavior is used to handle comments. For historical purposes
+    /// Kea allows to define comments in some scopes. Once the user-context
+    /// has been introduced, the comment (as a separate text field)
+    /// disappeared and was moved to comment key within user-context.
+    /// Nevertheless, the old syntax is still supported.
     static isc::data::ConstElementPtr
     getContext(isc::data::ConstElementPtr parent);
 
-    /// @brief From parent.
+    /// @brief Moves a parameter from parent to a list of children.
     ///
     /// Move a parameter from the parent to each item in a list.
+    /// If the parameter exists in a child, it is skipped for this
+    /// particular child, not overridden.
     ///
     /// @param name The parameter name.
     /// @param parent The parent element.
@@ -55,9 +63,11 @@ public:
                            isc::data::ConstElementPtr parent,
                            isc::data::ConstElementPtr list);
 
-    /// @brief To parent.
+    /// @brief Moves a parameter to a parent.
     ///
-    /// Move a parameter from children to the parent.
+    /// Move a parameter from children to the parent. All children
+    /// on the list must have the parameter specified and it has to have
+    /// the same value.
     ///
     /// @param name The parameter name.
     /// @param parent The parent element.