From: Marcin Siodelski Date: Tue, 18 Jul 2017 16:10:49 +0000 (+0200) Subject: [5330] Renamed registerCommandHandler to registerCommandCallout. X-Git-Tag: trac5124a_base~38^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b62c5558a2021a4a28b5174d4221cd7946b15a3;p=thirdparty%2Fkea.git [5330] Renamed registerCommandHandler to registerCommandCallout. This was a result of the review. --- diff --git a/src/lib/config/hooked_command_mgr.h b/src/lib/config/hooked_command_mgr.h index 8b8dcb4e33..bfa2ada933 100644 --- a/src/lib/config/hooked_command_mgr.h +++ b/src/lib/config/hooked_command_mgr.h @@ -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 diff --git a/src/lib/config/tests/command_mgr_unittests.cc b/src/lib/config/tests/command_mgr_unittests.cc index 6af26ee480..a927df5f86 100644 --- a/src/lib/config/tests/command_mgr_unittests.cc +++ b/src/lib/config/tests/command_mgr_unittests.cc @@ -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, diff --git a/src/lib/hooks/callout_manager.h b/src/lib/hooks/callout_manager.h index 06e9dac39a..a4a7f8a641 100644 --- a/src/lib/hooks/callout_manager.h +++ b/src/lib/hooks/callout_manager.h @@ -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, diff --git a/src/lib/hooks/library_handle.cc b/src/lib/hooks/library_handle.cc index 1df6de5d61..5707dbae52 100644 --- a/src/lib/hooks/library_handle.cc +++ b/src/lib/hooks/library_handle.cc @@ -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); diff --git a/src/lib/hooks/library_handle.h b/src/lib/hooks/library_handle.h index f04c95283e..5dfad2a909 100644 --- a/src/lib/hooks/library_handle.h +++ b/src/lib/hooks/library_handle.h @@ -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 /// diff --git a/src/lib/hooks/tests/callout_manager_unittest.cc b/src/lib/hooks/tests/callout_manager_unittest.cc index 1b96585b42..03da266ab2 100644 --- a/src/lib/hooks/tests/callout_manager_unittest.cc +++ b/src/lib/hooks/tests/callout_manager_unittest.cc @@ -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'. diff --git a/src/lib/hooks/tests/full_callout_library.cc b/src/lib/hooks/tests/full_callout_library.cc index 50a34296c1..1846592e15 100644 --- a/src/lib/hooks/tests/full_callout_library.cc +++ b/src/lib/hooks/tests/full_callout_library.cc @@ -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); } diff --git a/src/lib/hooks/tests/load_callout_library.cc b/src/lib/hooks/tests/load_callout_library.cc index 40606f7466..613ec2c79f 100644 --- a/src/lib/hooks/tests/load_callout_library.cc +++ b/src/lib/hooks/tests/load_callout_library.cc @@ -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); }