mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-31 22:15:23 +00:00
[65-libyang-generic] Addressed comments
This commit is contained in:
@@ -107,7 +107,6 @@
|
|||||||
*
|
*
|
||||||
* @section libraries Kea libraries
|
* @section libraries Kea libraries
|
||||||
* - @subpage libcc
|
* - @subpage libcc
|
||||||
* - @subpage libyang
|
|
||||||
* - @subpage libdhcp
|
* - @subpage libdhcp
|
||||||
* - @subpage libdhcpIntro
|
* - @subpage libdhcpIntro
|
||||||
* - @subpage libdhcpRelay
|
* - @subpage libdhcpRelay
|
||||||
@@ -130,6 +129,7 @@
|
|||||||
* - @subpage libprocess
|
* - @subpage libprocess
|
||||||
* - @subpage cpl
|
* - @subpage cpl
|
||||||
* - @subpage cplSignals
|
* - @subpage cplSignals
|
||||||
|
* - @subpage libyang
|
||||||
*
|
*
|
||||||
* @section miscellaneousTopics Miscellaneous Topics
|
* @section miscellaneousTopics Miscellaneous Topics
|
||||||
* - @subpage terminology
|
* - @subpage terminology
|
||||||
|
@@ -14,11 +14,11 @@ SysrepoConnection::SysrepoConnection() {
|
|||||||
|
|
||||||
SysrepoConnection::~SysrepoConnection() {
|
SysrepoConnection::~SysrepoConnection() {
|
||||||
if (session_) {
|
if (session_) {
|
||||||
session_->discard_changes();
|
session_->discard_changes();
|
||||||
session_->unlock_datastore();
|
session_->unlock_datastore();
|
||||||
session_->session_stop();
|
session_->session_stop();
|
||||||
|
|
||||||
// how to call disconnect?
|
// @todo: how to call disconnect?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,10 +34,10 @@ SysrepoConnection::connect() {
|
|||||||
|
|
||||||
void
|
void
|
||||||
SysrepoConnection::commit() {
|
SysrepoConnection::commit() {
|
||||||
if (!session_) {
|
if (!session_) {
|
||||||
isc_throw(SysrepoConnectionError, "session not established");
|
isc_throw(SysrepoConnectionError, "session not established");
|
||||||
}
|
}
|
||||||
session_->commit();
|
session_->commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -13,21 +13,30 @@
|
|||||||
namespace isc {
|
namespace isc {
|
||||||
namespace yang {
|
namespace yang {
|
||||||
|
|
||||||
|
/// @brief Exception from the sysrepo library for connection.
|
||||||
class SysrepoConnectionError : public Exception {
|
class SysrepoConnectionError : public Exception {
|
||||||
public:
|
public:
|
||||||
SysrepoConnectionError(const char* file, size_t line, const char* what) :
|
SysrepoConnectionError(const char* file, size_t line, const char* what) :
|
||||||
isc::Exception(file, line, what) {}
|
isc::Exception(file, line, what) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// @brief Connection to the sysrepo library. Provision, i.e. currently unused.
|
||||||
class SysrepoConnection {
|
class SysrepoConnection {
|
||||||
public:
|
public:
|
||||||
|
// @brief Constructor.
|
||||||
SysrepoConnection();
|
SysrepoConnection();
|
||||||
|
|
||||||
|
// @brief Destructor.
|
||||||
virtual ~SysrepoConnection();
|
virtual ~SysrepoConnection();
|
||||||
|
|
||||||
|
// @brief Get a connection and a session.
|
||||||
void connect();
|
void connect();
|
||||||
|
|
||||||
|
// @brief Commit a session.
|
||||||
void commit();
|
void commit();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
// @brief The session.
|
||||||
S_Session session_;
|
S_Session session_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user