]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5330] Renamed registerCommandHandler to registerCommandCallout.
authorMarcin Siodelski <marcin@isc.org>
Tue, 18 Jul 2017 16:10:49 +0000 (18:10 +0200)
committerMarcin Siodelski <marcin@isc.org>
Tue, 18 Jul 2017 16:10:49 +0000 (18:10 +0200)
This was a result of the review.

src/lib/config/hooked_command_mgr.h
src/lib/config/tests/command_mgr_unittests.cc
src/lib/hooks/callout_manager.h
src/lib/hooks/library_handle.cc
src/lib/hooks/library_handle.h
src/lib/hooks/tests/callout_manager_unittest.cc
src/lib/hooks/tests/full_callout_library.cc
src/lib/hooks/tests/load_callout_library.cc

index 8b8dcb4e334904922b41c4716eca2ec2832eb82e..bfa2ada933a9f144dfdaa0d869254b837deedbca 100644 (file)
@@ -21,7 +21,7 @@ namespace config {
 /// command handlers for the control API.
 ///
 /// The command handlers are registered by a hook library by calling
-/// @ref isc::hooks::LibraryHandle::registerCommandHandler. This call
+/// @ref isc::hooks::LibraryHandle::registerCommandCallout. This call
 /// creates a hook point for this command (if one doesn't exist) and then
 /// registeres the specified handler(s). When the @ref HookedCommandMgr
 /// receives a command for processing it calls the
index 6af26ee480dec72574451b64df5ed6f37930727e..a927df5f86d40fe6a5a9d52c02810bfea2b997f0 100644 (file)
@@ -316,7 +316,7 @@ TEST_F(CommandMgrTest, processCommand) {
 TEST_F(CommandMgrTest, delegateProcessCommand) {
     // Register callout so as we can check that it is called before
     // processing the command by the manager.
-    HooksManager::preCalloutsLibraryHandle().registerCommandHandler(
+    HooksManager::preCalloutsLibraryHandle().registerCommandCallout(
         "my-command", control_command_receive_handle_callout);
 
     // Install local handler
@@ -357,7 +357,7 @@ TEST_F(CommandMgrTest, delegateProcessCommand) {
 TEST_F(CommandMgrTest, delegateListCommands) {
     // Register callout so as we can check that it is called before
     // processing the command by the manager.
-    HooksManager::preCalloutsLibraryHandle().registerCommandHandler(
+    HooksManager::preCalloutsLibraryHandle().registerCommandCallout(
         "my-command", control_command_receive_handle_callout);
 
     // Create my-command-bis which is unique for the local Command Manager,
index 06e9dac39a78b365af78d5e7533b026e79e988d0..a4a7f8a6417235f1f10363111f44db75ff2dbefe 100644 (file)
@@ -119,11 +119,11 @@ public:
 ///
 /// The @ref CalloutManager::registerCommandHook has been added to allow for
 /// dynamically creating hook points for which command handlers are registered.
-/// This method is called from the @ref LibraryHandle::registerCommandHandler
+/// This method is called from the @ref LibraryHandle::registerCommandCallout
 /// as a result of registering the command handlers by the hook library in
 /// its @c load() function. If the hook point for the given command already
 /// exists, this function doesn't do anything. The
-/// @ref LibraryHandle::registerCommandHandler can install callouts on this
+/// @ref LibraryHandle::registerCommandCallout can install callouts on this
 /// hook point.
 ///
 /// Note that the callout functions do not access the CalloutManager: instead,
index 1df6de5d6179b24c3b417e67da0f1e6ec2d19308..5707dbae529a48147323ffa38e222e8657cc5814 100644 (file)
@@ -36,7 +36,7 @@ LibraryHandle::registerCallout(const std::string& name, CalloutPtr callout) {
 }
 
 void
-LibraryHandle::registerCommandHandler(const std::string& command_name,
+LibraryHandle::registerCommandCallout(const std::string& command_name,
                                       CalloutPtr callout) {
     // Register hook point for this command, if one doesn't exist.
     callout_manager_->registerCommandHook(command_name);
index f04c95283e7eb32f902352a128b712307b2b3aa9..5dfad2a909e570d2ff48b6e0c20b854d6415d5a2 100644 (file)
@@ -48,7 +48,7 @@ extern "C" {
 /// handler similarly to this:
 /// @code
 /// int load(LibraryHandle& libhandle) {
-///     libhandle.registerCommandHandler("foo-bar", foo_bar_handler);
+///     libhandle.registerCommandCallout("foo-bar", foo_bar_handler);
 ///     return (0);
 /// }
 /// @endcode
@@ -104,7 +104,7 @@ public:
     ///
     /// @param command_name Command name for which handler should be installed.
     /// @param callout Pointer to the command handler implemented as a callout.
-    void registerCommandHandler(const std::string& command_name, CalloutPtr callout);
+    void registerCommandCallout(const std::string& command_name, CalloutPtr callout);
 
     /// @brief De-Register a callout on a hook
     ///
index 1b96585b42f6367af04882409aedecddb7622126..03da266ab2521b9ec93e5fd84f130102e5e8331c 100644 (file)
@@ -880,14 +880,14 @@ TEST_F(CalloutManagerTest, LibraryHandleRegisterCommandHandler) {
     // 'command-two' should also be called.
 
     getCalloutManager()->setLibraryIndex(0);
-    getCalloutManager()->getLibraryHandle().registerCommandHandler("command-one",
+    getCalloutManager()->getLibraryHandle().registerCommandCallout("command-one",
                                                                    callout_one);
-    getCalloutManager()->getLibraryHandle().registerCommandHandler("command-one",
+    getCalloutManager()->getLibraryHandle().registerCommandCallout("command-one",
                                                                    callout_four);
     getCalloutManager()->setLibraryIndex(1);
-    getCalloutManager()->getLibraryHandle().registerCommandHandler("command-one",
+    getCalloutManager()->getLibraryHandle().registerCommandCallout("command-one",
                                                                    callout_two);
-    getCalloutManager()->getLibraryHandle().registerCommandHandler("command-two",
+    getCalloutManager()->getLibraryHandle().registerCommandCallout("command-two",
                                                                    callout_three);
 
     // Command handlers are installed for commands: 'command-one' and 'command-two'.
index 50a34296c1666d7ea7da1ca3779c1dfc26996d69..1846592e15c11191b84adb97fdf1a17ea00581cf 100644 (file)
@@ -151,8 +151,8 @@ load(LibraryHandle& handle) {
     handle.registerCallout("hookpt_three", hook_nonstandard_three);
 
     // Register command_handler_one as control command handler.
-    handle.registerCommandHandler("command-one", command_handler_one);
-    handle.registerCommandHandler("command-two", command_handler_two);
+    handle.registerCommandCallout("command-one", command_handler_one);
+    handle.registerCommandCallout("command-two", command_handler_two);
 
     return (0);
 }
index 40606f746611ef239651c190b7eba2f9b7aacfd7..613ec2c79f3fc255e7a66885e22d5c79f22f25cf 100644 (file)
@@ -142,8 +142,8 @@ int load(LibraryHandle& handle) {
     handle.registerCallout("hookpt_three", hook_nonstandard_three);
 
     // Register command_handler_one as control command handler.
-    handle.registerCommandHandler("command-one", command_handler_one);
-    handle.registerCommandHandler("command-two", command_handler_two);
+    handle.registerCommandCallout("command-one", command_handler_one);
+    handle.registerCommandCallout("command-two", command_handler_two);
 
     return (0);
 }