]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#65,!18] Minor changes after review.
authorTomek Mrugalski <tomasz@isc.org>
Wed, 12 Sep 2018 10:05:19 +0000 (12:05 +0200)
committerFrancis Dupont <fdupont@isc.org>
Wed, 12 Sep 2018 13:37:38 +0000 (15:37 +0200)
# Conflicts:
# src/lib/yang/sysrepo_connection.cc
# src/lib/yang/sysrepo_connection.h

src/lib/yang/sysrepo_connection.cc
src/lib/yang/sysrepo_connection.h
src/lib/yang/translator.cc
src/lib/yang/translator.h

index d3ffd4613a8803313e56c3de2732b2b26fae563d..df8ed3dee88926d5b5171f84dbcbc845e00c30c5 100644 (file)
@@ -18,7 +18,7 @@ SysrepoConnection::~SysrepoConnection() {
         session_->unlock_datastore();
         session_->session_stop();
 
-        // @todo: how to call disconnect?
+      /// @todo: how to call disconnect?
     }
 }
 
index b17e99e7bcda1f087a1a372bc4ab87c40ec56576..2ed211125ca7344dec40d5f22ebe7655b7506ec9 100644 (file)
 namespace isc {
 namespace yang {
 
-/// @brief Exception from the sysrepo library for connection.
+/// @brief An exception thrown when connection with sysrepo is broken
 class SysrepoConnectionError : public Exception {
 public:
     SysrepoConnectionError(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
 };
 
-/// @brief Connection to the sysrepo library. Provision, i.e. currently unused.
+/// @brief A class that represents a connection to Sysrepo
 class SysrepoConnection {
 public:
-    // @brief Constructor.
+
+    /// @brief constructor
+    ///
+    /// Currently does nothing. You need to explicitly call connect()
     SysrepoConnection();
 
-    // @brief Destructor.
+    /// @brief Destructor
+    ///
+    /// Discards any pending data, unlocks datastore and stops session.
     virtual ~SysrepoConnection();
 
     // @brief Get a connection and a session.
     void connect();
 
-    // @brief Commit a session.
+    /// @brief Commits any pending data.
     void commit();
 
  private:
-    // @brief The session.
+
+    /// @brief pointer to a session
+    ///
+    /// May be null if the session is not established.
     S_Session session_;
 };
 
index 1613bba01951b02c8f959b0a2d70dedb8dbabc7d..082adbd2801373c1880e448b433315a87307cd16 100644 (file)
@@ -63,6 +63,7 @@ TranslatorBasic::value(S_Val s_val) {
 
     case SR_UINT8_T:
         return (Element::create(static_cast<long long>(s_val->data()->get_uint8())));
+
     case SR_UINT16_T:
         return (Element::create(static_cast<long long>(s_val->data()->get_uint16())));
 
@@ -99,8 +100,7 @@ TranslatorBasic::getItem(const string& xpath) {
     try {
         s_val = session_->get_item(xpath.c_str());
     } catch (const sysrepo_exception& ex) {
-        isc_throw(SysrepoError,
-                  "sysrepo error getting item at '" << xpath
+        isc_throw(SysrepoError, "sysrepo error getting item at '" << xpath
                   << "': " << ex.what());
     }
     if (!s_val) {
index d1c8449e90760b97bb80bbbbd8fb45dd1c1c4694..a72124a84166235873031cb69afc0803f3013bf6 100644 (file)
@@ -84,8 +84,8 @@ public:
 
     /// @brief Get xpath of the next Yang list item.
     ///
-    /// @param iter The iterator.
-    /// @return The xpath of the next element. Null when at the end of the list.
+    /// @param iter The iterator pointing to the previous element
+    /// @return The xpath of the next element. Empty string when at the end of the list.
     std::string getNext(S_Iter_Value iter);
 
 protected: