From: Francis Dupont Date: Wed, 12 Sep 2018 09:37:35 +0000 (+0200) Subject: [65-libyang-generic] Addressed comments X-Git-Tag: 65-libyang-control-socket_base~1^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2557ffac0aec607f05e9bef6338c447f9f66719;p=thirdparty%2Fkea.git [65-libyang-generic] Addressed comments --- diff --git a/doc/devel/mainpage.dox b/doc/devel/mainpage.dox index d093ef7648..7da6b86a6f 100644 --- a/doc/devel/mainpage.dox +++ b/doc/devel/mainpage.dox @@ -107,7 +107,6 @@ * * @section libraries Kea libraries * - @subpage libcc - * - @subpage libyang * - @subpage libdhcp * - @subpage libdhcpIntro * - @subpage libdhcpRelay @@ -130,6 +129,7 @@ * - @subpage libprocess * - @subpage cpl * - @subpage cplSignals + * - @subpage libyang * * @section miscellaneousTopics Miscellaneous Topics * - @subpage terminology diff --git a/src/lib/yang/sysrepo_connection.cc b/src/lib/yang/sysrepo_connection.cc index e2e859bdfd..d3ffd4613a 100644 --- a/src/lib/yang/sysrepo_connection.cc +++ b/src/lib/yang/sysrepo_connection.cc @@ -14,11 +14,11 @@ SysrepoConnection::SysrepoConnection() { SysrepoConnection::~SysrepoConnection() { if (session_) { - session_->discard_changes(); - session_->unlock_datastore(); - session_->session_stop(); + session_->discard_changes(); + session_->unlock_datastore(); + session_->session_stop(); - // how to call disconnect? + // @todo: how to call disconnect? } } @@ -34,10 +34,10 @@ SysrepoConnection::connect() { void SysrepoConnection::commit() { - if (!session_) { - isc_throw(SysrepoConnectionError, "session not established"); - } - session_->commit(); + if (!session_) { + isc_throw(SysrepoConnectionError, "session not established"); + } + session_->commit(); } } diff --git a/src/lib/yang/sysrepo_connection.h b/src/lib/yang/sysrepo_connection.h index 10dced10fa..b17e99e7bc 100644 --- a/src/lib/yang/sysrepo_connection.h +++ b/src/lib/yang/sysrepo_connection.h @@ -13,21 +13,30 @@ namespace isc { namespace yang { +/// @brief Exception from the sysrepo library for connection. 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. class SysrepoConnection { public: + // @brief Constructor. SysrepoConnection(); + + // @brief Destructor. virtual ~SysrepoConnection(); + + // @brief Get a connection and a session. void connect(); + // @brief Commit a session. void commit(); private: + // @brief The session. S_Session session_; };