-// Copyright (C) 2013-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2018 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
checkLibraryIndex(current_library_);
// New hooks could have been registered since the manager was constructed.
- ensureVectorSize();
+ ensureHookLibsVectorSize();
// Get the index associated with this hook (validating the name in the
// process).
checkLibraryIndex(current_library_);
// New hooks could have been registered since the manager was constructed.
- ensureVectorSize();
+ ensureHookLibsVectorSize();
// Get the index associated with this hook (validating the name in the
// process).
CalloutManager::deregisterAllCallouts(const std::string& name) {
// New hooks could have been registered since the manager was constructed.
- ensureVectorSize();
+ ensureHookLibsVectorSize();
// Get the index associated with this hook (validating the name in the
// process).
CalloutManager::registerCommandHook(const std::string& command_name) {
// New hooks could have been registered since the manager was constructed.
- ensureVectorSize();
+ ensureHookLibsVectorSize();
ServerHooks& hooks = ServerHooks::getServerHooks();
int hook_index = hooks.findIndex(ServerHooks::commandToHookName(command_name));
}
void
-CalloutManager::ensureVectorSize() {
+CalloutManager::ensureHookLibsVectorSize() {
ServerHooks& hooks = ServerHooks::getServerHooks();
if (hooks.getCount() > hook_vector_.size()) {
// Uh oh, there are more hook points that our vector allows.
-// Copyright (C) 2013-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2018 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
return (post_library_handle_);
}
+ //@}
/// @brief Return number of currently available hooks
- size_t getVectorSize() const {
+ size_t getHookLibsVectorSize() const {
return (hook_vector_.size());
}
+private:
+
/// @brief This method checks whether the hook_vector_ size is suffucient
/// and extends it if necessary.
///
/// is registered. It checks whether the vector size is sufficient and
/// extends it if necessary. It is safe to call it multiple times. It
/// may grow the vector size, but will never shrink it.
- void ensureVectorSize();
+ void ensureHookLibsVectorSize();
- //@}
-
-private:
/// @brief Check library index
///
/// Ensures that the current library index is valid. This is called by
-// Copyright (C) 2013-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2018 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// This test checks if the CalloutManager can adjust its own hook_vector_ size.
TEST_F(CalloutManagerTest, VectorSize) {
- size_t s = getCalloutManager()->getVectorSize();
+ size_t s = getCalloutManager()->getHookLibsVectorSize();
ServerHooks& hooks = ServerHooks::getServerHooks();
// The vector size should have been increased by one, because there's
// one new hook point now.
- EXPECT_EQ(s + 1, getCalloutManager()->getVectorSize());
+ EXPECT_EQ(s + 1, getCalloutManager()->getHookLibsVectorSize());
}