2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-04 16:05:17 +00:00

[#3446] addressed review comments

This commit is contained in:
Razvan Becheriu
2024-07-16 10:47:14 +03:00
parent 0f69a00e59
commit 797512d777
2 changed files with 7 additions and 5 deletions

View File

@@ -23,7 +23,8 @@ namespace isc {
namespace dhcp { namespace dhcp {
/// @brief Implementation of the @c NetworkState class. /// @brief Implementation of the @c NetworkState class.
class NetworkStateImpl : public boost::enable_shared_from_this<NetworkStateImpl> { class NetworkStateImpl : public boost::enable_shared_from_this<NetworkStateImpl>,
public CfgToElement {
public: public:
/// @brief Constructor. /// @brief Constructor.
@@ -178,7 +179,7 @@ public:
/// @brief The network state as Element. /// @brief The network state as Element.
/// ///
/// @return The network state as Element. /// @return The network state as Element.
ConstElementPtr toElement() const { virtual ElementPtr toElement() const {
ElementPtr result = Element::createMap(); ElementPtr result = Element::createMap();
result->set("globally-disabled", Element::create(globally_disabled_)); result->set("globally-disabled", Element::create(globally_disabled_));
result->set("disabled-by-db-connection", Element::create(disabled_by_db_connection_ != 0)); result->set("disabled-by-db-connection", Element::create(disabled_by_db_connection_ != 0));
@@ -303,7 +304,7 @@ NetworkState::selectiveEnable(const NetworkState::Networks&) {
isc_throw(NotImplemented, "selectiveEnableService is not implemented"); isc_throw(NotImplemented, "selectiveEnableService is not implemented");
} }
ConstElementPtr NetworkState::toElement() const { ElementPtr NetworkState::toElement() const {
MultiThreadingLock lock(*mutex_); MultiThreadingLock lock(*mutex_);
return (impl_->toElement()); return (impl_->toElement());
} }

View File

@@ -7,6 +7,7 @@
#ifndef NETWORK_STATE_H #ifndef NETWORK_STATE_H
#define NETWORK_STATE_H #define NETWORK_STATE_H
#include <cc/cfg_to_element.h>
#include <cc/data.h> #include <cc/data.h>
#include <dhcpsrv/subnet_id.h> #include <dhcpsrv/subnet_id.h>
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
@@ -68,7 +69,7 @@ class NetworkStateImpl;
/// corresponding request to enable the service. It prevents the situation that the /// corresponding request to enable the service. It prevents the situation that the
/// service remains disabled because there were more requests to disable than to /// service remains disabled because there were more requests to disable than to
/// enable the service. It is hard to ensure the same consistency for the HA. /// enable the service. It is hard to ensure the same consistency for the HA.
class NetworkState { class NetworkState : public isc::data::CfgToElement {
public: public:
/// @brief Origin of the network state transition. /// @brief Origin of the network state transition.
@@ -205,7 +206,7 @@ public:
/// @brief The network state as Element. /// @brief The network state as Element.
/// ///
/// @return The network state as Element. /// @return The network state as Element.
isc::data::ConstElementPtr toElement() const; virtual isc::data::ElementPtr toElement() const;
//@} //@}