Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
54210ba4
Commit
54210ba4
authored
May 13, 2011
by
Michal 'vorner' Vaner
Browse files
[trac922] Update interface
parent
fd08a0dc
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lib/config/ccsession.cc
View file @
54210ba4
...
...
@@ -356,7 +356,10 @@ ModuleCCSession::checkCommand() {
}
std
::
string
ModuleCCSession
::
addRemoteConfig
(
const
std
::
string
&
spec_file_name
)
{
ModuleCCSession
::
addRemoteConfig
(
const
std
::
string
&
spec_file_name
,
void
(
*
)(
const
std
::
string
&
module
,
ConstElementPtr
))
{
ModuleSpec
rmod_spec
=
readModuleSpecification
(
spec_file_name
);
std
::
string
module_name
=
rmod_spec
.
getFullSpec
()
->
get
(
"module_name"
)
->
stringValue
();
ConfigData
rmod_config
=
ConfigData
(
rmod_spec
);
...
...
src/lib/config/ccsession.h
View file @
54210ba4
...
...
@@ -234,24 +234,38 @@ public:
/**
* Gives access to the configuration values of a different module
* Once this function has been called with the name of the specification
* file o
f
the module you want the configuration of, you can use
* file o
r
the module you want the configuration of, you can use
* \c getRemoteConfigValue() to get a specific setting.
* Changes are automatically updated,
but
you can
not
specify handlers
* for those changes
, must use \c getRemoteConfigValue() to get a valu
e
*
This function will subscribe to the relevant module
channel.
* Changes are automatically updated,
and
you can specify handlers
* for those changes
. This function will subscribe to the relevant modul
e
* channel.
*
* \param spec_file_name The path to the specification file of
* the module we want to have configuration
* values from
* \param spec_name This specifies the module to add. It is either a
* filename of the spec file to use or a name of module
* (in case it's a module name, the spec data is
* downloaded from the configuration manager, therefore
* the configuration manager must know it). A heuristic
* is used to guess which should be used - if it contains
* a slash or dot, filename is assumed, otherwise
* name of module is assumed.
* \param handler The handler function 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
* getRemoteConfigValue() each time.
* \return The name of the module specified in the given specification
* file
*/
std
::
string
addRemoteConfig
(
const
std
::
string
&
spec_file_name
);
std
::
string
addRemoteConfig
(
const
std
::
string
&
spec_name
,
void
(
*
handler
)(
const
std
::
string
&
module_name
,
isc
::
data
::
ConstElementPtr
update
)
=
NULL
);
/**
* Removes the module with the given name from the remote config
* settings. If the module was not added with \c addRemoteConfig(),
* nothing happens.
* nothing happens. If there was a handler for this config, it is
* removed as well.
*/
void
removeRemoteConfig
(
const
std
::
string
&
module_name
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment