// Now find the wildcard names (the one that start with "*").
BOOST_FOREACH(ConstElementPtr cur_logger, loggers->listValue()) {
- std::string cur_name = cur_logger->get("name")->stringValue();
+ const std::string cur_name = cur_logger->get("name")->stringValue();
// If name is '*', or starts with '*.', replace * with root
// logger name.
if (cur_name == "*" || cur_name.length() > 1 &&
std::string
ModuleCCSession::addRemoteConfig(const std::string& spec_name,
- void (*handler)(const std::string& module,
- ConstElementPtr,
- const ConfigData&),
+ RemoteHandler handler,
bool spec_is_filename)
{
// First get the module name, specification and default config
* the configuration manager must know it). If
* spec_is_filename is true (the default), then a
* filename is assumed, otherwise a module name.
- * \param handler The handler function called whenever there's a change.
+ * \param handler The handler functor called whenever there's a change.
* Called once initally from this function. May be NULL
* if you don't want any handler to be called and you're
* fine with requesting the data through
* \return The name of the module specified in the given specification
* file
*/
+ typedef boost::function<void(const std::string&,
+ isc::data::ConstElementPtr,
+ const ConfigData&)> RemoteHandler;
std::string addRemoteConfig(const std::string& spec_name,
- void (*handler)(const std::string& module_name,
- isc::data::ConstElementPtr
- update,
- const ConfigData& config_data) = NULL,
+ RemoteHandler handler = RemoteHandler(),
bool spec_is_filename = true);
/**
const std::string& command,
isc::data::ConstElementPtr args);
- typedef void (*RemoteHandler)(const std::string&,
- isc::data::ConstElementPtr,
- const ConfigData&);
std::map<std::string, ConfigData> remote_module_configs_;
std::map<std::string, RemoteHandler> remote_module_handlers_;