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.
/// @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));
isc_throw(NotImplemented, "selectiveEnableService is not implemented");
}
-ConstElementPtr NetworkState::toElement() const {
+ElementPtr NetworkState::toElement() const {
MultiThreadingLock lock(*mutex_);
return (impl_->toElement());
}
#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>
/// 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.
/// @brief The network state as Element.
///
/// @return The network state as Element.
- isc::data::ConstElementPtr toElement() const;
+ virtual isc::data::ElementPtr toElement() const;
//@}