]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3446] addressed review comments
authorRazvan Becheriu <razvan@isc.org>
Tue, 16 Jul 2024 07:47:14 +0000 (10:47 +0300)
committerRazvan Becheriu <razvan@isc.org>
Tue, 16 Jul 2024 12:43:21 +0000 (12:43 +0000)
src/lib/dhcpsrv/network_state.cc
src/lib/dhcpsrv/network_state.h

index 061ada84e1c224e437c2d4f193adbc0f339f283c..0ba3f5f939c4f1af7be3595d44c1462b025e7a51 100644 (file)
@@ -23,7 +23,8 @@ namespace isc {
 namespace dhcp {
 
 /// @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:
 
     /// @brief Constructor.
@@ -178,7 +179,7 @@ public:
     /// @brief The network state as Element.
     ///
     /// @return The network state as Element.
-    ConstElementPtr toElement() const {
+    virtual ElementPtr toElement() const {
         ElementPtr result = Element::createMap();
         result->set("globally-disabled", Element::create(globally_disabled_));
         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");
 }
 
-ConstElementPtr NetworkState::toElement() const {
+ElementPtr NetworkState::toElement() const {
     MultiThreadingLock lock(*mutex_);
     return (impl_->toElement());
 }
index b48697b91ea9c314eace6c686e2f37e3a94c49ae..a8f9a60dec86c20b85bcdc8f6ad38443797e8f44 100644 (file)
@@ -7,6 +7,7 @@
 #ifndef NETWORK_STATE_H
 #define NETWORK_STATE_H
 
+#include <cc/cfg_to_element.h>
 #include <cc/data.h>
 #include <dhcpsrv/subnet_id.h>
 #include <boost/scoped_ptr.hpp>
@@ -68,7 +69,7 @@ class NetworkStateImpl;
 /// corresponding request to enable the service. It prevents the situation that the
 /// 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.
-class NetworkState {
+class NetworkState : public isc::data::CfgToElement {
 public:
 
     /// @brief Origin of the network state transition.
@@ -205,7 +206,7 @@ public:
     /// @brief The network state as Element.
     ///
     /// @return The network state as Element.
-    isc::data::ConstElementPtr toElement() const;
+    virtual isc::data::ElementPtr toElement() const;
 
     //@}