Commit 4cc446b1 authored by Jelte Jansen's avatar Jelte Jansen
Browse files

make ModuleCCSession a subclass of ConfigData, so the module can directly get...

make ModuleCCSession a subclass of ConfigData, so the module can directly get the configuration data it needs (same as in python version)


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1045 e5f2f494-b856-4b98-b285-d166d9295462
parent 7922531b
......@@ -221,7 +221,7 @@ ModuleCCSession::handleConfigUpdate(ElementPtr new_config)
answer = createAnswer(2, ss.str());
} else {
// remove the values that have not changed
isc::data::removeIdentical(new_config, getConfig());
isc::data::removeIdentical(new_config, getLocalConfig());
// handle config update
answer = config_handler_(new_config);
int rcode;
......
......@@ -19,6 +19,7 @@
#include <string>
#include <config/config_data.h>
#include <config/module_spec.h>
#include <cc/session.h>
#include <cc/data.h>
......@@ -42,7 +43,7 @@ public:
/// holds configuration information, and handles messages from
/// the command channel
///
class ModuleCCSession {
class ModuleCCSession : public ConfigData {
public:
/**
* Initialize a config/command session
......@@ -89,7 +90,6 @@ public:
*/
void set_command_handler(isc::data::ElementPtr(*command_handler)(const std::string& command, const isc::data::ElementPtr args)) { command_handler_ = command_handler; };
const ElementPtr getConfig() { return config_; }
private:
void read_module_specification(const std::string& filename);
......
......@@ -45,6 +45,8 @@ public:
/// \param module_spec A ModuleSpec for the relevant module
ConfigData(const ModuleSpec& module_spec) : _module_spec(module_spec) { _config = Element::createFromString("{}"); }
virtual ~ConfigData() {};
/// Returns the value currently set for the given identifier
/// If no value is set, the default value (as specified by the
/// .spec file) is returned. If there is no value and no default,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment