]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3119] replace const auto with auto const
authorRazvan Becheriu <razvan@isc.org>
Wed, 20 Dec 2023 19:16:01 +0000 (21:16 +0200)
committerRazvan Becheriu <razvan@isc.org>
Mon, 22 Jan 2024 15:33:26 +0000 (17:33 +0200)
93 files changed:
src/bin/dhcp4/dhcp4_srv.cc
src/bin/dhcp4/tests/config_parser_unittest.cc
src/bin/dhcp4/tests/dhcp4_srv_unittest.cc
src/bin/dhcp4/tests/hooks_unittest.cc
src/bin/dhcp6/dhcp6_srv.cc
src/bin/dhcp6/tests/config_parser_unittest.cc
src/bin/dhcp6/tests/dhcp6_client.cc
src/bin/dhcp6/tests/dhcp6_srv_unittest.cc
src/bin/dhcp6/tests/hooks_unittest.cc
src/bin/perfdhcp/test_control.cc
src/hooks/dhcp/flex_option/flex_option.h
src/hooks/dhcp/high_availability/ha_config_parser.cc
src/hooks/dhcp/high_availability/ha_service.cc
src/hooks/dhcp/high_availability/query_filter.cc
src/hooks/dhcp/high_availability/tests/ha_relationship_mapper_unittest.cc
src/hooks/dhcp/lease_cmds/lease_cmds.cc
src/hooks/dhcp/mysql_cb/mysql_cb_dhcp4.cc
src/hooks/dhcp/mysql_cb/mysql_cb_dhcp6.cc
src/hooks/dhcp/mysql_cb/mysql_cb_impl.cc
src/hooks/dhcp/mysql_cb/mysql_cb_impl.h
src/hooks/dhcp/pgsql_cb/pgsql_cb_dhcp4.cc
src/hooks/dhcp/pgsql_cb/pgsql_cb_dhcp6.cc
src/hooks/dhcp/pgsql_cb/pgsql_cb_impl.cc
src/hooks/dhcp/pgsql_cb/pgsql_cb_impl.h
src/hooks/dhcp/stat_cmds/stat_cmds.cc
src/lib/asiolink/io_service_thread_pool.cc
src/lib/asiolink/tests/addr_utilities_unittest.cc
src/lib/cc/command_interpreter.cc
src/lib/cc/data.cc
src/lib/cc/simple_parser.cc
src/lib/cc/stamped_element.cc
src/lib/config_backend/base_config_backend_pool.h
src/lib/config_backend/tests/config_backend_mgr_unittest.cc
src/lib/d2srv/d2_stats.cc
src/lib/d2srv/d2_tsig_key.cc
src/lib/d2srv/testutils/stats_test_utils.cc
src/lib/database/database_connection.cc
src/lib/database/dbaccess_parser.cc
src/lib/database/server_selector.cc
src/lib/database/tests/audit_entry_unittest.cc
src/lib/dhcp/iface_mgr.cc
src/lib/dhcp/libdhcp++.cc
src/lib/dhcp/option4_dnr.cc
src/lib/dhcp/option6_dnr.cc
src/lib/dhcp/pkt.cc
src/lib/dhcp/pkt4.cc
src/lib/dhcp/pkt6.cc
src/lib/dhcpsrv/alloc_engine.cc
src/lib/dhcpsrv/cb_ctl_dhcp.h
src/lib/dhcpsrv/cb_ctl_dhcp4.cc
src/lib/dhcpsrv/cb_ctl_dhcp6.cc
src/lib/dhcpsrv/cfg_hosts.cc
src/lib/dhcpsrv/cfg_option.cc
src/lib/dhcpsrv/cfg_shared_networks.cc
src/lib/dhcpsrv/cfg_shared_networks.h
src/lib/dhcpsrv/cfg_subnets4.cc
src/lib/dhcpsrv/cfg_subnets6.cc
src/lib/dhcpsrv/iterative_allocator.cc
src/lib/dhcpsrv/lease_mgr.cc
src/lib/dhcpsrv/memfile_lease_mgr.cc
src/lib/dhcpsrv/mysql_lease_mgr.cc
src/lib/dhcpsrv/parsers/client_class_def_parser.cc
src/lib/dhcpsrv/parsers/dhcp_parsers.cc
src/lib/dhcpsrv/pgsql_lease_mgr.cc
src/lib/dhcpsrv/random_allocator.cc
src/lib/dhcpsrv/shared_network.cc
src/lib/dhcpsrv/srv_config.cc
src/lib/dhcpsrv/subnet.cc
src/lib/dhcpsrv/tests/cb_ctl_dhcp_unittest.cc
src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc
src/lib/dhcpsrv/tests/shared_network_unittest.cc
src/lib/dhcpsrv/testutils/generic_backend_unittest.cc
src/lib/dhcpsrv/testutils/generic_cb_dhcp4_unittest.cc
src/lib/dhcpsrv/testutils/generic_cb_dhcp6_unittest.cc
src/lib/dhcpsrv/testutils/generic_host_data_source_unittest.cc
src/lib/dhcpsrv/testutils/memory_host_data_source.cc
src/lib/dhcpsrv/testutils/test_config_backend_dhcp4.cc
src/lib/dhcpsrv/testutils/test_config_backend_dhcp6.cc
src/lib/http/basic_auth_config.cc
src/lib/http/tests/client_mt_unittests.cc
src/lib/pgsql/tests/pgsql_connection_unittest.cc
src/lib/process/cb_ctl_base.h
src/lib/process/redact_config.cc
src/lib/process/tests/cb_ctl_base_unittests.cc
src/lib/stats/context.cc
src/lib/stats/testutils/stats_test_utils.h
src/lib/tcp/tcp_connection_pool.cc
src/lib/testutils/gtest_utils.h
src/lib/util/multi_threading_mgr.cc
src/lib/util/strutil.h
src/lib/util/tests/thread_pool_unittest.cc
src/lib/util/thread_pool.h
src/lib/yang/tests/translator_utils_unittests.cc

index 4761c91ba1a3e355d977ef1fd547483df7d00a79..8edef2d542d78dc3f93da3308879d4feb6a1dab0 100644 (file)
@@ -1495,7 +1495,7 @@ Dhcpv4Srv::processDhcp4Query(Pkt4Ptr& query, Pkt4Ptr& rsp,
                 }
 
                 if (parked_packet_limit) {
-                    const auto& parking_lot =
+                    auto const& parking_lot =
                         ServerHooks::getServerHooks().getParkingLotPtr(hook_label);
 
                     if (parking_lot && (parking_lot->size() >= parked_packet_limit)) {
@@ -3748,9 +3748,9 @@ Dhcpv4Srv::processRelease(Pkt4Ptr& release, AllocEngine::ClientContext4Ptr& cont
                         StatsMgr::generateName("subnet", lease->subnet_id_, "assigned-addresses"),
                         static_cast<int64_t>(-1));
 
-                    const auto& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets4()->getBySubnetId(lease->subnet_id_);
+                    auto const& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets4()->getBySubnetId(lease->subnet_id_);
                     if (subnet) {
-                        const auto& pool = subnet->getPool(Lease::TYPE_V4, lease->addr_, false);
+                        auto const& pool = subnet->getPool(Lease::TYPE_V4, lease->addr_, false);
                         if (pool) {
                             StatsMgr::instance().addValue(
                                 StatsMgr::generateName("subnet", subnet->getID(),
@@ -3920,9 +3920,9 @@ Dhcpv4Srv::declineLease(const Lease4Ptr& lease, const Pkt4Ptr& decline,
         StatsMgr::generateName("subnet", lease->subnet_id_, "declined-addresses"),
         static_cast<int64_t>(1));
 
-    const auto& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets4()->getBySubnetId(lease->subnet_id_);
+    auto const& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets4()->getBySubnetId(lease->subnet_id_);
     if (subnet) {
-        const auto& pool = subnet->getPool(Lease::TYPE_V4, lease->addr_, false);
+        auto const& pool = subnet->getPool(Lease::TYPE_V4, lease->addr_, false);
         if (pool) {
             StatsMgr::instance().addValue(
                 StatsMgr::generateName("subnet", subnet->getID(),
@@ -4021,9 +4021,9 @@ Dhcpv4Srv::serverDecline(hooks::CalloutHandlePtr& callout_handle, Pkt4Ptr& query
             static_cast<int64_t>(1));
     }
 
-    const auto& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets4()->getBySubnetId(lease->subnet_id_);
+    auto const& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets4()->getBySubnetId(lease->subnet_id_);
     if (subnet) {
-        const auto& pool = subnet->getPool(Lease::TYPE_V4, lease->addr_, false);
+        auto const& pool = subnet->getPool(Lease::TYPE_V4, lease->addr_, false);
         if (pool) {
             StatsMgr::instance().addValue(
                 StatsMgr::generateName("subnet", subnet->getID(),
index bc19bbc20d64d5f715b9301315164cc5204bc3e9..eb78dbbf768410966930bf02f0075124eb4f43ac 100644 (file)
@@ -764,7 +764,7 @@ public:
     checkSubnet(const CollectionType& col, std::string subnet,
                 uint32_t t1, uint32_t t2, uint32_t valid,
                 uint32_t min_valid = 0, uint32_t max_valid = 0) {
-        const auto& index = col.template get<SubnetPrefixIndexTag>();
+        auto const& index = col.template get<SubnetPrefixIndexTag>();
         auto subnet_it = index.find(subnet);
         if (subnet_it == index.cend()) {
             ADD_FAILURE() << "Unable to find expected subnet " << subnet;
index fc3e6ca5efed3d03d298016a77ec9256260ecf28..28d150b34381904b93bccb58f8ae9069954bf0fd 100644 (file)
@@ -2995,7 +2995,7 @@ Dhcpv4SrvTest::checkConfigFiles() {
         string file = path + "/" + example;
         files.push_back(file);
     }
-    for (const auto& file : files) {
+    for (auto const& file : files) {
         string label("Checking configuration from file: ");
         label += file;
         SCOPED_TRACE(label);
index 0973a74d5ce4e31eac84bfefbbb7564325a7a132..8ee1a8a3dcbf2826e1dbf1bc9d76256665df0422 100644 (file)
@@ -3518,7 +3518,7 @@ TEST_F(HooksDhcpv4SrvTest, leases4ParkedPacketLimit) {
     ASSERT_FALSE(client.getContext().response_);
 
     // Verify we have a packet parked.
-    const auto& parking_lot = ServerHooks::getServerHooks().getParkingLotPtr("leases4_committed");
+    auto const& parking_lot = ServerHooks::getServerHooks().getParkingLotPtr("leases4_committed");
     ASSERT_TRUE(parking_lot);
     ASSERT_EQ(1, parking_lot->size());
 
@@ -3878,7 +3878,7 @@ TEST_F(HooksDhcpv4SrvTest, lease4OfferParkedPacketLimit) {
     ASSERT_FALSE(client.getContext().response_);
 
     // Verify we have a packet parked.
-    const auto& parking_lot = ServerHooks::getServerHooks().getParkingLotPtr("lease4_offer");
+    auto const& parking_lot = ServerHooks::getServerHooks().getParkingLotPtr("lease4_offer");
     ASSERT_TRUE(parking_lot);
     ASSERT_EQ(1, parking_lot->size());
 
index ad4f94a940efdb7cbd1cd34ad4b66b2a4944961a..a7e737958196435baae8238e204555708148f623 100644 (file)
@@ -1153,7 +1153,7 @@ Dhcpv6Srv::processDhcp6Query(Pkt6Ptr& query, Pkt6Ptr& rsp) {
         }
 
         if (parked_packet_limit) {
-            const auto& parking_lot = ServerHooks::getServerHooks().
+            auto const& parking_lot = ServerHooks::getServerHooks().
                 getParkingLotPtr("leases6_committed");
             if (parking_lot && (parking_lot->size() >= parked_packet_limit)) {
                 // We can't park it so we're going to throw it on the floor.
@@ -1426,7 +1426,7 @@ Dhcpv6Srv::buildCfgOptionList(const Pkt6Ptr& question,
     // Secondly, pool specific options. Pools are defined within a subnet, so
     // if there is no subnet, there is nothing to do.
     if (ctx.subnet_) {
-        for (const auto& resource : ctx.allocated_resources_) {
+        for (auto const& resource : ctx.allocated_resources_) {
             PoolPtr pool =
                 ctx.subnet_->getPool(resource.getPrefixLength() == 128 ?
                                      Lease::TYPE_NA : Lease::TYPE_PD,
@@ -2019,7 +2019,7 @@ Dhcpv6Srv::assignLeases(const Pkt6Ptr& question, Pkt6Ptr& answer,
     // responses in answer message (ADVERTISE or REPLY).
     //
     // @todo: IA_TA once we implement support for temporary addresses.
-    for (const auto& opt : question->options_) {
+    for (auto const& opt : question->options_) {
         switch (opt.second->getType()) {
         case D6O_IA_NA: {
             OptionPtr answer_opt = assignIA_NA(question, ctx,
@@ -3009,7 +3009,7 @@ Dhcpv6Srv::extendLeases(const Pkt6Ptr& query, Pkt6Ptr& reply,
     // Save the originally selected subnet.
     Subnet6Ptr orig_subnet = ctx.subnet_;
 
-    for (const auto& opt : query->options_) {
+    for (auto const& opt : query->options_) {
         switch (opt.second->getType()) {
         case D6O_IA_NA: {
             OptionPtr answer_opt = extendIA_NA(query, ctx,
@@ -3061,7 +3061,7 @@ Dhcpv6Srv::releaseLeases(const Pkt6Ptr& release, Pkt6Ptr& reply,
     // handled properly. Therefore the releaseIA_NA and releaseIA_PD options
     // may turn the status code to some error, but can't turn it back to success.
     int general_status = STATUS_Success;
-    for (const auto& opt : release->options_) {
+    for (auto const& opt : release->options_) {
         Lease6Ptr old_lease;
         switch (opt.second->getType()) {
         case D6O_IA_NA: {
@@ -3289,9 +3289,9 @@ Dhcpv6Srv::releaseIA_NA(const DuidPtr& duid, const Pkt6Ptr& query,
                 StatsMgr::generateName("subnet", lease->subnet_id_, "assigned-nas"),
                 static_cast<int64_t>(-1));
 
-            const auto& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets6()->getBySubnetId(lease->subnet_id_);
+            auto const& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets6()->getBySubnetId(lease->subnet_id_);
             if (subnet) {
-                const auto& pool = subnet->getPool(Lease::TYPE_NA, lease->addr_, false);
+                auto const& pool = subnet->getPool(Lease::TYPE_NA, lease->addr_, false);
                 if (pool) {
                     StatsMgr::instance().addValue(
                         StatsMgr::generateName("subnet", subnet->getID(),
@@ -3497,9 +3497,9 @@ Dhcpv6Srv::releaseIA_PD(const DuidPtr& duid, const Pkt6Ptr& query,
                 StatsMgr::generateName("subnet", lease->subnet_id_, "assigned-pds"),
                 static_cast<int64_t>(-1));
 
-            const auto& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets6()->getBySubnetId(lease->subnet_id_);
+            auto const& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets6()->getBySubnetId(lease->subnet_id_);
             if (subnet) {
-                const auto& pool = subnet->getPool(Lease::TYPE_PD, lease->addr_, false);
+                auto const& pool = subnet->getPool(Lease::TYPE_PD, lease->addr_, false);
                 if (pool) {
                     StatsMgr::instance().addValue(
                         StatsMgr::generateName("subnet", subnet->getID(),
@@ -3876,7 +3876,7 @@ Dhcpv6Srv::declineLeases(const Pkt6Ptr& decline, Pkt6Ptr& reply,
     // may turn the status code to some error, but can't turn it back to success.
     int general_status = STATUS_Success;
 
-    for (const auto& opt : decline->options_) {
+    for (auto const& opt : decline->options_) {
         switch (opt.second->getType()) {
         case D6O_IA_NA: {
             OptionPtr answer_opt = declineIA(decline, ctx.duid_, general_status,
@@ -4125,9 +4125,9 @@ Dhcpv6Srv::declineLease(const Pkt6Ptr& decline, const Lease6Ptr lease,
         StatsMgr::generateName("subnet", lease->subnet_id_, "declined-addresses"),
         static_cast<int64_t>(1));
 
-    const auto& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets6()->getBySubnetId(lease->subnet_id_);
+    auto const& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets6()->getBySubnetId(lease->subnet_id_);
     if (subnet) {
-        const auto& pool = subnet->getPool(Lease::TYPE_NA, lease->addr_, false);
+        auto const& pool = subnet->getPool(Lease::TYPE_NA, lease->addr_, false);
         if (pool) {
             StatsMgr::instance().addValue(
                 StatsMgr::generateName("subnet", subnet->getID(),
@@ -4209,7 +4209,7 @@ Dhcpv6Srv::processDhcp4Query(const Pkt6Ptr& dhcp4_query) {
 
 void Dhcpv6Srv::classifyByVendor(const Pkt6Ptr& pkt) {
     OptionVendorClassPtr vclass;
-    for (const auto& opt : pkt->getOptions(D6O_VENDOR_CLASS)) {
+    for (auto const& opt : pkt->getOptions(D6O_VENDOR_CLASS)) {
         vclass = boost::dynamic_pointer_cast<OptionVendorClass>(opt.second);
         if (!vclass || vclass->getTuplesNum() == 0) {
             continue;
@@ -4331,7 +4331,7 @@ Dhcpv6Srv::requiredClassify(const Pkt6Ptr& pkt, AllocEngine::ClientContext6& ctx
         }
 
         // And finish by pools
-        for (const auto& resource : ctx.allocated_resources_) {
+        for (auto const& resource : ctx.allocated_resources_) {
             PoolPtr pool =
                 ctx.subnet_->getPool(resource.getPrefixLength() == 128 ?
                                      Lease::TYPE_NA : Lease::TYPE_PD,
index a3fd0cd15d776bbf4a74632a65e9dd5282c1f9c5..ef08dbdd24d04d397036da8d705124706084a2f8 100644 (file)
@@ -492,7 +492,7 @@ public:
                 uint32_t t1, uint32_t t2, uint32_t pref, uint32_t valid,
                 uint32_t min_pref = 0, uint32_t max_pref = 0,
                 uint32_t min_valid = 0, uint32_t max_valid = 0) {
-        const auto& index = col.template get<SubnetPrefixIndexTag>();
+        auto const& index = col.template get<SubnetPrefixIndexTag>();
         auto subnet_it = index.find(subnet);
         if (subnet_it == index.cend()) {
             ADD_FAILURE() << "Unable to find expected subnet " << subnet;
index c5954023b3b05d75259f9620cea1064473158103..a797a9745df63462a6f669244610ea5516ca40ac 100644 (file)
@@ -144,7 +144,7 @@ Dhcp6Client::applyRcvdConfiguration(const Pkt6Ptr& reply, uint32_t state) {
 
     // Get all options in the reply message and pick IA_NA, IA_PD and
     // Status code.
-    for (const auto& opt : reply->options_) {
+    for (auto const& opt : reply->options_) {
         Option6IAPtr ia = boost::dynamic_pointer_cast<Option6IA>(opt.second);
         if (!ia) {
             // This is not IA, so let's just store it.
@@ -152,8 +152,8 @@ Dhcp6Client::applyRcvdConfiguration(const Pkt6Ptr& reply, uint32_t state) {
             continue;
         }
 
-        const auto& ia_opts = ia->getOptions();
-        for (const auto& iter_ia_opt : ia_opts) {
+        auto const& ia_opts = ia->getOptions();
+        for (auto const& iter_ia_opt : ia_opts) {
             OptionPtr ia_opt = iter_ia_opt.second;
             Lease6 lease;
             lease.type_ = (ia->getType() == D6O_IA_NA ? Lease::TYPE_NA : Lease::TYPE_PD);
@@ -873,7 +873,7 @@ Dhcp6Client::getTeeTimes(const uint32_t iaid, uint32_t& t1, uint32_t& t2) const
     }
 
     // Get all options in the response message and pick IA_NA, IA_PD.
-    for (const auto& opt : context_.response_->options_) {
+    for (auto const& opt : context_.response_->options_) {
         Option6IAPtr ia = boost::dynamic_pointer_cast<Option6IA>(opt.second);
         if (!ia) {
             // This is not IA, so let's just skip it.
index 9b595874e33be05b83af24628250b29cd633e686..656711af22c475e598559641587a39b07b1a0c43 100644 (file)
@@ -366,7 +366,7 @@ Dhcpv6SrvTest::checkConfigFiles() {
         string file = path + "/" + example;
         files.push_back(file);
     }
-    for (const auto& file : files) {
+    for (auto const& file : files) {
         string label("Checking configuration from file: ");
         label += file;
         SCOPED_TRACE(label);
index d72464de6df0397c673ba677af068d71c5dc00d0..d87896eab32a6093d0320b5cd6ded71c55d880b4 100644 (file)
@@ -5705,7 +5705,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6ParkedPacketLimit) {
     ASSERT_NO_THROW(configure(config, *srv_));
 
     // Verify we have no packets parked.
-    const auto& parking_lot = ServerHooks::getServerHooks()
+    auto const& parking_lot = ServerHooks::getServerHooks()
                               .getParkingLotPtr("leases6_committed");
     ASSERT_TRUE(parking_lot);
     ASSERT_EQ(0, parking_lot->size());
index 47165552b7cb9d9fee5075b8387b1f9ac7837fa6..29ef5a87f35f33acf82ed11d77fe0c2aa48f964f 100644 (file)
@@ -861,7 +861,7 @@ TestControl::address6Uniqueness(const Pkt6Ptr& pkt6, ExchangeType xchg_type) {
         std::set<std::string> current;
         // addresses were already checked in validateIA
         // we can safely assume that those are correct
-        for (const auto& opt : pkt6->options_) {
+        for (auto const& opt : pkt6->options_) {
             switch (opt.second->getType()) {
             case D6O_IA_PD: {
                 // add address and check if it has not been already assigned
index 55fc4a71a20c24cd1e94292fb71a6fc431976149..559fcb22c5def00f3479b1b4c0b3baff9f5abfdf 100644 (file)
@@ -375,7 +375,7 @@ public:
             }
         }
         for (auto const& pair : getSubOptionConfigMap()) {
-            for (const auto& sub_pair : pair.second) {
+            for (auto const& sub_pair : pair.second) {
                 const SubOptionConfigPtr& sub_cfg = sub_pair.second;
                 uint16_t sub_code = sub_cfg->getCode();
                 uint16_t opt_code = sub_cfg->getContainerCode();
index 6e4662786a46d6945e8fa28bea43061ebc892b06..79f0c305b2cd7b5fd01327d0f187da1124691062 100644 (file)
@@ -100,7 +100,7 @@ HAConfigParser::parseAll(const HAConfigMapperPtr& config_storage,
     }
 
     // Get the HA configuration.
-    const auto& config_vec = config->listValue();
+    auto const& config_vec = config->listValue();
     if (config_vec.empty()) {
         isc_throw(ConfigError, "a list of HA configurations must not be empty");
     }
@@ -258,7 +258,7 @@ HAConfigParser::parseOne(const HAConfigMapperPtr& config_storage,
     rel_config->setRestrictCommands(getBoolean(config, "restrict-commands"));
 
     // Peers configuration parsing.
-    const auto& peers_vec = peers->listValue();
+    auto const& peers_vec = peers->listValue();
 
     // Go over configuration of each peer.
     for (auto p = peers_vec.begin(); p != peers_vec.end(); ++p) {
@@ -338,7 +338,7 @@ HAConfigParser::parseOne(const HAConfigMapperPtr& config_storage,
 
     // Per state configuration is optional.
     if (states_list) {
-        const auto& states_vec = states_list->listValue();
+        auto const& states_vec = states_list->listValue();
 
         std::set<int> configured_states;
 
index 09f72ca265942a3da34a399905e71c5ae995aa91..1d34b0e889d24cb467a0f25d86500211cb7d8e12 100644 (file)
@@ -2195,7 +2195,7 @@ HAService::asyncSyncLeasesInternal(http::HttpClient& http_client,
                     }
 
                     // Iterate over the leases and update the database as appropriate.
-                    const auto& leases_element = leases->listValue();
+                    auto const& leases_element = leases->listValue();
 
                     LOG_INFO(ha_logger, HA_LEASES_SYNC_LEASE_PAGE_RECEIVED)
                         .arg(config_->getThisServerName())
index b2538ebdb53a70edc64719b60bff16acd4dd6b0d..5efda93f968232ac3cb745c5533210aa6ce07a6f 100644 (file)
@@ -420,7 +420,7 @@ QueryFilter::loadBalance(const dhcp::Pkt4Ptr& query4) const {
     // identifier has been specified.
     OptionPtr opt_client_id = query4->getOption(DHO_DHCP_CLIENT_IDENTIFIER);
     if (opt_client_id && !opt_client_id->getData().empty()) {
-        const auto& client_id_key = opt_client_id->getData();
+        auto const& client_id_key = opt_client_id->getData();
         lb_hash = loadBalanceHash(&client_id_key[0], client_id_key.size());
 
     } else {
@@ -452,7 +452,7 @@ QueryFilter::loadBalance(const dhcp::Pkt6Ptr& query6) const {
     // Compute the hash by DUID if the DUID.
     OptionPtr opt_duid = query6->getOption(D6O_CLIENTID);
     if (opt_duid && !opt_duid->getData().empty()) {
-        const auto& duid_key = opt_duid->getData();
+        auto const& duid_key = opt_duid->getData();
         lb_hash = loadBalanceHash(&duid_key[0], duid_key.size());
 
     } else {
index 648719bf47788ec9d6c41062ec7be87493405332..34e85eaab22fb21b17775d967ccb5bbf095a076c 100644 (file)
@@ -58,7 +58,7 @@ TEST(HARelationshipMapper, mapGetAll) {
     EXPECT_NO_THROW(mapper.map("server3", rel2));
     EXPECT_NO_THROW(mapper.map("server4", rel2));
 
-    const auto& all = mapper.getAll();
+    auto const& all = mapper.getAll();
     EXPECT_EQ(2, all.size());
     EXPECT_EQ(rel1, all[0]);
     EXPECT_EQ(rel2, all[1]);
index 7fc90def1ee8ff6f8df2d14601fb484619c5afbd..243c6382eaad4e37e922ea1b92a75a298012d06b 100644 (file)
@@ -483,7 +483,7 @@ LeaseCmdsImpl::updateStatsOnAdd(const Lease4Ptr& lease) {
             static_cast<int64_t>(1));
 
         PoolPtr pool;
-        const auto& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets4()->getBySubnetId(lease->subnet_id_);
+        auto const& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets4()->getBySubnetId(lease->subnet_id_);
         if (subnet) {
             pool = subnet->getPool(Lease::TYPE_V4, lease->addr_, false);
             if (pool) {
@@ -524,7 +524,7 @@ LeaseCmdsImpl::updateStatsOnAdd(const Lease6Ptr& lease) {
             static_cast<int64_t>(1));
 
         PoolPtr pool;
-        const auto& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets6()->getBySubnetId(lease->subnet_id_);
+        auto const& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets6()->getBySubnetId(lease->subnet_id_);
         if (subnet) {
             pool = subnet->getPool(lease->type_, lease->addr_, false);
             if (pool) {
@@ -653,7 +653,7 @@ LeaseCmdsImpl::updateStatsOnUpdate(const Lease4Ptr& existing,
                 static_cast<int64_t>(1));
 
             PoolPtr pool;
-            const auto& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets4()->getBySubnetId(lease->subnet_id_);
+            auto const& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets4()->getBySubnetId(lease->subnet_id_);
             if (subnet) {
                 pool = subnet->getPool(Lease::TYPE_V4, lease->addr_, false);
                 if (pool) {
@@ -789,7 +789,7 @@ LeaseCmdsImpl::updateStatsOnUpdate(const Lease6Ptr& existing,
                 static_cast<int64_t>(1));
 
             PoolPtr pool;
-            const auto& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets6()->getBySubnetId(lease->subnet_id_);
+            auto const& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets6()->getBySubnetId(lease->subnet_id_);
             if (subnet) {
                 pool = subnet->getPool(lease->type_, lease->addr_, false);
                 if (pool) {
@@ -833,7 +833,7 @@ LeaseCmdsImpl::updateStatsOnDelete(const Lease4Ptr& lease) {
             static_cast<int64_t>(-1));
 
         PoolPtr pool;
-        const auto& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets4()->getBySubnetId(lease->subnet_id_);
+        auto const& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets4()->getBySubnetId(lease->subnet_id_);
         if (subnet) {
             pool = subnet->getPool(Lease::TYPE_V4, lease->addr_, false);
             if (pool) {
@@ -874,7 +874,7 @@ LeaseCmdsImpl::updateStatsOnDelete(const Lease6Ptr& lease) {
             static_cast<int64_t>(-1));
 
         PoolPtr pool;
-        const auto& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets6()->getBySubnetId(lease->subnet_id_);
+        auto const& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets6()->getBySubnetId(lease->subnet_id_);
         if (subnet) {
             pool = subnet->getPool(lease->type_, lease->addr_, false);
             if (pool) {
@@ -1329,14 +1329,14 @@ LeaseCmdsImpl::leaseGetAllHandler(CalloutHandle& handle) {
                 if (v4) {
                     Lease4Collection leases =
                         LeaseMgrFactory::instance().getLeases4((*subnet_id)->intValue());
-                    for (const auto& lease : leases) {
+                    for (auto const& lease : leases) {
                         ElementPtr lease_json = lease->toElement();
                         leases_json->add(lease_json);
                     }
                 } else {
                     Lease6Collection leases =
                         LeaseMgrFactory::instance().getLeases6((*subnet_id)->intValue());
-                    for (const auto& lease : leases) {
+                    for (auto const& lease : leases) {
                         ElementPtr lease_json = lease->toElement();
                         leases_json->add(lease_json);
                     }
@@ -1347,13 +1347,13 @@ LeaseCmdsImpl::leaseGetAllHandler(CalloutHandle& handle) {
             // There is no 'subnets' argument so let's return all leases.
             if (v4) {
                 Lease4Collection leases = LeaseMgrFactory::instance().getLeases4();
-                for (const auto& lease : leases) {
+                for (auto const& lease : leases) {
                     ElementPtr lease_json = lease->toElement();
                     leases_json->add(lease_json);
                 }
             } else {
                 Lease6Collection leases = LeaseMgrFactory::instance().getLeases6();
-                for (const auto& lease : leases) {
+                for (auto const& lease : leases) {
                     ElementPtr lease_json = lease->toElement();
                     leases_json->add(lease_json);
                 }
@@ -1456,7 +1456,7 @@ LeaseCmdsImpl::leaseGetPageHandler(CalloutHandle& handle) {
                                                        LeasePageSize(page_limit_value));
 
             // Convert leases into JSON list.
-            for (const auto& lease : leases) {
+            for (auto const& lease : leases) {
                 ElementPtr lease_json = lease->toElement();
                 leases_json->add(lease_json);
             }
@@ -1467,7 +1467,7 @@ LeaseCmdsImpl::leaseGetPageHandler(CalloutHandle& handle) {
                 LeaseMgrFactory::instance().getLeases6(*from_address,
                                                        LeasePageSize(page_limit_value));
             // Convert leases into JSON list.
-            for (const auto& lease : leases) {
+            for (auto const& lease : leases) {
                 ElementPtr lease_json = lease->toElement();
                 leases_json->add(lease_json);
             }
@@ -1526,7 +1526,7 @@ LeaseCmdsImpl::leaseGetByHwAddressHandler(CalloutHandle& handle) {
         Lease4Collection leases =
             LeaseMgrFactory::instance().getLease4(hwaddr);
         ElementPtr leases_json = Element::createList();
-        for (const auto& lease : leases) {
+        for (auto const& lease : leases) {
             ElementPtr lease_json = lease->toElement();
             leases_json->add(lease_json);
         }
@@ -1576,7 +1576,7 @@ LeaseCmdsImpl::leaseGetByClientIdHandler(CalloutHandle& handle) {
         Lease4Collection leases =
             LeaseMgrFactory::instance().getLease4(*clientid);
         ElementPtr leases_json = Element::createList();
-        for (const auto& lease : leases) {
+        for (auto const& lease : leases) {
             ElementPtr lease_json = lease->toElement();
             leases_json->add(lease_json);
         }
@@ -1626,7 +1626,7 @@ LeaseCmdsImpl::leaseGetByDuidHandler(CalloutHandle& handle) {
         Lease6Collection leases =
             LeaseMgrFactory::instance().getLeases6(duid_);
         ElementPtr leases_json = Element::createList();
-        for (const auto& lease : leases) {
+        for (auto const& lease : leases) {
             ElementPtr lease_json = lease->toElement();
             leases_json->add(lease_json);
         }
@@ -1685,7 +1685,7 @@ LeaseCmdsImpl::leaseGetByHostnameHandler(CalloutHandle& handle) {
             Lease4Collection leases =
                 LeaseMgrFactory::instance().getLeases4(hostname_);
 
-            for (const auto& lease : leases) {
+            for (auto const& lease : leases) {
                 ElementPtr lease_json = lease->toElement();
                 leases_json->add(lease_json);
             }
@@ -1693,7 +1693,7 @@ LeaseCmdsImpl::leaseGetByHostnameHandler(CalloutHandle& handle) {
             Lease6Collection leases =
                 LeaseMgrFactory::instance().getLeases6(hostname_);
 
-            for (const auto& lease : leases) {
+            for (auto const& lease : leases) {
                 ElementPtr lease_json = lease->toElement();
                 leases_json->add(lease_json);
             }
@@ -1836,7 +1836,7 @@ LeaseCmdsImpl::lease6BulkApplyHandler(CalloutHandle& handle) {
             auto leases_list = deleted_leases->listValue();
 
             // Iterate over leases to be deleted.
-            for (const auto& lease_params : leases_list) {
+            for (auto const& lease_params : leases_list) {
                 // Parsing the lease may throw and it means that the lease
                 // information is malformed.
                 Parameters p = getParameters(true, lease_params);
@@ -1853,7 +1853,7 @@ LeaseCmdsImpl::lease6BulkApplyHandler(CalloutHandle& handle) {
 
             // Iterate over all leases.
             auto leases_list = leases->listValue();
-            for (const auto& lease_params : leases_list) {
+            for (auto const& lease_params : leases_list) {
 
                 Lease6Parser parser;
                 bool force_update;
@@ -1872,7 +1872,7 @@ LeaseCmdsImpl::lease6BulkApplyHandler(CalloutHandle& handle) {
         if (!parsed_deleted_list.empty()) {
 
             // Iterate over leases to be deleted.
-            for (const auto& lease_params_pair : parsed_deleted_list) {
+            for (auto const& lease_params_pair : parsed_deleted_list) {
 
                 // This part is outside of the try-catch because an exception
                 // indicates that the command is malformed.
@@ -1924,7 +1924,7 @@ LeaseCmdsImpl::lease6BulkApplyHandler(CalloutHandle& handle) {
             ConstSrvConfigPtr config = CfgMgr::instance().getCurrentCfg();
 
             // Iterate over all leases.
-            for (const auto& lease : parsed_leases_list) {
+            for (auto const& lease : parsed_leases_list) {
 
                 auto result = CONTROL_RESULT_SUCCESS;
                 std::ostringstream text;
@@ -2244,7 +2244,7 @@ LeaseCmdsImpl::lease4WipeHandler(CalloutHandle& handle) {
 
             auto const& sub = CfgMgr::instance().getCurrentCfg()->getCfgSubnets4()->getBySubnetId(id);
             if (sub) {
-                for (const auto& pool : sub->getPools(Lease::TYPE_V4)) {
+                for (auto const& pool : sub->getPools(Lease::TYPE_V4)) {
                     const std::string& name_aa(StatsMgr::generateName("subnet", sub->getID(),
                                                                       StatsMgr::generateName("pool", pool->getID(),
                                                                                              "assigned-addresses")));
@@ -2269,7 +2269,7 @@ LeaseCmdsImpl::lease4WipeHandler(CalloutHandle& handle) {
             const Subnet4Collection* subs = subnets->getAll();
 
             // Go over all subnets and wipe leases in each of them.
-            for (const auto& sub : *subs) {
+            for (auto const& sub : *subs) {
                 num += LeaseMgrFactory::instance().wipeLeases4(sub->getID());
                 ids << " " << sub->getID();
                 StatsMgr::instance().setValue(
@@ -2280,7 +2280,7 @@ LeaseCmdsImpl::lease4WipeHandler(CalloutHandle& handle) {
                     StatsMgr::generateName("subnet", sub->getID(), "declined-addresses"),
                     static_cast<int64_t>(0));
 
-                for (const auto& pool : sub->getPools(Lease::TYPE_V4)) {
+                for (auto const& pool : sub->getPools(Lease::TYPE_V4)) {
                     const std::string& name_aa(StatsMgr::generateName("subnet", sub->getID(),
                                                                       StatsMgr::generateName("pool", pool->getID(),
                                                                                              "assigned-addresses")));
@@ -2367,7 +2367,7 @@ LeaseCmdsImpl::lease6WipeHandler(CalloutHandle& handle) {
 
             auto const& sub = CfgMgr::instance().getCurrentCfg()->getCfgSubnets6()->getBySubnetId(id);
             if (sub) {
-                for (const auto& pool : sub->getPools(Lease::TYPE_NA)) {
+                for (auto const& pool : sub->getPools(Lease::TYPE_NA)) {
                     const std::string& name_anas(StatsMgr::generateName("subnet", sub->getID(),
                                                                         StatsMgr::generateName("pool", pool->getID(),
                                                                                                "assigned-nas")));
@@ -2383,7 +2383,7 @@ LeaseCmdsImpl::lease6WipeHandler(CalloutHandle& handle) {
                     }
                 }
 
-                for (const auto& pool : sub->getPools(Lease::TYPE_PD)) {
+                for (auto const& pool : sub->getPools(Lease::TYPE_PD)) {
                     const std::string& name_apds(StatsMgr::generateName("subnet", sub->getID(),
                                                                         StatsMgr::generateName("pd-pool", pool->getID(),
                                                                                                "assigned-pds")));
@@ -2401,7 +2401,7 @@ LeaseCmdsImpl::lease6WipeHandler(CalloutHandle& handle) {
             const Subnet6Collection* subs = subnets->getAll();
 
             // Go over all subnets and wipe leases in each of them.
-            for (const auto& sub : *subs) {
+            for (auto const& sub : *subs) {
                 num += LeaseMgrFactory::instance().wipeLeases6(sub->getID());
                 ids << " " << sub->getID();
                 StatsMgr::instance().setValue(
@@ -2416,7 +2416,7 @@ LeaseCmdsImpl::lease6WipeHandler(CalloutHandle& handle) {
                     StatsMgr::generateName("subnet", sub->getID(), "declined-addresses"),
                     static_cast<int64_t>(0));
 
-                for (const auto& pool : sub->getPools(Lease::TYPE_NA)) {
+                for (auto const& pool : sub->getPools(Lease::TYPE_NA)) {
                     const std::string& name_anas(StatsMgr::generateName("subnet", sub->getID(),
                                                                         StatsMgr::generateName("pool", pool->getID(),
                                                                                                "assigned-nas")));
@@ -2432,7 +2432,7 @@ LeaseCmdsImpl::lease6WipeHandler(CalloutHandle& handle) {
                     }
                 }
 
-                for (const auto& pool : sub->getPools(Lease::TYPE_PD)) {
+                for (auto const& pool : sub->getPools(Lease::TYPE_PD)) {
                     const std::string& name_apds(StatsMgr::generateName("subnet", sub->getID(),
                                                                         StatsMgr::generateName("pd-pool", pool->getID(),
                                                                                                "assigned-pds")));
index 992ee5740f398895108112f5c8e897cbac11c474..53b67998a7e2394f89b365b9183de55f0a414df8 100644 (file)
@@ -1035,7 +1035,7 @@ public:
 
         // Create JSON list of required classes.
         ElementPtr required_classes_element = Element::createList();
-        const auto& required_classes = subnet->getRequiredClasses();
+        auto const& required_classes = subnet->getRequiredClasses();
         for (auto required_class = required_classes.cbegin();
              required_class != required_classes.cend();
              ++required_class) {
@@ -1161,14 +1161,14 @@ public:
                                MySqlBinding::createTimestamp(subnet->getModificationTime()));
 
         // (Re)create pools.
-        for (const auto& pool : subnet->getPools(Lease::TYPE_V4)) {
+        for (auto const& pool : subnet->getPools(Lease::TYPE_V4)) {
             createPool4(server_selector, boost::dynamic_pointer_cast<Pool4>(pool),
                         subnet);
         }
 
         // (Re)create options.
         auto option_spaces = subnet->getCfgOption()->getOptionSpaceNames();
-        for (const auto& option_space : option_spaces) {
+        for (auto const& option_space : option_spaces) {
             OptionContainerPtr options = subnet->getCfgOption()->getAll(option_space);
             for (auto desc = options->begin(); desc != options->end(); ++desc) {
                 OptionDescriptorPtr desc_copy = OptionDescriptor::create(*desc);
@@ -1203,7 +1203,7 @@ public:
 
         uint64_t pool_id = mysql_insert_id(conn_.mysql_);
         auto option_spaces = pool->getCfgOption()->getOptionSpaceNames();
-        for (const auto& option_space : option_spaces) {
+        for (auto const& option_space : option_spaces) {
             OptionContainerPtr options = pool->getCfgOption()->getAll(option_space);
             for (auto desc = options->begin(); desc != options->end(); ++desc) {
                 OptionDescriptorPtr desc_copy = OptionDescriptor::create(*desc);
@@ -1798,7 +1798,7 @@ public:
 
         // (Re)create options.
         auto option_spaces = shared_network->getCfgOption()->getOptionSpaceNames();
-        for (const auto& option_space : option_spaces) {
+        for (auto const& option_space : option_spaces) {
             OptionContainerPtr options = shared_network->getCfgOption()->getAll(option_space);
             for (auto desc = options->begin(); desc != options->end(); ++desc) {
                 OptionDescriptorPtr desc_copy = OptionDescriptor::create(*desc);
@@ -2721,7 +2721,7 @@ public:
                                MySqlBinding::createTimestamp(client_class->getModificationTime()));
 
         // Iterate over the captured dependencies and try to insert them into the database.
-        for (const auto& dependency : dependencies) {
+        for (auto const& dependency : dependencies) {
             try {
                 MySqlBindingCollection in_dependency_bindings = {
                     MySqlBinding::createString(client_class->getName()),
@@ -2747,7 +2747,7 @@ public:
         if (client_class->getCfgOptionDef()) {
             auto option_defs = client_class->getCfgOptionDef()->getContainer();
             auto option_spaces = option_defs.getOptionSpaceNames();
-            for (const auto& option_space : option_spaces) {
+            for (auto const& option_space : option_spaces) {
                 OptionDefContainerPtr defs = option_defs.getItems(option_space);
                 for (auto def = defs->begin(); def != defs->end(); ++def) {
                     createUpdateOptionDef4(server_selector, *def, client_class->getName());
@@ -2757,7 +2757,7 @@ public:
 
         // (Re)create options.
         auto option_spaces = client_class->getCfgOption()->getOptionSpaceNames();
-        for (const auto& option_space : option_spaces) {
+        for (auto const& option_space : option_spaces) {
             OptionContainerPtr options = client_class->getCfgOption()->getAll(option_space);
             for (auto desc = options->begin(); desc != options->end(); ++desc) {
                 OptionDescriptorPtr desc_copy = OptionDescriptor::create(*desc);
@@ -2922,7 +2922,7 @@ public:
             }
 
             // Iterate over the configured DBs and instantiate them.
-            for (const auto& db : config_ctl->getConfigDatabases()) {
+            for (auto const& db : config_ctl->getConfigDatabases()) {
                 const std::string& access = db.getAccessString();
                 auto parameters = db.getParameters();
                 if (ConfigBackendDHCPv4Mgr::instance().delBackend(parameters["type"], access, true)) {
index c32babe9f90ecba22b6db4039ff94919fa51ec58..1ab8655f99af5910d818e6378f0cac03e86b02a8 100644 (file)
@@ -1277,7 +1277,7 @@ public:
 
         // Create JSON list of required classes.
         ElementPtr required_classes_element = Element::createList();
-        const auto& required_classes = subnet->getRequiredClasses();
+        auto const& required_classes = subnet->getRequiredClasses();
         for (auto required_class = required_classes.cbegin();
              required_class != required_classes.cend();
              ++required_class) {
@@ -1412,20 +1412,20 @@ public:
                                MySqlBinding::createTimestamp(subnet->getModificationTime()));
 
         // (Re)create pools.
-        for (const auto& pool : subnet->getPools(Lease::TYPE_NA)) {
+        for (auto const& pool : subnet->getPools(Lease::TYPE_NA)) {
             createPool6(server_selector, boost::dynamic_pointer_cast<Pool6>(pool),
                         subnet);
         }
 
         // (Re)create pd pools.
-        for (const auto& pd_pool : subnet->getPools(Lease::TYPE_PD)) {
+        for (auto const& pd_pool : subnet->getPools(Lease::TYPE_PD)) {
             createPdPool6(server_selector, boost::dynamic_pointer_cast<Pool6>(pd_pool),
                           subnet);
         }
 
         // (Re)create options.
         auto option_spaces = subnet->getCfgOption()->getOptionSpaceNames();
-        for (const auto& option_space : option_spaces) {
+        for (auto const& option_space : option_spaces) {
             OptionContainerPtr options = subnet->getCfgOption()->getAll(option_space);
             for (auto desc = options->begin(); desc != options->end(); ++desc) {
                 OptionDescriptorPtr desc_copy = OptionDescriptor::create(*desc);
@@ -1461,7 +1461,7 @@ public:
 
         uint64_t pool_id = mysql_insert_id(conn_.mysql_);
         auto option_spaces = pool->getCfgOption()->getOptionSpaceNames();
-        for (const auto& option_space : option_spaces) {
+        for (auto const& option_space : option_spaces) {
             OptionContainerPtr options = pool->getCfgOption()->getAll(option_space);
             for (auto desc = options->begin(); desc != options->end(); ++desc) {
                 OptionDescriptorPtr desc_copy = OptionDescriptor::create(*desc);
@@ -1512,7 +1512,7 @@ public:
 
         uint64_t pd_pool_id = mysql_insert_id(conn_.mysql_);
         auto option_spaces = pd_pool->getCfgOption()->getOptionSpaceNames();
-        for (const auto& option_space : option_spaces) {
+        for (auto const& option_space : option_spaces) {
             OptionContainerPtr options = pd_pool->getCfgOption()->getAll(option_space);
             for (auto desc = options->begin(); desc != options->end(); ++desc) {
                 OptionDescriptorPtr desc_copy = OptionDescriptor::create(*desc);
@@ -2137,7 +2137,7 @@ public:
 
         // (Re)create options.
         auto option_spaces = shared_network->getCfgOption()->getOptionSpaceNames();
-        for (const auto& option_space : option_spaces) {
+        for (auto const& option_space : option_spaces) {
             OptionContainerPtr options = shared_network->getCfgOption()->getAll(option_space);
             for (auto desc = options->begin(); desc != options->end(); ++desc) {
                 OptionDescriptorPtr desc_copy = OptionDescriptor::create(*desc);
@@ -3148,7 +3148,7 @@ public:
                                MySqlBinding::createTimestamp(client_class->getModificationTime()));
 
         // Iterate over the captured dependencies and try to insert them into the database.
-        for (const auto& dependency : dependencies) {
+        for (auto const& dependency : dependencies) {
             try {
                 MySqlBindingCollection in_dependency_bindings = {
                     MySqlBinding::createString(client_class->getName()),
@@ -3174,7 +3174,7 @@ public:
         if (client_class->getCfgOptionDef()) {
             auto option_defs = client_class->getCfgOptionDef()->getContainer();
             auto option_spaces = option_defs.getOptionSpaceNames();
-            for (const auto& option_space : option_spaces) {
+            for (auto const& option_space : option_spaces) {
                 OptionDefContainerPtr defs = option_defs.getItems(option_space);
                 for (auto def = defs->begin(); def != defs->end(); ++def) {
                     createUpdateOptionDef6(server_selector, *def, client_class->getName());
@@ -3184,7 +3184,7 @@ public:
 
         // (Re)create options.
         auto option_spaces = client_class->getCfgOption()->getOptionSpaceNames();
-        for (const auto& option_space : option_spaces) {
+        for (auto const& option_space : option_spaces) {
             OptionContainerPtr options = client_class->getCfgOption()->getAll(option_space);
             for (auto desc = options->begin(); desc != options->end(); ++desc) {
                 OptionDescriptorPtr desc_copy = OptionDescriptor::create(*desc);
@@ -3349,7 +3349,7 @@ public:
             }
 
             // Iterate over the configured DBs and instantiate them.
-            for (const auto& db : config_ctl->getConfigDatabases()) {
+            for (auto const& db : config_ctl->getConfigDatabases()) {
                 const std::string& access = db.getAccessString();
                 auto parameters = db.getParameters();
                 if (ConfigBackendDHCPv6Mgr::instance().delBackend(parameters["type"], access, true)) {
index 13284b25480a027d24513dbb7e3b140c68c192cc..890fc7ff062f3c36ebdbb8708d67494306ff08c0 100644 (file)
@@ -974,9 +974,9 @@ MySqlConfigBackendImpl::attachElementToServers(const int index,
 MySqlBindingPtr
 MySqlConfigBackendImpl::createInputRelayBinding(const NetworkPtr& network) {
     ElementPtr relay_element = Element::createList();
-    const auto& addresses = network->getRelayAddresses();
+    auto const& addresses = network->getRelayAddresses();
     if (!addresses.empty()) {
-        for (const auto& address : addresses) {
+        for (auto const& address : addresses) {
             relay_element->add(Element::create(address.toText()));
         }
     }
index 8592ecf955188e3d5ba12d4786787f28672ba082..c4f84da36cc5e4c9e0f895d78d219e9386906984 100644 (file)
@@ -633,7 +633,7 @@ public:
     db::MySqlBindingPtr createInputRequiredClassesBinding(const T& object) {
         // Create JSON list of required classes.
         data::ElementPtr required_classes_element = data::Element::createList();
-        const auto& required_classes = object->getRequiredClasses();
+        auto const& required_classes = object->getRequiredClasses();
         for (auto required_class = required_classes.cbegin();
              required_class != required_classes.cend();
              ++required_class) {
index 71eb9fa91f04a1f2172274bf9fefdb5ba277e0d4..9b99b31a0d7e289e2b3c0283dc03bd1b49d3b2ec 100644 (file)
@@ -1001,14 +1001,14 @@ public:
                                server_selector, attach_bindings);
 
         // (Re)create pools.
-        for (const auto& pool : subnet->getPools(Lease::TYPE_V4)) {
+        for (auto const& pool : subnet->getPools(Lease::TYPE_V4)) {
             createPool4(server_selector, boost::dynamic_pointer_cast<Pool4>(pool),
                         subnet);
         }
 
         // (Re)create options.
         auto option_spaces = subnet->getCfgOption()->getOptionSpaceNames();
-        for (const auto& option_space : option_spaces) {
+        for (auto const& option_space : option_spaces) {
             OptionContainerPtr options = subnet->getCfgOption()->getAll(option_space);
             for (auto desc = options->begin(); desc != options->end(); ++desc) {
                 OptionDescriptorPtr desc_copy = OptionDescriptor::create(*desc);
@@ -1048,7 +1048,7 @@ public:
 
         // Add the pool's options.
         auto option_spaces = pool->getCfgOption()->getOptionSpaceNames();
-        for (const auto& option_space : option_spaces) {
+        for (auto const& option_space : option_spaces) {
             OptionContainerPtr options = pool->getCfgOption()->getAll(option_space);
             for (auto desc = options->begin(); desc != options->end(); ++desc) {
                 OptionDescriptorPtr desc_copy = OptionDescriptor::create(*desc);
@@ -1574,7 +1574,7 @@ public:
 
         // (Re)create options.
         auto option_spaces = shared_network->getCfgOption()->getOptionSpaceNames();
-        for (const auto& option_space : option_spaces) {
+        for (auto const& option_space : option_spaces) {
             OptionContainerPtr options = shared_network->getCfgOption()->getAll(option_space);
             for (auto desc = options->begin(); desc != options->end(); ++desc) {
                 OptionDescriptorPtr desc_copy = OptionDescriptor::create(*desc);
@@ -2522,7 +2522,7 @@ public:
                                server_selector, attach_bindings);
 
         // Iterate over the captured dependencies and try to insert them into the database.
-        for (const auto& dependency : dependencies) {
+        for (auto const& dependency : dependencies) {
             try {
                 PsqlBindArray in_dependency_bindings;
                 in_dependency_bindings.add(class_name);
@@ -2548,7 +2548,7 @@ public:
         if (client_class->getCfgOptionDef()) {
             auto option_defs = client_class->getCfgOptionDef()->getContainer();
             auto option_spaces = option_defs.getOptionSpaceNames();
-            for (const auto& option_space : option_spaces) {
+            for (auto const& option_space : option_spaces) {
                 OptionDefContainerPtr defs = option_defs.getItems(option_space);
                 for (auto def = defs->begin(); def != defs->end(); ++def) {
                     createUpdateOptionDef4(server_selector, *def, client_class->getName());
@@ -2558,7 +2558,7 @@ public:
 
         // (Re)create options.
         auto option_spaces = client_class->getCfgOption()->getOptionSpaceNames();
-        for (const auto& option_space : option_spaces) {
+        for (auto const& option_space : option_spaces) {
             OptionContainerPtr options = client_class->getCfgOption()->getAll(option_space);
             for (auto desc = options->begin(); desc != options->end(); ++desc) {
                 OptionDescriptorPtr desc_copy = OptionDescriptor::create(*desc);
@@ -2725,7 +2725,7 @@ public:
             }
 
             // Iterate over the configured DBs and instantiate them.
-            for (const auto& db : config_ctl->getConfigDatabases()) {
+            for (auto const& db : config_ctl->getConfigDatabases()) {
                 const std::string& access = db.getAccessString();
                 auto parameters = db.getParameters();
                 if (ConfigBackendDHCPv4Mgr::instance().delBackend(parameters["type"], access, true)) {
index 899f912613d2e55029d2b0488280c25c37ff6f67..4595a0a5b9ec7b9aa7e4396f84be7d4c524b1622 100644 (file)
@@ -1170,20 +1170,20 @@ public:
                                server_selector, attach_bindings);
 
         // (Re)create pools.
-        for (const auto& pool : subnet->getPools(Lease::TYPE_NA)) {
+        for (auto const& pool : subnet->getPools(Lease::TYPE_NA)) {
             createPool6(server_selector, boost::dynamic_pointer_cast<Pool6>(pool),
                         subnet);
         }
 
         // (Re)create pd pools.
-        for (const auto& pd_pool : subnet->getPools(Lease::TYPE_PD)) {
+        for (auto const& pd_pool : subnet->getPools(Lease::TYPE_PD)) {
             createPdPool6(server_selector, boost::dynamic_pointer_cast<Pool6>(pd_pool),
                           subnet);
         }
 
         // (Re)create options.
         auto option_spaces = subnet->getCfgOption()->getOptionSpaceNames();
-        for (const auto& option_space : option_spaces) {
+        for (auto const& option_space : option_spaces) {
             OptionContainerPtr options = subnet->getCfgOption()->getAll(option_space);
             for (auto desc = options->begin(); desc != options->end(); ++desc) {
                 OptionDescriptorPtr desc_copy = OptionDescriptor::create(*desc);
@@ -1223,7 +1223,7 @@ public:
 
         // Add the pool's options.
         auto option_spaces = pool->getCfgOption()->getOptionSpaceNames();
-        for (const auto& option_space : option_spaces) {
+        for (auto const& option_space : option_spaces) {
             OptionContainerPtr options = pool->getCfgOption()->getAll(option_space);
             for (auto desc = options->begin(); desc != options->end(); ++desc) {
                 OptionDescriptorPtr desc_copy = OptionDescriptor::create(*desc);
@@ -1277,7 +1277,7 @@ public:
 
         // Add the pool's options.
         auto option_spaces = pd_pool->getCfgOption()->getOptionSpaceNames();
-        for (const auto& option_space : option_spaces) {
+        for (auto const& option_space : option_spaces) {
             OptionContainerPtr options = pd_pool->getCfgOption()->getAll(option_space);
             for (auto desc = options->begin(); desc != options->end(); ++desc) {
                 OptionDescriptorPtr desc_copy = OptionDescriptor::create(*desc);
@@ -1811,7 +1811,7 @@ public:
 
         // (Re)create options.
         auto option_spaces = shared_network->getCfgOption()->getOptionSpaceNames();
-        for (const auto& option_space : option_spaces) {
+        for (auto const& option_space : option_spaces) {
             OptionContainerPtr options = shared_network->getCfgOption()->getAll(option_space);
             for (auto desc = options->begin(); desc != options->end(); ++desc) {
                 OptionDescriptorPtr desc_copy = OptionDescriptor::create(*desc);
@@ -2844,7 +2844,7 @@ public:
                                server_selector, attach_bindings);
 
         // Iterate over the captured dependencies and try to insert them into the database.
-        for (const auto& dependency : dependencies) {
+        for (auto const& dependency : dependencies) {
             try {
                 PsqlBindArray in_dependency_bindings;
                 in_dependency_bindings.add(class_name);
@@ -2870,7 +2870,7 @@ public:
         if (client_class->getCfgOptionDef()) {
             auto option_defs = client_class->getCfgOptionDef()->getContainer();
             auto option_spaces = option_defs.getOptionSpaceNames();
-            for (const auto& option_space : option_spaces) {
+            for (auto const& option_space : option_spaces) {
                 OptionDefContainerPtr defs = option_defs.getItems(option_space);
                 for (auto def = defs->begin(); def != defs->end(); ++def) {
                     createUpdateOptionDef6(server_selector, *def, client_class->getName());
@@ -2880,7 +2880,7 @@ public:
 
         // (Re)create options.
         auto option_spaces = client_class->getCfgOption()->getOptionSpaceNames();
-        for (const auto& option_space : option_spaces) {
+        for (auto const& option_space : option_spaces) {
             OptionContainerPtr options = client_class->getCfgOption()->getAll(option_space);
             for (auto desc = options->begin(); desc != options->end(); ++desc) {
                 OptionDescriptorPtr desc_copy = OptionDescriptor::create(*desc);
@@ -3047,7 +3047,7 @@ public:
             }
 
             // Iterate over the configured DBs and instantiate them.
-            for (const auto& db : config_ctl->getConfigDatabases()) {
+            for (auto const& db : config_ctl->getConfigDatabases()) {
                 const std::string& access = db.getAccessString();
                 auto parameters = db.getParameters();
                 if (ConfigBackendDHCPv6Mgr::instance().delBackend(parameters["type"], access, true)) {
index a3e1534b4165f381b30386935d6731cbc7fd07fe..c71918150ecd88de667e941a1df5776069c35d22 100644 (file)
@@ -1099,9 +1099,9 @@ void
 PgSqlConfigBackendImpl::addRelayBinding(PsqlBindArray& bindings,
                                         const NetworkPtr& network) {
     ElementPtr relay_element = Element::createList();
-    const auto& addresses = network->getRelayAddresses();
+    auto const& addresses = network->getRelayAddresses();
     if (!addresses.empty()) {
-        for (const auto& address : addresses) {
+        for (auto const& address : addresses) {
             relay_element->add(Element::create(address.toText()));
         }
     }
index e449cb763c46076592ce6b7e96d07dbf851f6a2e..a5cefeea1799311134609a6b2f223be21a6c9096 100644 (file)
@@ -600,7 +600,7 @@ public:
     void addRequiredClassesBinding(db::PsqlBindArray& bindings, const T& object) {
         // Create JSON list of required classes.
         data::ElementPtr required_classes_element = data::Element::createList();
-        const auto& required_classes = object->getRequiredClasses();
+        auto const& required_classes = object->getRequiredClasses();
         for (auto required_class = required_classes.cbegin();
              required_class != required_classes.cend();
              ++required_class) {
index e09047f470152e915ddffb8596a50638076ad680..4e17695d20909cebfe35ad242f49ed7a78d78663 100644 (file)
@@ -406,7 +406,7 @@ LeaseStatCmdsImpl::makeResultSet4(const ElementPtr& result_wrapper,
         CfgMgr::instance().getCurrentCfg()->getCfgSubnets4()->getAll();
 
     // Set the bounds on the selected subnet range
-    const auto& idx = subnets->get<SubnetSubnetIdIndexTag>();
+    auto const& idx = subnets->get<SubnetSubnetIdIndexTag>();
 
     // Init to ALL so we can use auto
     auto lower = idx.begin();
@@ -537,7 +537,7 @@ LeaseStatCmdsImpl::makeResultSet6(const ElementPtr& result_wrapper,
         CfgMgr::instance().getCurrentCfg()->getCfgSubnets6()->getAll();
 
     // Set the bounds on the selected subnet range
-    const auto& idx = subnets->get<SubnetSubnetIdIndexTag>();
+    auto const& idx = subnets->get<SubnetSubnetIdIndexTag>();
 
     // Init to ALL so we can use auto
     auto lower = idx.begin();
index 8a4488074e1b1b83e606177acb76b19ab35d4f97..26391478fa4d33da57ff868471343affe3f524c3 100644 (file)
@@ -114,7 +114,7 @@ IoServiceThreadPool::checkPermissions(State state) {
 
 bool
 IoServiceThreadPool::checkThreadId(std::thread::id id) {
-    for (const auto& thread : threads_) {
+    for (auto const& thread : threads_) {
         if (id == thread->get_id()) {
             return (true);
         }
index 4db67cd5c50c6e469d1fc53dc71cc4a77f490d7a..f9f05fa8cd41e12a0e450ce7df2c9a5849e6e1a2 100644 (file)
@@ -248,7 +248,7 @@ TEST(AddrUtilitiesTest, addrsInRange6) {
 // Checks if IPv4 address ranges can be converted to prefix / prefix_len
 TEST(AddrUtilitiesTest, prefixLengthFromRange4) {
     // Use a shorter name
-    const auto& plfr = prefixLengthFromRange;
+    auto const& plfr = prefixLengthFromRange;
 
     // Let's start with something simple
     EXPECT_EQ(32, plfr(IOAddress("192.0.2.0"), IOAddress("192.0.2.0")));
@@ -279,7 +279,7 @@ TEST(AddrUtilitiesTest, prefixLengthFromRange4) {
 // Checks if IPv6 address ranges can be converted to prefix / prefix_len
 TEST(AddrUtilitiesTest, prefixLengthFromRange6) {
     // Use a shorter name
-    const auto& plfr = prefixLengthFromRange;
+    auto const& plfr = prefixLengthFromRange;
 
     // Let's start with something simple
     EXPECT_EQ(128, plfr(IOAddress("::"), IOAddress("::")));
index 50b390621def1a35658fc20980398a160b353abe..ebef7d7d54e7dea83566c2bdf53c2c41bc1108c6 100644 (file)
@@ -213,7 +213,7 @@ parseCommand(ConstElementPtr& arg, ConstElementPtr command) {
 
     // Make sure that all specified parameters are supported.
     auto const& command_params = command->mapValue();
-    for (const auto& param : command_params) {
+    for (auto const& param : command_params) {
         if ((param.first != CONTROL_COMMAND) &&
             (param.first != CONTROL_ARGUMENTS) &&
             (param.first != CONTROL_SERVICE) &&
index 83504628446ed857927b76ca8e42369d3d7114a4..abcb0fbc4f9299651b163ade5d745961a5cfa7d6 100644 (file)
@@ -1122,7 +1122,7 @@ MapElement::equals(const Element& other) const {
         if (size() != other.size()) {
             return (false);
         }
-        for (const auto& kv : mapValue()) {
+        for (auto const& kv : mapValue()) {
             auto key = kv.first;
             if (other.contains(key)) {
                 if (!get(key)->equals(*other.get(key))) {
@@ -1156,7 +1156,7 @@ removeIdentical(ElementPtr a, ConstElementPtr b) {
     // over a checking for identical entries in b or vice-versa.  As elements
     // are removed from a if a match is found, we choose to iterate over b to
     // avoid problems with element removal affecting the iterator.
-    for (const auto& kv : b->mapValue()) {
+    for (auto const& kv : b->mapValue()) {
         auto key = kv.first;
         if (a->contains(key)) {
             if (a->get(key)->equals(*b->get(key))) {
@@ -1178,7 +1178,7 @@ removeIdentical(ConstElementPtr a, ConstElementPtr b) {
         isc_throw(TypeError, "Non-map Elements passed to removeIdentical");
     }
 
-    for (const auto& kv : a->mapValue()) {
+    for (auto const& kv : a->mapValue()) {
         auto key = kv.first;
         if (!b->contains(key) ||
             !a->get(key)->equals(*b->get(key))) {
@@ -1196,7 +1196,7 @@ merge(ElementPtr element, ConstElementPtr other) {
         isc_throw(TypeError, "merge arguments not MapElements");
     }
 
-    for (const auto& kv : other->mapValue()) {
+    for (auto const& kv : other->mapValue()) {
         auto key = kv.first;
         auto value = kv.second;
         if (value && value->getType() != Element::null) {
@@ -1249,7 +1249,7 @@ mergeDiffAdd(ElementPtr& element, ElementPtr& other,
     }
 
     if (element->getType() == Element::map) {
-        for (const auto& kv : other->mapValue()) {
+        for (auto const& kv : other->mapValue()) {
             auto current_key = kv.first;
             auto value = boost::const_pointer_cast<Element>(kv.second);
             if (value && value->getType() != Element::null) {
@@ -1318,7 +1318,7 @@ mergeDiffDel(ElementPtr& element, ElementPtr& other,
         // If the resulting element still contains data, we need to restore the
         // key parameters, so we store them here.
         ElementPtr new_elements = Element::createMap();
-        for (const auto& kv : other->mapValue()) {
+        for (auto const& kv : other->mapValue()) {
             auto current_key = kv.first;
             auto value = boost::const_pointer_cast<Element>(kv.second);
             if (value && value->getType() != Element::null) {
@@ -1349,7 +1349,7 @@ mergeDiffDel(ElementPtr& element, ElementPtr& other,
         }
         // If the element still contains data, restore the key elements.
         if (element->size()) {
-            for (const auto& kv : new_elements->mapValue()) {
+            for (auto const& kv : new_elements->mapValue()) {
                 element->set(kv.first, kv.second);
             }
         }
@@ -1389,7 +1389,7 @@ extend(const std::string& container, const std::string& extension,
     }
 
     if (element->getType() == Element::map) {
-        for (const auto& kv : other->mapValue()) {
+        for (auto const& kv : other->mapValue()) {
             auto current_key = kv.first;
             auto value = boost::const_pointer_cast<Element>(kv.second);
             if (value && value->getType() != Element::null) {
@@ -1428,7 +1428,7 @@ copy(ConstElementPtr from, int level) {
         return (ElementPtr(new StringElement(from->stringValue())));
     } else if (from_type == Element::list) {
         ElementPtr result = ElementPtr(new ListElement());
-        for (const auto& elem : from->listValue()) {
+        for (auto const& elem : from->listValue()) {
             if (level == 0) {
                 result->add(elem);
             } else {
@@ -1438,7 +1438,7 @@ copy(ConstElementPtr from, int level) {
         return (result);
     } else if (from_type == Element::map) {
         ElementPtr result = ElementPtr(new MapElement());
-        for (const auto& kv : from->mapValue()) {
+        for (auto const& kv : from->mapValue()) {
             auto key = kv.first;
             auto value = kv.second;
             if (level == 0) {
@@ -1517,7 +1517,7 @@ isEquivalent0(ConstElementPtr a, ConstElementPtr b, unsigned level) {
             return (false);
         }
         // iterate on the first map
-        for (const auto& kv : a->mapValue()) {
+        for (auto const& kv : a->mapValue()) {
             // get the b value for the given keyword and recurse
             ConstElementPtr item = b->get(kv.first);
             if (!item || !isEquivalent0(kv.second, item, level - 1)) {
@@ -1565,7 +1565,7 @@ prettyPrint(ConstElementPtr element, std::ostream& out,
         out << "[" << (complex ? "\n" : " ");
 
         // iterate on items
-        const auto& l = element->listValue();
+        auto const& l = element->listValue();
         for (auto it = l.begin(); it != l.end(); ++it) {
             // add the separator if not the first item
             if (it != l.begin()) {
@@ -1597,7 +1597,7 @@ prettyPrint(ConstElementPtr element, std::ostream& out,
         out << "{\n";
 
         // iterate on keyword: value
-        const auto& m = element->mapValue();
+        auto const& m = element->mapValue();
         bool first = true;
         for (auto it = m.begin(); it != m.end(); ++it) {
             // add the separator if not the first item
index e0baa31fd1c7c3cd9bb53616141d4638dc5d89b7..314d2888c383441abd674d2806d3bac0457311b6 100644 (file)
@@ -24,7 +24,7 @@ namespace data {
 void
 SimpleParser::checkRequired(const SimpleRequiredKeywords& required,
                             ConstElementPtr scope) {
-    for (const auto& name : required) {
+    for (auto const& name : required) {
         if (scope->contains(name)) {
             continue;
         }
@@ -36,7 +36,7 @@ void
 SimpleParser::checkKeywords(const SimpleKeywords& keywords,
                             ConstElementPtr scope) {
     string spurious;
-    for (const auto& entry : scope->mapValue()) {
+    for (auto const& entry : scope->mapValue()) {
         if (keywords.count(entry.first) == 0) {
             if (spurious.empty()) {
                 spurious = entry.first;
index 93915d63ca9b1b8852e4026b6a086e739cd6fe58..0314273297eb731f50f310f9959ec0c303921d09 100644 (file)
@@ -38,7 +38,7 @@ StampedElement::getMetadata() const {
     ElementPtr metadata = Element::createMap();
     ElementPtr tags = Element::createList();
 
-    for (const auto& server_tag : server_tags_) {
+    for (auto const& server_tag : server_tags_) {
         tags->add(Element::create(server_tag.get()));
     }
 
index 55ed91d01e15fdca145bb595e32fa3221eedc58a..64d754063ce986626c0eea82b5f9af5e26a2eb1b 100644 (file)
@@ -171,7 +171,7 @@ protected:
         // If no particular backend is selected, call each backend and return
         // the first non-null (non zero) value.
         if (backend_selector.amUnspecified()) {
-            for (const auto& backend : backends_) {
+            for (auto const& backend : backends_) {
                 property = ((*backend).*MethodPointer)(server_selector, input...);
                 if (property) {
                     break;
@@ -182,7 +182,7 @@ protected:
             // Backend selected, find the one that matches selection.
             auto backends = selectBackends(backend_selector);
             if (!backends.empty()) {
-                for (const auto& backend : backends) {
+                for (auto const& backend : backends) {
                     property = ((*backend).*MethodPointer)(server_selector, input...);
                     if (property) {
                         break;
@@ -312,7 +312,7 @@ protected:
                                     PropertyCollectionType& properties,
                                     Args... input) const {
         if (backend_selector.amUnspecified()) {
-            for (const auto& backend : backends_) {
+            for (auto const& backend : backends_) {
                 properties = ((*backend).*MethodPointer)(server_selector, input...);
                 if (!properties.empty()) {
                     break;
@@ -322,7 +322,7 @@ protected:
         } else {
             auto backends = selectBackends(backend_selector);
             if (!backends.empty()) {
-                for (const auto& backend : backends) {
+                for (auto const& backend : backends) {
                     properties = ((*backend).*MethodPointer)(server_selector, input...);
                     if (!properties.empty()) {
                         break;
@@ -382,7 +382,7 @@ protected:
                                const db::ServerSelector& server_selector,
                                PropertyCollectionType& properties) const {
         if (backend_selector.amUnspecified()) {
-            for (const auto& backend : backends_) {
+            for (auto const& backend : backends_) {
                 properties = ((*backend).*MethodPointer)(server_selector);
                 if (!properties.empty()) {
                     break;
@@ -392,7 +392,7 @@ protected:
         } else {
             auto backends = selectBackends(backend_selector);
             if (!backends.empty()) {
-                for (const auto& backend : backends) {
+                for (auto const& backend : backends) {
                     properties = ((*backend).*MethodPointer)(server_selector);
                     if (!properties.empty()) {
                         break;
@@ -609,7 +609,7 @@ protected:
         }
 
         // Go over all backends.
-        for (const auto& backend : backends_) {
+        for (auto const& backend : backends_) {
             // If backend type is specified and it is not matching,
             // do not select this backend.
             if ((backend_selector.getBackendType() != db::BackendSelector::Type::UNSPEC) &&
index 7a4fad632ca490cad517efeb4c53cabbac2ffc38..99866e292fa03f615eb621d50e206aa1cd2afafc 100644 (file)
@@ -56,7 +56,7 @@ public:
     /// @return Value of the property or 0 if property doesn't exist.
     virtual int getProperty(const ServerSelector&,
                             const std::string& property_name) const {
-        for (const auto& property : properties_) {
+        for (auto const& property : properties_) {
             if (property.first == property_name) {
                 return (property.second);
             }
@@ -72,7 +72,7 @@ public:
     virtual int getProperty(const ServerSelector&,
                             const std::string& property_name,
                             const int property_value) const {
-        for (const auto& property : properties_) {
+        for (auto const& property : properties_) {
             if ((property.first == property_name) &&
                 (property.second == property_value)) {
                 return (property.second);
@@ -89,7 +89,7 @@ public:
     virtual PropertiesList getProperties(const ServerSelector&,
                                          const std::string& property_name) const {
         PropertiesList properties;
-        for (const auto& property : properties_) {
+        for (auto const& property : properties_) {
             if (property.first == property_name) {
                 properties.push_back(property);
             }
index 8534f13924587559acdfc7a19628ed78ba71b12d..e334b7011dbe4f44d3eb44544be45802840faeee 100644 (file)
@@ -46,10 +46,10 @@ void
 D2Stats::init() {
     StatsMgr& stats_mgr = isc::stats::StatsMgr::instance();
     stats_mgr.setMaxSampleCountDefault(0);
-    for (const auto& name : D2Stats::ncr) {
+    for (auto const& name : D2Stats::ncr) {
         stats_mgr.setValue(name, static_cast<int64_t>(0));
     }
-    for (const auto& name : D2Stats::update) {
+    for (auto const& name : D2Stats::update) {
         stats_mgr.setValue(name, static_cast<int64_t>(0));
     }
 };
index 75dc5277a4e25366f105dba60febde9d3c4df98b..3835403ad3de220bcd993c835a3ff604ec4d584b 100644 (file)
@@ -37,7 +37,7 @@ void
 D2TsigKey::initStats() {
     StatsMgr& stats_mgr = StatsMgr::instance();
     const string& kname = getKeyName().toText();
-    for (const auto& name : D2Stats::key) {
+    for (auto const& name : D2Stats::key) {
         const string& sname = StatsMgr::generateName("key", kname, name);
         stats_mgr.setValue(sname, static_cast<int64_t>(0));
     }
@@ -47,7 +47,7 @@ void
 D2TsigKey::removeStats() {
     StatsMgr& stats_mgr = StatsMgr::instance();
     const string& kname = getKeyName().toText();
-    for (const auto& name : D2Stats::key) {
+    for (auto const& name : D2Stats::key) {
         string sname = StatsMgr::generateName("key", kname, name);
         stats_mgr.del(sname);
     }
@@ -57,7 +57,7 @@ void
 D2TsigKey::resetStats() {
     StatsMgr& stats_mgr = StatsMgr::instance();
     const string& kname = getKeyName().toText();
-    for (const auto& name : D2Stats::key) {
+    for (auto const& name : D2Stats::key) {
         string sname = StatsMgr::generateName("key", kname, name);
         stats_mgr.reset(sname);
     }
index 262879b421c3dd0af4c55dea2ce8dc2a2df8af6d..e145f56db70556214ac0b3b32294d376788c044a 100644 (file)
@@ -28,7 +28,7 @@ D2StatTest::~D2StatTest() {
 void
 checkStats(const string& key_name, const StatMap& expected_stats) {
     StatMap key_stats;
-    for (const auto& it : expected_stats) {
+    for (auto const& it : expected_stats) {
         const string& stat_name =
             StatsMgr::generateName("key", key_name, it.first);
         key_stats[stat_name] = it.second;
index 43bdfaaae6703e015b28b7f1957a350325462e4c..8da9bca1bcae530644b5121eae9384f1e5d4a3c5 100644 (file)
@@ -220,7 +220,7 @@ isc::data::ElementPtr
 DatabaseConnection::toElement(const ParameterMap& params) {
     isc::data::ElementPtr result = isc::data::Element::createMap();
 
-    for (const auto& param : params) {
+    for (auto const& param : params) {
         std::string keyword = param.first;
         std::string value = param.second;
 
index f6e70eacaf3f391ac08feed34f5cbb3d5be3be1a..05fe96eeedb1386cb2ca681fd003eb54818c9219 100644 (file)
@@ -270,7 +270,7 @@ DbAccessParser::getDbAccessString() const {
     // Construct the database access string from all keywords and values in the
     // parameter map where the value is not null.
     string dbaccess;
-    for (const auto& keyval : values_) {
+    for (auto const& keyval : values_) {
         if (!keyval.second.empty()) {
 
             // Separate keyword/value pair from predecessor (if there is one).
index 09e39a6e857c3a61c33455cf3ecad718f4b549cb..1d8031327d2b18c596ab240d8a44a0479a115e95 100644 (file)
@@ -24,7 +24,7 @@ ServerSelector::MULTIPLE(const std::set<std::string>& server_tags) {
     std::set<ServerTag> tags;
 
     // Create a set of tags from strings.
-    for (const auto& tag : server_tags) {
+    for (auto const& tag : server_tags) {
         tags.insert(ServerTag(tag));
     }
 
index 1d41872265a5d079c662eb9eaf580f836003ccbb..e84a7877ec9cb4674b4e4bdcc6ada474389b29b7 100644 (file)
@@ -243,7 +243,7 @@ public:
 
 // Checks that entries can be found by object type.
 TEST_F(AuditEntryCollectionTest, getByObjectType) {
-    const auto& object_type_idx = audit_entries_.get<AuditEntryObjectTypeTag>();
+    auto const& object_type_idx = audit_entries_.get<AuditEntryObjectTypeTag>();
 
     // Search for "dhcp4_subnet" objects.
     auto range = object_type_idx.equal_range("dhcp4_subnet");
@@ -266,7 +266,7 @@ TEST_F(AuditEntryCollectionTest, getByObjectType) {
 
 // Checks that entries can be found by modification time.
 TEST_F(AuditEntryCollectionTest, getByModificationTime) {
-    const auto& mod_time_idx = audit_entries_.get<AuditEntryModificationTimeIdTag>();
+    auto const& mod_time_idx = audit_entries_.get<AuditEntryModificationTimeIdTag>();
 
     // Search for objects later than fixed time - 10s.
     auto lb = mod_time_idx.lower_bound(diffTime(-10));
@@ -313,7 +313,7 @@ TEST_F(AuditEntryCollectionTest, getByModificationTime) {
 
 // Checks that entries can be found by modification time and id.
 TEST_F(AuditEntryCollectionTest, getByModificationTimeAndId) {
-    const auto& mod_time_idx = audit_entries_.get<AuditEntryModificationTimeIdTag>();
+    auto const& mod_time_idx = audit_entries_.get<AuditEntryModificationTimeIdTag>();
 
     // Search for objects later than added added subnet 10.
     auto mod = boost::make_tuple(diffTime(-5), 100 + 1);
@@ -337,7 +337,7 @@ TEST_F(AuditEntryCollectionTest, getByModificationTimeAndId) {
 
 // Checks that entries can be found by object id.
 TEST_F(AuditEntryCollectionTest, getByObjectId) {
-    const auto& object_id_idx = audit_entries_.get<AuditEntryObjectIdTag>();
+    auto const& object_id_idx = audit_entries_.get<AuditEntryObjectIdTag>();
 
     // Search for object id 10.
     auto range = object_id_idx.equal_range(10);
index 8dbf4d587d418d56643969ed9f6383b4805297de..861767920ccd3370448631b048c222830691e10e 100644 (file)
@@ -828,7 +828,7 @@ IfaceCollection::getIfaceInternal(const unsigned int ifindex, const bool need_lo
             return (cache_);
         }
     }
-    const auto& idx = ifaces_container_.get<1>();
+    auto const& idx = ifaces_container_.get<1>();
     auto it = idx.find(ifindex);
     if (it == idx.end()) {
         return (IfacePtr()); // not found
@@ -855,7 +855,7 @@ IfaceCollection::getIfaceInternal(const std::string& ifname, const bool need_loc
             return (cache_);
         }
     }
-    const auto& idx = ifaces_container_.get<2>();
+    auto const& idx = ifaces_container_.get<2>();
     auto it = idx.find(ifname);
     if (it == idx.end()) {
         return (IfacePtr()); // not found
index a9bdb69d7a0a51dbefebb7b14f1b1ea26294cbb1..760765bc45aa3e62797abf43c713926041f28fcd 100644 (file)
@@ -693,7 +693,7 @@ void
 extendVivco(OptionCollection& options) {
     typedef vector<OpaqueDataTuple> TuplesCollection;
     map<uint32_t, TuplesCollection> vendors_tuples;
-    const auto& range = options.equal_range(DHO_VIVCO_SUBOPTIONS);
+    auto const& range = options.equal_range(DHO_VIVCO_SUBOPTIONS);
     for (auto it = range.first; it != range.second; ++it) {
         uint32_t offset = 0;
         auto const& data = it->second->getData();
@@ -752,7 +752,7 @@ extendVivco(OptionCollection& options) {
 void
 extendVivso(OptionCollection& options) {
     map<uint32_t, OptionCollection> vendors_data;
-    const auto& range = options.equal_range(DHO_VIVSO_SUBOPTIONS);
+    auto const& range = options.equal_range(DHO_VIVSO_SUBOPTIONS);
     for (auto it = range.first; it != range.second; ++it) {
         uint32_t offset = 0;
         auto const& data = it->second->getData();
index f1b50cb6da5e7b6c20a9d47ac4a2e24a0393af5d..c6e7c035d5b8bcaa1e68942cb8c1f49000539232 100644 (file)
@@ -380,7 +380,7 @@ DnrInstance::getDnrInstanceAsText() const {
            << "adn='" << getAdnAsText() << "'";
     if (!adn_only_mode_) {
         stream << ", addr_length=" << addr_length_ << ", address(es):";
-        for (const auto& address : ip_addresses_) {
+        for (auto const& address : ip_addresses_) {
             stream << " " << address.toText();
         }
 
index 3d7bb0fcd85a9d07d873e0fdf565cd3de3d692d8..d527bbc5348a9a8b47f7b60125e0fc2e063f716c 100644 (file)
@@ -41,7 +41,7 @@ Option6Dnr::pack(util::OutputBuffer& buf, bool check) const {
 
 void
 Option6Dnr::packAddresses(util::OutputBuffer& buf) const {
-    for (const auto& address : ip_addresses_) {
+    for (auto const& address : ip_addresses_) {
         if (!address.isV6()) {
             isc_throw(isc::BadValue, getLogPrefix()
                                          << address.toText() << " is not an IPv6 address");
index 26224602ff5837f849bef03e3d0f8c0194cd57aa..2484d974ff8a70eba2f5c1649bd3399007dd6038 100644 (file)
@@ -53,7 +53,7 @@ Pkt::addOption(const OptionPtr& opt) {
 
 OptionPtr
 Pkt::getNonCopiedOption(const uint16_t type) const {
-    const auto& x = options_.find(type);
+    auto const& x = options_.find(type);
     if (x != options_.end()) {
         return (x->second);
     }
@@ -62,7 +62,7 @@ Pkt::getNonCopiedOption(const uint16_t type) const {
 
 OptionPtr
 Pkt::getOption(const uint16_t type) {
-    const auto& x = options_.find(type);
+    auto const& x = options_.find(type);
     if (x != options_.end()) {
         if (copy_retrieved_options_) {
             OptionPtr option_copy = x->second->clone();
@@ -102,7 +102,7 @@ Pkt::getOptions(const uint16_t opt_type) {
 
 bool
 Pkt::delOption(uint16_t type) {
-    const auto& x = options_.find(type);
+    auto const& x = options_.find(type);
     if (x != options_.end()) {
         options_.erase(x);
         return (true); // delete successful
index bb5276639c36662f38bd596cb26656424bba16c2..e9a62f6be8acd61072453bdb5eaf27fd797a3e06 100644 (file)
@@ -60,7 +60,7 @@ Pkt4::len() {
     size_t length = DHCPV4_PKT_HDR_LEN; // DHCPv4 header
 
     // ... and sum of lengths of all options
-    for (const auto& it : options_) {
+    for (auto const& it : options_) {
         length += it.second->len();
     }
 
@@ -447,7 +447,7 @@ Pkt4::toText() const {
 
     if (!options_.empty()) {
         tmp << "," << endl << "options:";
-        for (const auto& opt : options_) {
+        for (auto const& opt : options_) {
             try {
                 tmp << endl << opt.second->toText(2);
             } catch (...) {
index eb800f90aeea55f2652a04c3ffd00e2fea9d4c34..aba14c691ea9862291e39c20ad960bb2d2862f7f 100644 (file)
@@ -44,7 +44,7 @@ std::string Pkt6::RelayInfo::toText() const {
         << "link-address=" << linkaddr_.toText()
         << ", peer-address=" << peeraddr_.toText() << ", "
         << options_.size() << " option(s)" << endl;
-    for (const auto& option : options_) {
+    for (auto const& option : options_) {
         tmp << option.second->toText() << endl;
     }
     return (tmp.str());
@@ -346,7 +346,7 @@ uint16_t Pkt6::getRelayOverhead(const RelayInfo& relay) const {
     uint16_t len = DHCPV6_RELAY_HDR_LEN // fixed header
         + Option::OPTION6_HDR_LEN; // header of the relay-msg option
 
-    for (const auto& opt : relay.options_) {
+    for (auto const& opt : relay.options_) {
         len += (opt.second)->len();
     }
 
@@ -368,7 +368,7 @@ uint16_t Pkt6::calculateRelaySizes() {
 uint16_t Pkt6::directLen() const {
     uint16_t length = DHCPV6_PKT_HDR_LEN; // DHCPv6 header
 
-    for (const auto& it : options_) {
+    for (auto const& it : options_) {
         length += it.second->len();
     }
 
@@ -422,7 +422,7 @@ Pkt6::packUDP() {
                 // present here as well (vendor-opts for Cable modems,
                 // subscriber-id, remote-id, options echoed back from Echo
                 // Request Option, etc.)
-                for (const auto& opt : relay->options_) {
+                for (auto const& opt : relay->options_) {
                     (opt.second)->pack(buffer_out_);
                 }
 
@@ -738,7 +738,7 @@ Pkt6::toText() const {
 
     if (!options_.empty()) {
         tmp << "," << endl << "options:";
-        for (const auto& opt : options_) {
+        for (auto const& opt : options_) {
             try {
                 tmp << endl << opt.second->toText(2);
             } catch (...) {
@@ -754,7 +754,7 @@ Pkt6::toText() const {
     if (!relay_info_.empty()) {
         tmp << endl << relay_info_.size() << " relay(s):" << endl;
         int cnt = 0;
-        for (const auto& relay : relay_info_) {
+        for (auto const& relay : relay_info_) {
             tmp << "relay[" << cnt++ << "]: " << relay.toText();
         }
     } else {
index 4819e3be6ae2cb092e08d8c02ef3f3639dbcd655..111a3a9347db5f0c50db3d870570ebd52e81cca4 100644 (file)
@@ -1543,9 +1543,9 @@ AllocEngine::removeNonmatchingReservedLeases6(ClientContext6& ctx,
                                    "assigned-nas" : "assigned-pds"),
             static_cast<int64_t>(-1));
 
-        const auto& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets4()->getBySubnetId(candidate->subnet_id_);
+        auto const& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets4()->getBySubnetId(candidate->subnet_id_);
         if (subnet) {
-            const auto& pool = subnet->getPool(ctx.currentIA().type_, candidate->addr_, false);
+            auto const& pool = subnet->getPool(ctx.currentIA().type_, candidate->addr_, false);
             if (pool) {
                 StatsMgr::instance().addValue(
                     StatsMgr::generateName("subnet", subnet->getID(),
@@ -1602,9 +1602,9 @@ AllocEngine::removeNonmatchingReservedNoHostLeases6(ClientContext6& ctx,
                                    "assigned-nas" : "assigned-pds"),
             static_cast<int64_t>(-1));
 
-        const auto& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets6()->getBySubnetId(candidate->subnet_id_);
+        auto const& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets6()->getBySubnetId(candidate->subnet_id_);
         if (subnet) {
-            const auto& pool = subnet->getPool(candidate->type_, candidate->addr_, false);
+            auto const& pool = subnet->getPool(candidate->type_, candidate->addr_, false);
             if (pool) {
                 StatsMgr::instance().addValue(
                     StatsMgr::generateName("subnet", subnet->getID(),
@@ -1685,9 +1685,9 @@ AllocEngine::removeNonreservedLeases6(ClientContext6& ctx,
                                    "assigned-nas" : "assigned-pds"),
             static_cast<int64_t>(-1));
 
-        const auto& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets6()->getBySubnetId((*lease)->subnet_id_);
+        auto const& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets6()->getBySubnetId((*lease)->subnet_id_);
         if (subnet) {
-            const auto& pool = subnet->getPool(ctx.currentIA().type_, (*lease)->addr_, false);
+            auto const& pool = subnet->getPool(ctx.currentIA().type_, (*lease)->addr_, false);
             if (pool) {
                 StatsMgr::instance().addValue(
                     StatsMgr::generateName("subnet", subnet->getID(),
@@ -1814,7 +1814,7 @@ AllocEngine::reuseExpiredLease(Lease6Ptr& expired, ClientContext6& ctx,
         // Add (update) the extended information on the lease.
         updateLease6ExtendedInfo(expired, ctx);
 
-        const auto& pool = ctx.subnet_->getPool(ctx.currentIA().type_, expired->addr_, false);
+        auto const& pool = ctx.subnet_->getPool(ctx.currentIA().type_, expired->addr_, false);
         if (pool) {
             expired->pool_id_ = pool->getID();
         }
@@ -2007,7 +2007,7 @@ Lease6Ptr AllocEngine::createLease6(ClientContext6& ctx,
         // Add (update) the extended information on the lease.
         updateLease6ExtendedInfo(lease, ctx);
 
-        const auto& pool = ctx.subnet_->getPool(ctx.currentIA().type_, lease->addr_, false);
+        auto const& pool = ctx.subnet_->getPool(ctx.currentIA().type_, lease->addr_, false);
         if (pool) {
             lease->pool_id_ = pool->getID();
         }
@@ -2222,7 +2222,7 @@ AllocEngine::extendLease6(ClientContext6& ctx, Lease6Ptr lease) {
                                    "assigned-nas" : "assigned-pds"),
             static_cast<int64_t>(-1));
 
-        const auto& pool = ctx.subnet_->getPool(ctx.currentIA().type_, lease->addr_, false);
+        auto const& pool = ctx.subnet_->getPool(ctx.currentIA().type_, lease->addr_, false);
         if (pool) {
             StatsMgr::instance().addValue(
                 StatsMgr::generateName("subnet", ctx.subnet_->getID(),
@@ -2358,7 +2358,7 @@ AllocEngine::extendLease6(ClientContext6& ctx, Lease6Ptr lease) {
         // Now that the lease has been reclaimed, we can go ahead and update it
         // in the lease database.
         if (lease->reuseable_valid_lft_ == 0) {
-            const auto& pool = ctx.subnet_->getPool(ctx.currentIA().type_, lease->addr_, false);
+            auto const& pool = ctx.subnet_->getPool(ctx.currentIA().type_, lease->addr_, false);
             if (pool) {
                 lease->pool_id_ = pool->getID();
             }
@@ -2378,7 +2378,7 @@ AllocEngine::extendLease6(ClientContext6& ctx, Lease6Ptr lease) {
                                        "cumulative-assigned-nas" : "cumulative-assigned-pds"),
                 static_cast<int64_t>(1));
 
-            const auto& pool = ctx.subnet_->getPool(ctx.currentIA().type_, lease->addr_, false);
+            auto const& pool = ctx.subnet_->getPool(ctx.currentIA().type_, lease->addr_, false);
             if (pool) {
                 StatsMgr::instance().addValue(
                     StatsMgr::generateName("subnet", ctx.subnet_->getID(),
@@ -2476,7 +2476,7 @@ AllocEngine::updateLeaseData(ClientContext6& ctx, const Lease6Collection& leases
                                            "cumulative-assigned-nas" : "cumulative-assigned-pds"),
                     static_cast<int64_t>(1));
 
-                const auto& pool = ctx.subnet_->getPool(ctx.currentIA().type_, lease->addr_, false);
+                auto const& pool = ctx.subnet_->getPool(ctx.currentIA().type_, lease->addr_, false);
                 if (pool) {
                     StatsMgr::instance().addValue(
                         StatsMgr::generateName("subnet", ctx.subnet_->getID(),
@@ -2910,9 +2910,9 @@ AllocEngine::reclaimExpiredLease(const Lease6Ptr& lease,
                                                              "assigned-nas"),
             static_cast<int64_t>(-1));
 
-        const auto& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets6()->getBySubnetId(lease->subnet_id_);
+        auto const& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets6()->getBySubnetId(lease->subnet_id_);
         if (subnet) {
-            const auto& pool = subnet->getPool(lease->type_, lease->addr_, false);
+            auto const& pool = subnet->getPool(lease->type_, lease->addr_, false);
             if (pool) {
                 StatsMgr::instance().addValue(
                     StatsMgr::generateName("subnet", subnet->getID(),
@@ -2935,9 +2935,9 @@ AllocEngine::reclaimExpiredLease(const Lease6Ptr& lease,
                                                              "assigned-pds"),
             static_cast<int64_t>(-1));
 
-        const auto& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets6()->getBySubnetId(lease->subnet_id_);
+        auto const& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets6()->getBySubnetId(lease->subnet_id_);
         if (subnet) {
-            const auto& pool = subnet->getPool(lease->type_, lease->addr_, false);
+            auto const& pool = subnet->getPool(lease->type_, lease->addr_, false);
             if (pool) {
                 StatsMgr::instance().addValue(
                     StatsMgr::generateName("subnet", subnet->getID(),
@@ -3049,9 +3049,9 @@ AllocEngine::reclaimExpiredLease(const Lease4Ptr& lease,
                                                          "reclaimed-leases"),
         static_cast<int64_t>(1));
 
-    const auto& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets4()->getBySubnetId(lease->subnet_id_);
+    auto const& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets4()->getBySubnetId(lease->subnet_id_);
     if (subnet) {
-        const auto& pool = subnet->getPool(Lease::TYPE_V4, lease->addr_, false);
+        auto const& pool = subnet->getPool(Lease::TYPE_V4, lease->addr_, false);
         if (pool) {
             StatsMgr::instance().addValue(
                 StatsMgr::generateName("subnet", subnet->getID(),
@@ -3139,9 +3139,9 @@ AllocEngine::reclaimDeclined(const Lease4Ptr& lease) {
                                               "reclaimed-declined-addresses"),
         static_cast<int64_t>(1));
 
-    const auto& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets4()->getBySubnetId(lease->subnet_id_);
+    auto const& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets4()->getBySubnetId(lease->subnet_id_);
     if (subnet) {
-        const auto& pool = subnet->getPool(Lease::TYPE_V4, lease->addr_, false);
+        auto const& pool = subnet->getPool(Lease::TYPE_V4, lease->addr_, false);
         if (pool) {
             stats_mgr.addValue(StatsMgr::generateName("subnet", subnet->getID(),
                                                       StatsMgr::generateName("pool" , pool->getID(),
@@ -3211,9 +3211,9 @@ AllocEngine::reclaimDeclined(const Lease6Ptr& lease) {
                                               "reclaimed-declined-addresses"),
         static_cast<int64_t>(1));
 
-    const auto& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets6()->getBySubnetId(lease->subnet_id_);
+    auto const& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets6()->getBySubnetId(lease->subnet_id_);
     if (subnet) {
-        const auto& pool = subnet->getPool(lease->type_, lease->addr_, false);
+        auto const& pool = subnet->getPool(lease->type_, lease->addr_, false);
         if (pool) {
             stats_mgr.addValue(StatsMgr::generateName("subnet", subnet->getID(),
                                                       StatsMgr::generateName("pool" , pool->getID(),
@@ -4135,9 +4135,9 @@ AllocEngine::requestLease4(AllocEngine::ClientContext4& ctx) {
                                        "assigned-addresses"),
                 static_cast<int64_t>(-1));
 
-            const auto& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets4()->getBySubnetId(client_lease->subnet_id_);
+            auto const& subnet = CfgMgr::instance().getCurrentCfg()->getCfgSubnets4()->getBySubnetId(client_lease->subnet_id_);
             if (subnet) {
-                const auto& pool = subnet->getPool(Lease::TYPE_V4, client_lease->addr_, false);
+                auto const& pool = subnet->getPool(Lease::TYPE_V4, client_lease->addr_, false);
                 if (pool) {
                     StatsMgr::instance().addValue(
                         StatsMgr::generateName("subnet", subnet->getID(),
@@ -4333,7 +4333,7 @@ AllocEngine::createLease4(const ClientContext4& ctx, const IOAddress& addr,
     }
 
     if (!ctx.fake_allocation_ || ctx.offer_lft_) {
-        const auto& pool = ctx.subnet_->getPool(Lease::TYPE_V4, lease->addr_, false);
+        auto const& pool = ctx.subnet_->getPool(Lease::TYPE_V4, lease->addr_, false);
         if (pool) {
             lease->pool_id_ = pool->getID();
         }
@@ -4467,7 +4467,7 @@ AllocEngine::renewLease4(const Lease4Ptr& lease,
     }
 
     if ((!ctx.fake_allocation_ || ctx.offer_lft_) && !skip && (lease->reuseable_valid_lft_ == 0)) {
-        const auto& pool = ctx.subnet_->getPool(Lease::TYPE_V4, lease->addr_, false);
+        auto const& pool = ctx.subnet_->getPool(Lease::TYPE_V4, lease->addr_, false);
         if (pool) {
             lease->pool_id_ = pool->getID();
         }
@@ -4595,7 +4595,7 @@ AllocEngine::reuseExpiredLease4(Lease4Ptr& expired,
     }
 
     if (!ctx.fake_allocation_ || ctx.offer_lft_) {
-        const auto& pool = ctx.subnet_->getPool(Lease::TYPE_V4, expired->addr_, false);
+        auto const& pool = ctx.subnet_->getPool(Lease::TYPE_V4, expired->addr_, false);
         if (pool) {
             expired->pool_id_ = pool->getID();
         }
index c34f6f6117d303affc814976631bc8146e0f621a..926946de8944d139cbbe5b49b4adc26eab6b1aa2 100644 (file)
@@ -44,14 +44,14 @@ protected:
     /// backend
     void addGlobalsToConfig(SrvConfigPtr external_cfg,
                             data::StampedValueCollection& cb_globals) const {
-        const auto& index = cb_globals.get<data::StampedValueNameIndexTag>();
+        auto const& index = cb_globals.get<data::StampedValueNameIndexTag>();
         for (auto cb_global = index.begin(); cb_global != index.end(); ++cb_global) {
 
             if ((*cb_global)->amNull()) {
                 continue;
             }
 
-            external_cfg->addConfiguredGlobal((*cb_global)->getName(), 
+            external_cfg->addConfiguredGlobal((*cb_global)->getName(),
                                               (*cb_global)->getElementValue());
         }
     }
index 5ba211f5195bfb11f7b74e0968bc7a69ea1ab630..37efb8a4bc500ca255bd00054198d6f8fce83f68 100644 (file)
@@ -66,7 +66,7 @@ CBControlDHCPv4::databaseConfigApply(const BackendSelector& backend_selector,
         auto external_cfg = CfgMgr::instance().createExternalCfg();
 
         // Get audit entries for deleted global parameters.
-        const auto& index = audit_entries.get<AuditEntryObjectTypeTag>();
+        auto const& index = audit_entries.get<AuditEntryObjectTypeTag>();
         auto range = index.equal_range(boost::make_tuple("dhcp4_global_parameter",
                                                          AuditEntry::ModificationType::DELETE));
         if (range.first != range.second) {
index 91b482ebad452fd3fd5ce1d63dec762e7cab88cf..ca74a5e53129c48742755e6b9fc635208662ac15 100644 (file)
@@ -64,7 +64,7 @@ CBControlDHCPv6::databaseConfigApply(const db::BackendSelector& backend_selector
         auto external_cfg = CfgMgr::instance().createExternalCfg();
 
         // Get audit entries for deleted global parameters.
-        const auto& index = audit_entries.get<AuditEntryObjectTypeTag>();
+        auto const& index = audit_entries.get<AuditEntryObjectTypeTag>();
         auto range = index.equal_range(boost::make_tuple("dhcp6_global_parameter",
                                                          AuditEntry::ModificationType::DELETE));
         if (range.first != range.second) {
index febf9882854521d9def8da3397858e1cf9d678db..bee54332bc4e4617adb2b1a3827e8b1ca8f7de90 100644 (file)
@@ -1100,7 +1100,7 @@ CfgHosts::del(const SubnetID& subnet_id, const asiolink::IOAddress& addr) {
         HostContainer6Index1& idx6 = hosts6_.get<1>();
         HostContainerIndex4& idx = hosts_.get<4>();
         // Delete IPv6 reservations.
-        const auto& range = idx6.equal_range(boost::make_tuple(subnet_id, addr));
+        auto const& range = idx6.equal_range(boost::make_tuple(subnet_id, addr));
         erased_addresses = boost::distance(range);
         // Delete hosts.
         for (auto key = range.first; key != range.second; ++key) {
@@ -1136,10 +1136,10 @@ CfgHosts::del4(const SubnetID& subnet_id,
                const uint8_t* identifier_begin,
                const size_t identifier_len) {
     HostContainerIndex0& idx = hosts_.get<0>();
-    const auto t = boost::make_tuple(std::vector<uint8_t>(identifier_begin,
+    auto const t = boost::make_tuple(std::vector<uint8_t>(identifier_begin,
                                                     identifier_begin + identifier_len),
                                                     identifier_type);
-    const auto& range = idx.equal_range(t);
+    auto const& range = idx.equal_range(t);
     size_t erased = 0;
     for (auto key = range.first; key != range.second;) {
         if ((*key)->getIPv4SubnetID() != subnet_id) {
@@ -1186,10 +1186,10 @@ CfgHosts::del6(const SubnetID& subnet_id,
     HostContainerIndex0& idx = hosts_.get<0>();
     HostContainer6Index3& idx6 = hosts6_.get<3>();
 
-    const auto t = boost::make_tuple(std::vector<uint8_t>(identifier_begin,
+    auto const t = boost::make_tuple(std::vector<uint8_t>(identifier_begin,
                                                           identifier_begin + identifier_len),
                                                           identifier_type);
-    const auto& range = idx.equal_range(t);
+    auto const& range = idx.equal_range(t);
     size_t erased_hosts = 0;
     size_t erased_reservations = 0;
     for (auto key = range.first; key != range.second;) {
index 4c1cddc069126d1148efbe989a7bd16cced8a276..c4b8f470216a30cffbdb14c63cad2dfaab56f100 100644 (file)
@@ -162,7 +162,7 @@ CfgOption::createOptions(CfgOptionDefPtr cfg_def) {
     // Iterate over all the option descriptors in
     // all the spaces and instantiate the options
     // based on the given definitions.
-    for (const auto& space : getOptionSpaceNames()) {
+    for (auto const& space : getOptionSpaceNames()) {
         for (auto opt_desc : *(getAll(space))) {
             if (createDescriptorOption(cfg_def, space, opt_desc)) {
                 // Option was recreated, let's replace the descriptor.
@@ -372,7 +372,7 @@ CfgOption::del(const std::string& option_space, const uint16_t option_code) {
         (option_space != DHCP6_OPTION_SPACE)) {
         // For each option space name iterate over the existing options.
         auto option_space_names = getOptionSpaceNames();
-        for (const auto& option_space_from_list : option_space_names) {
+        for (auto const& option_space_from_list : option_space_names) {
             // Get all options within the particular option space.
             auto options_in_space = getAll(option_space_from_list);
             for (auto option_it = options_in_space->begin();
index 75d7059e510625665c7feb767903f9c56fc3e963..2393f5d74cd66dd0baef6556f1c0340f34264ee4 100644 (file)
@@ -14,7 +14,7 @@ namespace dhcp {
 
 bool
 CfgSharedNetworks4::hasNetworkWithServerId(const IOAddress& server_id) const {
-    const auto& index = networks_.get<SharedNetworkServerIdIndexTag>();
+    auto const& index = networks_.get<SharedNetworkServerIdIndexTag>();
     auto network_it = index.find(server_id);
     return (network_it != index.cend());
 }
index a8de2f2047540b4d6dd75c2fbb137d8b8006e2c4..a47822017141026ce9ce4e31c0d2597f457b9c1a 100644 (file)
@@ -106,7 +106,7 @@ public:
     /// @return Pointer to the shared network or null pointer if the network
     /// is not found.
     SharedNetworkPtrType getByName(const std::string& name) const {
-        const auto& index = networks_.template get<SharedNetworkNameIndexTag>();
+        auto const& index = networks_.template get<SharedNetworkNameIndexTag>();
         auto shared_network = index.find(name);
         if (shared_network != index.cend()) {
             return (*shared_network);
@@ -122,7 +122,7 @@ public:
         data::ElementPtr list = data::Element::createList();
 
         // Insert shared networks sorted by their names into the list.
-        const auto& index = networks_.template get<SharedNetworkNameIndexTag>();
+        auto const& index = networks_.template get<SharedNetworkNameIndexTag>();
         for (auto shared_network = index.begin(); shared_network != index.end();
              ++shared_network) {
             list->add((*shared_network)->toElement());
@@ -186,7 +186,7 @@ public:
                 // Network exists, which means we're updating it.
                 // First we need to move its subnets to the new
                 // version of the network.
-                const auto subnets = (*existing_network)->getAllSubnets();
+                auto const subnets = (*existing_network)->getAllSubnets();
 
                 auto copy_subnets(*subnets);
                 for (auto subnet = copy_subnets.cbegin(); subnet != copy_subnets.cend(); ++subnet) {
index 3e7c58bed513a906caf772bac10b981741265029..3b581f966b82aa1340adc679c42bdd771c18e868 100644 (file)
@@ -155,7 +155,7 @@ CfgSubnets4::merge(CfgOptionDefPtr cfg_def, CfgSharedNetworks4Ptr networks,
         other_subnet->getCfgOption()->createOptions(cfg_def);
 
         // Create the options for pool based on the given definitions.
-        for (const auto& pool : other_subnet->getPoolsWritable(Lease::TYPE_V4)) {
+        for (auto const& pool : other_subnet->getPoolsWritable(Lease::TYPE_V4)) {
             pool->getCfgOption()->createOptions(cfg_def);
         }
 
@@ -185,21 +185,21 @@ CfgSubnets4::merge(CfgOptionDefPtr cfg_def, CfgSharedNetworks4Ptr networks,
 
 ConstSubnet4Ptr
 CfgSubnets4::getBySubnetId(const SubnetID& subnet_id) const {
-    const auto& index = subnets_.get<SubnetSubnetIdIndexTag>();
+    auto const& index = subnets_.get<SubnetSubnetIdIndexTag>();
     auto subnet_it = index.find(subnet_id);
     return ((subnet_it != index.cend()) ? (*subnet_it) : ConstSubnet4Ptr());
 }
 
 ConstSubnet4Ptr
 CfgSubnets4::getByPrefix(const std::string& subnet_text) const {
-    const auto& index = subnets_.get<SubnetPrefixIndexTag>();
+    auto const& index = subnets_.get<SubnetPrefixIndexTag>();
     auto subnet_it = index.find(subnet_text);
     return ((subnet_it != index.cend()) ? (*subnet_it) : ConstSubnet4Ptr());
 }
 
 bool
 CfgSubnets4::hasSubnetWithServerId(const asiolink::IOAddress& server_id) const {
-    const auto& index = subnets_.get<SubnetServerIdIndexTag>();
+    auto const& index = subnets_.get<SubnetServerIdIndexTag>();
     auto subnet_it = index.find(server_id);
     return (subnet_it != index.cend());
 }
@@ -535,7 +535,7 @@ CfgSubnets4::removeStatistics() {
         stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
                                              "reclaimed-leases"));
 
-        for (const auto& pool : subnet4->getPools(Lease::TYPE_V4)) {
+        for (auto const& pool : subnet4->getPools(Lease::TYPE_V4)) {
             stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
                                                  StatsMgr::generateName("pool", pool->getID(),
                                                                         "total-addresses")));
@@ -592,7 +592,7 @@ CfgSubnets4::updateStatistics() {
             stats_mgr.setValue(name_conflicts, static_cast<int64_t>(0));
         }
 
-        for (const auto& pool : subnet4->getPools(Lease::TYPE_V4)) {
+        for (auto const& pool : subnet4->getPools(Lease::TYPE_V4)) {
             const std::string& name_total(StatsMgr::generateName("subnet", subnet_id,
                                                                  StatsMgr::generateName("pool", pool->getID(),
                                                                                         "total-addresses")));
index bf2b6be5195a500deb38e71ed1d7f157e4e7b8ed..179c5bd22677c24d2032996ea5ac08cda3002d65 100644 (file)
@@ -152,12 +152,12 @@ CfgSubnets6::merge(CfgOptionDefPtr cfg_def, CfgSharedNetworks6Ptr networks,
         other_subnet->getCfgOption()->createOptions(cfg_def);
 
         // Create the options for pool based on the given definitions.
-        for (const auto& pool : other_subnet->getPoolsWritable(Lease::TYPE_NA)) {
+        for (auto const& pool : other_subnet->getPoolsWritable(Lease::TYPE_NA)) {
             pool->getCfgOption()->createOptions(cfg_def);
         }
 
         // Create the options for pd pool based on the given definitions.
-        for (const auto& pool : other_subnet->getPoolsWritable(Lease::TYPE_PD)) {
+        for (auto const& pool : other_subnet->getPoolsWritable(Lease::TYPE_PD)) {
             pool->getCfgOption()->createOptions(cfg_def);
         }
 
@@ -187,14 +187,14 @@ CfgSubnets6::merge(CfgOptionDefPtr cfg_def, CfgSharedNetworks6Ptr networks,
 
 ConstSubnet6Ptr
 CfgSubnets6::getBySubnetId(const SubnetID& subnet_id) const {
-    const auto& index = subnets_.get<SubnetSubnetIdIndexTag>();
+    auto const& index = subnets_.get<SubnetSubnetIdIndexTag>();
     auto subnet_it = index.find(subnet_id);
     return ((subnet_it != index.cend()) ? (*subnet_it) : ConstSubnet6Ptr());
 }
 
 ConstSubnet6Ptr
 CfgSubnets6::getByPrefix(const std::string& subnet_text) const {
-    const auto& index = subnets_.get<SubnetPrefixIndexTag>();
+    auto const& index = subnets_.get<SubnetPrefixIndexTag>();
     auto subnet_it = index.find(subnet_text);
     return ((subnet_it != index.cend()) ? (*subnet_it) : ConstSubnet6Ptr());
 }
@@ -433,7 +433,7 @@ CfgSubnets6::removeStatistics() {
         stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
                                              "reclaimed-leases"));
 
-        for (const auto& pool : subnet6->getPools(Lease::TYPE_NA)) {
+        for (auto const& pool : subnet6->getPools(Lease::TYPE_NA)) {
             stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
                                                  StatsMgr::generateName("pool", pool->getID(),
                                                                         "total-nas")));
@@ -459,7 +459,7 @@ CfgSubnets6::removeStatistics() {
                                                                         "reclaimed-leases")));
         }
 
-        for (const auto& pool : subnet6->getPools(Lease::TYPE_PD)) {
+        for (auto const& pool : subnet6->getPools(Lease::TYPE_PD)) {
             stats_mgr.del(StatsMgr::generateName("subnet", subnet_id,
                                                  StatsMgr::generateName("pd-pool", pool->getID(),
                                                                         "total-pds")));
@@ -520,7 +520,7 @@ CfgSubnets6::updateStatistics() {
             stats_mgr.setValue(name_ia_pd_reuses, int64_t(0));
         }
 
-        for (const auto& pool : subnet6->getPools(Lease::TYPE_NA)) {
+        for (auto const& pool : subnet6->getPools(Lease::TYPE_NA)) {
             const std::string& name_total_nas(StatsMgr::generateName("subnet", subnet_id,
                                                                      StatsMgr::generateName("pool", pool->getID(),
                                                                                             "total-nas")));
@@ -538,7 +538,7 @@ CfgSubnets6::updateStatistics() {
             }
         }
 
-        for (const auto& pool : subnet6->getPools(Lease::TYPE_PD)) {
+        for (auto const& pool : subnet6->getPools(Lease::TYPE_PD)) {
             const std::string& name_total_pds(StatsMgr::generateName("subnet", subnet_id,
                                                                      StatsMgr::generateName("pd-pool", pool->getID(),
                                                                                             "total-pds")));
index 6ec2b8c5bd5c38a0b934f26d250afe27e8dd49d5..8f4dc11980ccb43d217003cdb18c71b70088951a 100644 (file)
@@ -97,7 +97,7 @@ IterativeAllocator::pickAddressInternal(const ClientClasses& client_classes,
     bool valid = true;
     bool retrying = false;
 
-    const auto& pools = subnet_.lock()->getPools(pool_type_);
+    auto const& pools = subnet_.lock()->getPools(pool_type_);
 
     if (pools.empty()) {
         isc_throw(AllocFailed, "No pools defined in selected subnet");
@@ -210,7 +210,7 @@ IterativeAllocator::pickPrefixInternal(const ClientClasses& client_classes,
     bool valid = true;
     bool retrying = false;
 
-    const auto& pools = subnet_.lock()->getPools(pool_type_);
+    auto const& pools = subnet_.lock()->getPools(pool_type_);
 
     if (pools.empty()) {
         isc_throw(AllocFailed, "No pools defined in selected subnet");
index 00a3200341d5210aa896db045e01d749de32273b..f56a749de4b8fada5e8560b876d956722fe9fbbc 100644 (file)
@@ -129,7 +129,7 @@ LeaseMgr::recountLeaseStats4() {
             stats_mgr.setValue(name_rec, zero);
         }
 
-        for (const auto& pool : (*subnet)->getPools(Lease::TYPE_V4)) {
+        for (auto const& pool : (*subnet)->getPools(Lease::TYPE_V4)) {
             const std::string name_aa(StatsMgr::generateName("subnet", subnet_id,
                                                              StatsMgr::generateName("pool", pool->getID(),
                                                                                     "assigned-addresses")));
@@ -353,7 +353,7 @@ LeaseMgr::recountLeaseStats6() {
                 zero);
         }
 
-        for (const auto& pool : (*subnet)->getPools(Lease::TYPE_NA)) {
+        for (auto const& pool : (*subnet)->getPools(Lease::TYPE_NA)) {
             const std::string& name_anas(StatsMgr::generateName("subnet", subnet_id,
                                                                 StatsMgr::generateName("pool", pool->getID(),
                                                                                        "assigned-nas")));
@@ -383,7 +383,7 @@ LeaseMgr::recountLeaseStats6() {
             }
         }
 
-        for (const auto& pool : (*subnet)->getPools(Lease::TYPE_PD)) {
+        for (auto const& pool : (*subnet)->getPools(Lease::TYPE_PD)) {
             const std::string& name_apds(StatsMgr::generateName("subnet", subnet_id,
                                                                 StatsMgr::generateName("pd-pool", pool->getID(),
                                                                                        "assigned-pds")));
index 42d754c757640335e824556033d2a61782c7d642..df812f144ad1ca4160b663c87555f9aa16082441 100644 (file)
@@ -3321,7 +3321,7 @@ Memfile_LeaseMgr::buildExtendedInfoTables6() {
     size_t modified = 0;
     size_t processed = 0;
 
-    for (const auto& lease : storage6_) {
+    for (auto const& lease : storage6_) {
         ++leases;
         try {
             if (upgradeLease6ExtendedInfo(lease, check)) {
@@ -3397,7 +3397,7 @@ Memfile_LeaseMgr::writeLeases4Internal(const std::string& filename) {
         ::rename(filename.c_str(), old.str().c_str());
         CSVLeaseFile4 backup(filename);
         backup.open();
-        for (const auto& lease : storage4_) {
+        for (auto const& lease : storage4_) {
             backup.append(*lease);
         }
         backup.close();
@@ -3434,7 +3434,7 @@ Memfile_LeaseMgr::writeLeases6Internal(const std::string& filename) {
         ::rename(filename.c_str(), old.str().c_str());
         CSVLeaseFile6 backup(filename);
         backup.open();
-        for (const auto& lease : storage6_) {
+        for (auto const& lease : storage6_) {
             backup.append(*lease);
         }
         backup.close();
index 9a7092e7e5ad108a7062bb737f849f8249debb2b..1b71d52c573bd372773e2924922c3ffd75eea257 100644 (file)
@@ -4580,7 +4580,7 @@ MySqlLeaseMgr::upgradeExtendedInfo6(const LeasePageSize& page_size) {
 
         ++pages;
         start_addr = leases.back()->addr_;
-        for (const auto& lease : leases) {
+        for (auto const& lease : leases) {
             try {
                 bool modified = upgradeLease6ExtendedInfo(lease, check);
                 if (modified) {
index d84ca12a10c8eae0f81865f241a70f65e205f823..0d04293f059ba8050f7798535925cb55ce1e63fb 100644 (file)
@@ -251,7 +251,7 @@ ClientClassDefParser::parse(ClientClassDictionaryPtr& class_dictionary,
     }
 
     // Sanity checks on built-in classes
-    for (const auto& bn : builtinNames) {
+    for (auto const& bn : builtinNames) {
         if (name == bn) {
             if (required) {
                 isc_throw(DhcpConfigError, "built-in class '" << name
index 384369c1e42f53fbdaafb51d9f3f796ca0db47a8..c064227362684bd2819e83ec07f9e77bd5ca419a 100644 (file)
@@ -651,7 +651,7 @@ SubnetConfigParser::createSubnet(ConstElementPtr params) {
     initSubnet(params, addr, len);
 
     // Add pools to it.
-    for (const auto& pool : *pools_) {
+    for (auto const& pool : *pools_) {
         try {
             subnet_->addPool(pool);
         } catch (const BadValue& ex) {
index a2d3fa4701376c554e45d76c881b100dc4c1caec..01718d9b5b305758f35d590a34acf53e699ea8b8 100644 (file)
@@ -3622,7 +3622,7 @@ PgSqlLeaseMgr::upgradeExtendedInfo6(const LeasePageSize& page_size) {
 
         ++pages;
         start_addr = leases.back()->addr_;
-        for (const auto& lease : leases) {
+        for (auto const& lease : leases) {
             try {
                 bool modified = upgradeLease6ExtendedInfo(lease, check);
                 if (modified) {
index 5298078f6c799e23b052ae05ab5e1641821cd1b6..d74201bdf7b46ba764114baa31e9e8dba0612dd5 100644 (file)
@@ -28,7 +28,7 @@ RandomAllocator::pickAddressInternal(const ClientClasses& client_classes,
                                      const IdentifierBaseTypePtr&,
                                      const IOAddress&) {
     auto subnet = subnet_.lock();
-    const auto& pools = subnet->getPools(pool_type_);
+    auto const& pools = subnet->getPools(pool_type_);
 
     // Let's first iterate over the pools and identify the ones that
     // meet client class criteria. Then, segregate these pools into
@@ -91,7 +91,7 @@ RandomAllocator::pickPrefixInternal(const ClientClasses& client_classes,
                                     const IOAddress&,
                                     uint8_t hint_prefix_length) {
     auto subnet = subnet_.lock();
-    const auto& pools = subnet->getPools(pool_type_);
+    auto const& pools = subnet->getPools(pool_type_);
 
     // Let's first iterate over the pools and identify the ones that
     // meet client class criteria. Then, segragate these pools into
index 2307dfe85cf59a935ad0d353db096c37d84a8783..1580b18d1f2ade6f7158c00fb64a1005370d20de 100644 (file)
@@ -158,7 +158,7 @@ public:
     template<typename SubnetPtrType, typename SubnetCollectionType>
     static SubnetPtrType getSubnet(const SubnetCollectionType& subnets,
                                    const SubnetID& subnet_id) {
-        const auto& index = subnets.template get<SubnetSubnetIdIndexTag>();
+        auto const& index = subnets.template get<SubnetSubnetIdIndexTag>();
         auto subnet_it = index.find(subnet_id);
         if (subnet_it != index.cend()) {
             return (*subnet_it);
@@ -183,7 +183,7 @@ public:
     template<typename SubnetPtrType, typename SubnetCollectionType>
     static SubnetPtrType getSubnet(const SubnetCollectionType& subnets,
                                    const std::string& subnet_prefix) {
-        const auto& index = subnets.template get<SubnetPrefixIndexTag>();
+        auto const& index = subnets.template get<SubnetPrefixIndexTag>();
         auto subnet_it = index.find(subnet_prefix);
         if (subnet_it != index.cend()) {
             return (*subnet_it);
@@ -245,7 +245,7 @@ public:
         // Need to retrieve an iterator to the current subnet first. The
         // subnet must exist in this container, thus we throw if the iterator
         // is not found.
-        const auto& index = subnets.template get<SubnetSubnetIdIndexTag>();
+        auto const& index = subnets.template get<SubnetSubnetIdIndexTag>();
         auto subnet_it = index.find(current_subnet);
         if (subnet_it == index.cend()) {
             isc_throw(BadValue, "no such subnet " << current_subnet
index 5783eac252b644708d4161f7940281ea6aa3e312..a07f964fee6dc7f9029aa56759dc3b9728781986 100644 (file)
@@ -333,7 +333,7 @@ SrvConfig::applyDefaultsConfiguredGlobals(const SimpleDefaults& defaults) {
     const Element::Position pos("<default-value>", 0, 0);
 
     // Let's go over all parameters we have defaults for.
-    for (const auto& def_value : defaults) {
+    for (auto const& def_value : defaults) {
 
         // Try if such a parameter is there. If it is, let's
         // skip it, because user knows best *cough*.
index 0477fc17b118456b85ebb819fd2a61b14427a41a..9acf1211f4aea716c6d46ad9014f3214fbb3af2c 100644 (file)
@@ -406,7 +406,7 @@ const PoolPtr Subnet::getPool(Lease::Type type, const isc::asiolink::IOAddress&
     // check if the type is valid (and throw if it isn't)
     checkType(type);
 
-    const auto& pools = getPools(type);
+    auto const& pools = getPools(type);
 
     PoolPtr candidate;
 
@@ -442,7 +442,7 @@ const PoolPtr Subnet::getPool(Lease::Type type, const isc::asiolink::IOAddress&
 
 void
 Subnet::initAllocatorsAfterConfigure() {
-    for (const auto& allocator : allocators_) {
+    for (auto const& allocator : allocators_) {
         allocator.second->initAfterConfigure();
     }
 }
@@ -453,7 +453,7 @@ const PoolPtr Subnet::getPool(Lease::Type type,
     // check if the type is valid (and throw if it isn't)
     checkType(type);
 
-    const auto& pools = getPools(type);
+    auto const& pools = getPools(type);
 
     PoolPtr candidate;
 
@@ -543,8 +543,8 @@ Subnet::inPool(Lease::Type type, const isc::asiolink::IOAddress& addr) const {
         return (false);
     }
 
-    const auto& pools = getPools(type);
-    for (const auto& pool : pools) {
+    auto const& pools = getPools(type);
+    for (auto const& pool : pools) {
         if (pool->inRange(addr)) {
             return (true);
         }
@@ -563,8 +563,8 @@ Subnet::inPool(Lease::Type type,
         return (false);
     }
 
-    const auto& pools = getPools(type);
-    for (const auto& pool : pools) {
+    auto const& pools = getPools(type);
+    for (auto const& pool : pools) {
         if (!pool->clientSupported(client_classes)) {
             continue;
         }
@@ -578,7 +578,7 @@ Subnet::inPool(Lease::Type type,
 
 bool
 Subnet::poolOverlaps(const Lease::Type& pool_type, const PoolPtr& pool) const {
-    const auto& pools = getPools(pool_type);
+    auto const& pools = getPools(pool_type);
 
     // If no pools, we don't overlap. Nothing to do.
     if (pools.empty()) {
@@ -599,7 +599,7 @@ Subnet::poolOverlaps(const Lease::Type& pool_type, const PoolPtr& pool) const {
     // greater than F2). prefixLessThanPoolAddress with the first argument
     // set to "true" is the custom comparison function for upper_bound, which
     // compares F2 with the first addresses of the existing pools.
-    const auto pool3_it =
+    auto const pool3_it =
         std::upper_bound(pools.begin(), pools.end(), pool->getFirstAddress(),
                          prefixLessThanFirstAddress);
 
@@ -810,9 +810,9 @@ Subnet4::toElement() const {
     isc::data::merge(map, d4o6.toElement());
 
     // Set pools
-    const auto& pools = getPools(Lease::TYPE_V4);
+    auto const& pools = getPools(Lease::TYPE_V4);
     ElementPtr pool_list = Element::createList();
-    for (const auto& pool : pools) {
+    for (auto const& pool : pools) {
         // Add the formatted pool to the list
         pool_list->add(pool->toElement());
     }
@@ -918,18 +918,18 @@ Subnet6::toElement() const {
     merge(map, network_map);
 
     // Set pools
-    const auto& pools = getPools(Lease::TYPE_NA);
+    auto const& pools = getPools(Lease::TYPE_NA);
     ElementPtr pool_list = Element::createList();
-    for (const auto& pool : pools) {
+    for (auto const& pool : pools) {
         // Add the formatted pool to the list
         pool_list->add(pool->toElement());
     }
     map->set("pools", pool_list);
 
     // Set pd-pools
-    const auto& pdpools = getPools(Lease::TYPE_PD);
+    auto const& pdpools = getPools(Lease::TYPE_PD);
     ElementPtr pdpool_list = Element::createList();
-    for (const auto& pool : pdpools) {
+    for (auto const& pool : pdpools) {
         // Add the formatted pool to the list
         pdpool_list->add(pool->toElement());
     }
index 8706767a0e03d9585e60fdf5c3fd9a35a7adea66..15b0c97f3f9e084441311225f14faebe44d03aef 100644 (file)
@@ -174,7 +174,7 @@ public:
     /// @param object_type Object type.
     bool hasConfigElement(const std::string& object_type) const {
         if (!audit_entries_.empty()) {
-            const auto& index = audit_entries_.get<AuditEntryObjectTypeTag>();
+            auto const& index = audit_entries_.get<AuditEntryObjectTypeTag>();
             auto range = index.equal_range(object_type);
             for (auto it = range.first; it != range.second; ++it) {
                 if (((*it)->getModificationType() != AuditEntry::ModificationType::DELETE)) {
@@ -195,7 +195,7 @@ public:
     bool deleteConfigElement(const std::string& object_type,
                              const uint64_t object_id) const {
         if (!audit_entries_.empty()) {
-            const auto& index = audit_entries_.get<AuditEntryObjectTypeTag>();
+            auto const& index = audit_entries_.get<AuditEntryObjectTypeTag>();
             auto range = index.equal_range(boost::make_tuple(object_type,
                                                              AuditEntry::ModificationType::DELETE));
             for (auto it = range.first; it != range.second; ++it) {
index f34b308dd60ef1032c95bec25a8d9e6a967e0eab..5eff523f559170184c8a81a7498c1576a8b03c87 100644 (file)
@@ -187,7 +187,7 @@ public:
 
     /// @brief Remove other files.
     void removeOtherFiles() const {
-        for (const auto& file : extra_files_) {
+        for (auto const& file : extra_files_) {
             LeaseFileIO io(file);
             io.removeFile();
         }
index 00a42b0ebe1fddd32cc30f9debecf336dd0c7057..ea200016d398e9876c87aaff65df02213874d240 100644 (file)
@@ -404,7 +404,7 @@ TEST(SharedNetwork4Test, getNextSubnet) {
             if (j < subnets.size() - 1) {
                 ASSERT_TRUE(s) << "retrieving next subnet failed for pair of"
                     " indexes (i, j) = (" << i << ", " << j << ")";
-                const auto expected_subnet_id = (i + j + 1) % subnets.size() + 1;
+                auto const expected_subnet_id = (i + j + 1) % subnets.size() + 1;
                 EXPECT_EQ(expected_subnet_id, s->getID());
             } else {
                 // Null subnet returned for a last iteration.
@@ -1154,7 +1154,7 @@ TEST(SharedNetwork6Test, getNextSubnet) {
             if (j < subnets.size() - 1) {
                 ASSERT_TRUE(s) << "retrieving next subnet failed for pair of"
                     " indexes (i, j) = (" << i << ", " << j << ")";
-                const auto expected_subnet_id = (i + j + 1) % subnets.size() + 1;
+                auto const expected_subnet_id = (i + j + 1) % subnets.size() + 1;
                 EXPECT_EQ(expected_subnet_id, s->getID());
             } else {
                 // Null subnet returned for a last iteration.
index f10d3e87f9f03015da2ba12af275bf4f1fdf217d..55540e0aae70d1d72c8fe8e0d12f19471d013932 100644 (file)
@@ -144,7 +144,7 @@ GenericBackendTest::testNewAuditEntry(const std::string& exp_object_type,
         // Server tag is 'all'.
         tag = "all";
     } else {
-        const auto& tags = server_selector.getTags();
+        auto const& tags = server_selector.getTags();
         // This test is not meant to handle multiple server tags all at once.
         if (tags.size() > 1) {
             ADD_FAILURE() << "Test error: do not use multiple server tags";
@@ -191,7 +191,7 @@ GenericBackendTest::testNewAuditEntry(const std::vector<ExpAuditEntry>& exp_entr
         // Server tag is 'all'.
         tag = "all";
     } else {
-        const auto& tags = server_selector.getTags();
+        auto const& tags = server_selector.getTags();
         // This test is not meant to handle multiple server tags all at once.
         if (tags.size() != 1) {
             ADD_FAILURE() << "Test error: tags.size(): " << tags.size()
index 8ab8df761686905ddb1e14d9d6ab20d03b6b8a0c..4d71fce430e6621ae154d06763f12f1594385a5c 100644 (file)
@@ -886,7 +886,7 @@ GenericConfigBackendDHCPv4Test::getAllGlobalParameters4Test() {
     auto parameters = cbptr_->getAllGlobalParameters4(ServerSelector::ALL());
     ASSERT_EQ(5, parameters.size());
 
-    const auto& parameters_index = parameters.get<StampedValueNameIndexTag>();
+    auto const& parameters_index = parameters.get<StampedValueNameIndexTag>();
 
     // Verify their values.
     EXPECT_EQ("value1", (*parameters_index.find("name1"))->getValue());
@@ -939,7 +939,7 @@ GenericConfigBackendDHCPv4Test::getModifiedGlobalParameters4Test() {
     auto parameters = cbptr_->getModifiedGlobalParameters4(ServerSelector::ALL(),
                                                            timestamps_["after today"]);
 
-    const auto& parameters_index = parameters.get<StampedValueNameIndexTag>();
+    auto const& parameters_index = parameters.get<StampedValueNameIndexTag>();
 
     // It should be the one modified "tomorrow".
     ASSERT_EQ(1, parameters_index.size());
index 584f2998ec5db19e60920aa500a34efac7ec1312..62985934c56860a17b9278fce16e455ce3fc8754 100644 (file)
@@ -918,7 +918,7 @@ GenericConfigBackendDHCPv6Test::getAllGlobalParameters6Test() {
     auto parameters = cbptr_->getAllGlobalParameters6(ServerSelector::ALL());
     ASSERT_EQ(5, parameters.size());
 
-    const auto& parameters_index = parameters.get<StampedValueNameIndexTag>();
+    auto const& parameters_index = parameters.get<StampedValueNameIndexTag>();
 
     // Verify their values.
     EXPECT_EQ("value1", (*parameters_index.find("name1"))->getValue());
@@ -971,7 +971,7 @@ GenericConfigBackendDHCPv6Test::getModifiedGlobalParameters6Test() {
     auto parameters = cbptr_->getModifiedGlobalParameters6(ServerSelector::ALL(),
                                                            timestamps_["after today"]);
 
-    const auto& parameters_index = parameters.get<StampedValueNameIndexTag>();
+    auto const& parameters_index = parameters.get<StampedValueNameIndexTag>();
 
     // It should be the one modified "tomorrow".
     ASSERT_EQ(1, parameters_index.size());
index 0920bc4bbad471797242225de68b735fdea26dd3..f3caa3f8c6e1f564461b26907c11f5ab290cbdbb 100644 (file)
@@ -5352,7 +5352,7 @@ HostMgrTest::testDelete6ByIDAndIdentifier(BaseHostDataSource& data_source1,
 }
 
 bool HostMgrTest::isPrimaryDataSource(const BaseHostDataSource& data_source) const {
-    const auto ptr = dynamic_cast<const CfgHosts*>(&data_source);
+    auto const ptr = dynamic_cast<const CfgHosts*>(&data_source);
     return ptr != nullptr;
 }
 
index 7b6bd22c033da5f5288eb4dce5f71756dfd5a938..ef1b2bcd6413ba6e826c041a96040d6c61c46428 100644 (file)
@@ -179,7 +179,7 @@ MemHostDataSource::getPage6(size_t& /*source_index*/,
 ConstHostCollection
 MemHostDataSource::getAll4(const asiolink::IOAddress& address) const {
     ConstHostCollection hosts;
-    for (const auto & h : store_) {
+    for (auto const & h : store_) {
         if (h->getIPv4Reservation() == address) {
             hosts.push_back(h);
         }
@@ -250,7 +250,7 @@ ConstHostCollection
 MemHostDataSource::getAll4(const SubnetID& subnet_id,
                            const asiolink::IOAddress& address) const {
     ConstHostCollection hosts;
-    for (const auto & h : store_) {
+    for (auto const & h : store_) {
         if (h->getIPv4SubnetID() == subnet_id &&
             h->getIPv4Reservation() == address) {
             hosts.push_back(h);
@@ -296,7 +296,7 @@ ConstHostCollection
 MemHostDataSource::getAll6(const SubnetID& subnet_id,
                            const asiolink::IOAddress& address) const {
     ConstHostCollection hosts;
-    for (const auto & h : store_) {
+    for (auto const & h : store_) {
         if (h->getIPv6SubnetID() != subnet_id) {
             continue;
         }
@@ -315,7 +315,7 @@ MemHostDataSource::getAll6(const SubnetID& subnet_id,
 ConstHostCollection
 MemHostDataSource::getAll6(const asiolink::IOAddress& address) const {
     ConstHostCollection hosts;
-    for (const auto & h : store_) {
+    for (auto const & h : store_) {
         auto resrvs = h->getIPv6Reservations();
         for (auto r = resrvs.first; r != resrvs.second; ++r) {
             if ((*r).second.getPrefix() == address) {
index a3cfcbd1c8fee05c5fb8625ce6667b3215a9cef2..98be2a13377909333f16617a8be6129fa0d2d969 100644 (file)
@@ -37,7 +37,7 @@ TestConfigBackendDHCPv4::unregisterBackendType(ConfigBackendDHCPv4Mgr& mgr,
 Subnet4Ptr
 TestConfigBackendDHCPv4::getSubnet4(const db::ServerSelector& server_selector,
                                     const std::string& subnet_prefix) const{
-    const auto& index = subnets_.get<SubnetPrefixIndexTag>();
+    auto const& index = subnets_.get<SubnetPrefixIndexTag>();
     auto subnet_it = index.find(subnet_prefix);
     if (subnet_it == index.cend()) {
         return (Subnet4Ptr());
@@ -61,7 +61,7 @@ TestConfigBackendDHCPv4::getSubnet4(const db::ServerSelector& server_selector,
 Subnet4Ptr
 TestConfigBackendDHCPv4::getSubnet4(const db::ServerSelector& server_selector,
                                     const SubnetID& subnet_id) const {
-    const auto& index = subnets_.get<SubnetSubnetIdIndexTag>();
+    auto const& index = subnets_.get<SubnetSubnetIdIndexTag>();
     auto subnet_it = index.find(subnet_id);
     if (subnet_it == index.cend()) {
         return (Subnet4Ptr());
@@ -118,7 +118,7 @@ TestConfigBackendDHCPv4::getAllSubnets4(const db::ServerSelector& server_selecto
 Subnet4Collection
 TestConfigBackendDHCPv4::getModifiedSubnets4(const db::ServerSelector& server_selector,
                                              const boost::posix_time::ptime& modification_time) const {
-    const auto& index = subnets_.get<SubnetModificationTimeIndexTag>();
+    auto const& index = subnets_.get<SubnetModificationTimeIndexTag>();
     Subnet4Collection subnets;
     auto lb = index.lower_bound(modification_time);
     for (auto subnet = lb; subnet != index.end(); ++subnet) {
@@ -197,7 +197,7 @@ TestConfigBackendDHCPv4::getSharedNetworkSubnets4(const db::ServerSelector& serv
 SharedNetwork4Ptr
 TestConfigBackendDHCPv4::getSharedNetwork4(const db::ServerSelector& server_selector,
                                            const std::string& name) const {
-    const auto& index = shared_networks_.get<SharedNetworkNameIndexTag>();
+    auto const& index = shared_networks_.get<SharedNetworkNameIndexTag>();
     auto network_it = index.find(name);
     if (network_it == index.cend()) {
         return (SharedNetwork4Ptr());
@@ -254,7 +254,7 @@ TestConfigBackendDHCPv4::getAllSharedNetworks4(const db::ServerSelector& server_
 SharedNetwork4Collection
 TestConfigBackendDHCPv4::getModifiedSharedNetworks4(const db::ServerSelector& server_selector,
                                                     const boost::posix_time::ptime& modification_time) const {
-    const auto& index = shared_networks_.get<SharedNetworkModificationTimeIndexTag>();
+    auto const& index = shared_networks_.get<SharedNetworkModificationTimeIndexTag>();
     SharedNetwork4Collection shared_networks;
     auto lb = index.lower_bound(modification_time);
     for (auto shared_network = lb; shared_network != index.end(); ++shared_network) {
@@ -293,7 +293,7 @@ TestConfigBackendDHCPv4::getOptionDef4(const db::ServerSelector& server_selector
                                        const std::string& space) const {
     auto tags = server_selector.getTags();
     auto candidate = OptionDefinitionPtr();
-    const auto& index = option_defs_.get<1>();
+    auto const& index = option_defs_.get<1>();
     auto option_def_it_pair = index.equal_range(code);
 
     for (auto option_def_it = option_def_it_pair.first;
@@ -348,7 +348,7 @@ TestConfigBackendDHCPv4::getModifiedOptionDefs4(const db::ServerSelector& server
                                                 const boost::posix_time::ptime& modification_time) const {
     auto tags = server_selector.getTags();
     OptionDefContainer option_defs;
-    const auto& index = option_defs_.get<3>();
+    auto const& index = option_defs_.get<3>();
     auto lb = index.lower_bound(modification_time);
     for (auto option_def = lb; option_def != index.end(); ++option_def) {
         bool got = false;
@@ -375,7 +375,7 @@ TestConfigBackendDHCPv4::getOption4(const db::ServerSelector& server_selector,
                                     const std::string& space) const {
     auto tags = server_selector.getTags();
     auto candidate = OptionDescriptorPtr();
-    const auto& index = options_.get<1>();
+    auto const& index = options_.get<1>();
     auto option_it_pair = index.equal_range(code);
 
     for (auto option_it = option_it_pair.first; option_it != option_it_pair.second;
@@ -423,7 +423,7 @@ TestConfigBackendDHCPv4::getModifiedOptions4(const db::ServerSelector& server_se
                                              const boost::posix_time::ptime& modification_time) const {
     auto tags = server_selector.getTags();
     OptionContainer options;
-    const auto& index = options_.get<3>();
+    auto const& index = options_.get<3>();
     auto lb = index.lower_bound(modification_time);
     for (auto option = lb; option != index.end(); ++option) {
         bool got = false;
@@ -449,7 +449,7 @@ TestConfigBackendDHCPv4::getGlobalParameter4(const db::ServerSelector& server_se
                                              const std::string& name) const {
     auto tags = server_selector.getTags();
     auto candidate = StampedValuePtr();
-    const auto& index = globals_.get<StampedValueNameIndexTag>();
+    auto const& index = globals_.get<StampedValueNameIndexTag>();
     auto global_range = index.equal_range(name);
     for (auto global_it = global_range.first; global_it != global_range.second;
          ++global_it) {
@@ -495,7 +495,7 @@ TestConfigBackendDHCPv4::getModifiedGlobalParameters4(const db::ServerSelector&
                                                       const boost::posix_time::ptime& modification_time) const {
     auto tags = server_selector.getTags();
     StampedValueCollection globals;
-    const auto& index = globals_.get<StampedValueModificationTimeIndexTag>();
+    auto const& index = globals_.get<StampedValueModificationTimeIndexTag>();
     auto lb = index.lower_bound(modification_time);
     for (auto global = lb; global != index.end(); ++global) {
         bool got = false;
@@ -658,7 +658,7 @@ TestConfigBackendDHCPv4::getAllServers4() const {
 
 ServerPtr
 TestConfigBackendDHCPv4::getServer4(const ServerTag& server_tag) const {
-    const auto& index = servers_.get<ServerTagIndexTag>();
+    auto const& index = servers_.get<ServerTagIndexTag>();
     auto server_it = index.find(server_tag.get());
     return ((server_it != index.cend()) ? (*server_it) : ServerPtr());
 }
index cd9045bfe3c2773dd417672e6e87744d4350de46..9a3fe1d6d7fbeca8fb45095ea156a932f77a1ff8 100644 (file)
@@ -36,7 +36,7 @@ TestConfigBackendDHCPv6::unregisterBackendType(ConfigBackendDHCPv6Mgr& mgr,
 Subnet6Ptr
 TestConfigBackendDHCPv6::getSubnet6(const db::ServerSelector& server_selector,
                                     const std::string& subnet_prefix) const{
-    const auto& index = subnets_.get<SubnetPrefixIndexTag>();
+    auto const& index = subnets_.get<SubnetPrefixIndexTag>();
     auto subnet_it = index.find(subnet_prefix);
     if (subnet_it == index.cend()) {
         return (Subnet6Ptr());
@@ -60,7 +60,7 @@ TestConfigBackendDHCPv6::getSubnet6(const db::ServerSelector& server_selector,
 Subnet6Ptr
 TestConfigBackendDHCPv6::getSubnet6(const db::ServerSelector& server_selector,
                                     const SubnetID& subnet_id) const {
-    const auto& index = subnets_.get<SubnetSubnetIdIndexTag>();
+    auto const& index = subnets_.get<SubnetSubnetIdIndexTag>();
     auto subnet_it = index.find(subnet_id);
     if (subnet_it == index.cend()) {
         return (Subnet6Ptr());
@@ -117,7 +117,7 @@ TestConfigBackendDHCPv6::getAllSubnets6(const db::ServerSelector& server_selecto
 Subnet6Collection
 TestConfigBackendDHCPv6::getModifiedSubnets6(const db::ServerSelector& server_selector,
                                              const boost::posix_time::ptime& modification_time) const {
-    const auto& index = subnets_.get<SubnetModificationTimeIndexTag>();
+    auto const& index = subnets_.get<SubnetModificationTimeIndexTag>();
     Subnet6Collection subnets;
     auto lb = index.lower_bound(modification_time);
     for (auto subnet = lb; subnet != index.end(); ++subnet) {
@@ -196,7 +196,7 @@ TestConfigBackendDHCPv6::getSharedNetworkSubnets6(const db::ServerSelector& serv
 SharedNetwork6Ptr
 TestConfigBackendDHCPv6::getSharedNetwork6(const db::ServerSelector& server_selector,
                                            const std::string& name) const {
-    const auto& index = shared_networks_.get<SharedNetworkNameIndexTag>();
+    auto const& index = shared_networks_.get<SharedNetworkNameIndexTag>();
     auto network_it = index.find(name);
     if (network_it == index.cend()) {
         return (SharedNetwork6Ptr());
@@ -253,7 +253,7 @@ TestConfigBackendDHCPv6::getAllSharedNetworks6(const db::ServerSelector& server_
 SharedNetwork6Collection
 TestConfigBackendDHCPv6::getModifiedSharedNetworks6(const db::ServerSelector& server_selector,
                                                     const boost::posix_time::ptime& modification_time) const {
-    const auto& index = shared_networks_.get<SharedNetworkModificationTimeIndexTag>();
+    auto const& index = shared_networks_.get<SharedNetworkModificationTimeIndexTag>();
     SharedNetwork6Collection shared_networks;
     auto lb = index.lower_bound(modification_time);
     for (auto shared_network = lb; shared_network != index.end(); ++shared_network) {
@@ -292,7 +292,7 @@ TestConfigBackendDHCPv6::getOptionDef6(const db::ServerSelector& server_selector
                                        const std::string& space) const {
     auto tags = server_selector.getTags();
     auto candidate = OptionDefinitionPtr();
-    const auto& index = option_defs_.get<1>();
+    auto const& index = option_defs_.get<1>();
     auto option_def_it_pair = index.equal_range(code);
 
     for (auto option_def_it = option_def_it_pair.first;
@@ -347,7 +347,7 @@ TestConfigBackendDHCPv6::getModifiedOptionDefs6(const db::ServerSelector& server
                                                 const boost::posix_time::ptime& modification_time) const {
     auto tags = server_selector.getTags();
     OptionDefContainer option_defs;
-    const auto& index = option_defs_.get<3>();
+    auto const& index = option_defs_.get<3>();
     auto lb = index.lower_bound(modification_time);
     for (auto option_def = lb; option_def != index.end(); ++option_def) {
         bool got = false;
@@ -374,7 +374,7 @@ TestConfigBackendDHCPv6::getOption6(const db::ServerSelector& server_selector,
                                     const std::string& space) const {
     auto tags = server_selector.getTags();
     auto candidate = OptionDescriptorPtr();
-    const auto& index = options_.get<1>();
+    auto const& index = options_.get<1>();
     auto option_it_pair = index.equal_range(code);
 
     for (auto option_it = option_it_pair.first; option_it != option_it_pair.second;
@@ -422,7 +422,7 @@ TestConfigBackendDHCPv6::getModifiedOptions6(const db::ServerSelector& server_se
                                              const boost::posix_time::ptime& modification_time) const {
     auto tags = server_selector.getTags();
     OptionContainer options;
-    const auto& index = options_.get<3>();
+    auto const& index = options_.get<3>();
     auto lb = index.lower_bound(modification_time);
     for (auto option = lb; option != index.end(); ++option) {
         bool got = false;
@@ -448,7 +448,7 @@ TestConfigBackendDHCPv6::getGlobalParameter6(const db::ServerSelector& server_se
                                              const std::string& name) const {
     auto tags = server_selector.getTags();
     auto candidate = StampedValuePtr();
-    const auto& index = globals_.get<StampedValueNameIndexTag>();
+    auto const& index = globals_.get<StampedValueNameIndexTag>();
     auto global_range = index.equal_range(name);
     for (auto global_it = global_range.first; global_it != global_range.second;
          ++global_it) {
@@ -494,7 +494,7 @@ TestConfigBackendDHCPv6::getModifiedGlobalParameters6(const db::ServerSelector&
                                                       const boost::posix_time::ptime& modification_time) const {
     auto tags = server_selector.getTags();
     StampedValueCollection globals;
-    const auto& index = globals_.get<StampedValueModificationTimeIndexTag>();
+    auto const& index = globals_.get<StampedValueModificationTimeIndexTag>();
     auto lb = index.lower_bound(modification_time);
     for (auto global = lb; global != index.end(); ++global) {
         bool got = false;
@@ -657,7 +657,7 @@ TestConfigBackendDHCPv6::getAllServers6() const {
 
 ServerPtr
 TestConfigBackendDHCPv6::getServer6(const ServerTag& server_tag) const {
-    const auto& index = servers_.get<ServerTagIndexTag>();
+    auto const& index = servers_.get<ServerTagIndexTag>();
     auto server_it = index.find(server_tag.get());
     return ((server_it != index.cend()) ? (*server_it) : ServerPtr());
 }
index 1d70995e329b267b23f9f66cd804956768290071..cff5ecb6cc044a592ea48c993599f2bc135b2a60 100644 (file)
@@ -362,7 +362,7 @@ BasicHttpAuthConfig::checkAuth(const HttpResponseCreator& creator,
         value = value.substr(5);
         value = str::trim(value);
         // Verify the credential is in the list.
-        const auto it = credentials.find(value);
+        auto const it = credentials.find(value);
         if (it != credentials.end()) {
             LOG_INFO(auth_logger, HTTP_CLIENT_REQUEST_AUTHORIZED)
                 .arg(it->second);
index ef04c28c6000a0d3cbd699fa86feba0d550a2dea..e2fabf8136b3fb75c3c8db000dce667d09776b4f 100644 (file)
@@ -213,7 +213,7 @@ public:
         }
 
         // Stop all listeners.
-        for (const auto& listener : listeners_) {
+        for (auto const& listener : listeners_) {
             listener->stop();
         }
 
@@ -518,7 +518,7 @@ public:
         ASSERT_NO_THROW(client_->stop());
 
         // Listeners should stop without issue.
-        for (const auto& listener : listeners_) {
+        for (auto const& listener : listeners_) {
             ASSERT_NO_THROW(listener->stop());
         }
 
@@ -713,7 +713,7 @@ public:
         ASSERT_NO_THROW(client_->stop());
 
         // Listeners should stop without issue.
-        for (const auto& listener : listeners_) {
+        for (auto const& listener : listeners_) {
             ASSERT_NO_THROW(listener->stop());
         }
 
index 871a2649927a54ddf8f11bc6e3bf6629628cebd2..4c73066c92682f0b8969e464b99f1595b42f31f4 100644 (file)
@@ -162,7 +162,7 @@ public:
     /// @param insert_rows Collection of rows of data to insert. Note that
     /// each row is inserted as a separate statement execution.
     void testInsert(const TestRowSet& insert_rows) {
-        for (const auto& row : insert_rows) {
+        for (auto const& row : insert_rows) {
             // Set the insert parameters based on the current insert row.
             PsqlBindArray in_bindings;
             in_bindings.add(row.int_col);
@@ -238,7 +238,7 @@ public:
     /// @param update_rows Collection of rows of data to update.
     void testUpdate(const TestRowSet& update_rows) {
         size_t update_count = 0;
-        for (const auto& row : update_rows) {
+        for (auto const& row : update_rows) {
             // Set the text value and where clause parameters based on the
             // this row's values.
             PsqlBindArray in_bindings;
index 28a3457d3351920b698d1e2db87a4cbeac0f15a7..b333d5463c2ffeb032783cc6f6218ac0e81eb178 100644 (file)
@@ -269,7 +269,7 @@ protected:
     fetchConfigElement(const db::AuditEntryCollection& audit_entries,
                        const std::string& object_type) const {
         db::AuditEntryCollection result;
-        const auto& index = audit_entries.get<db::AuditEntryObjectTypeTag>();
+        auto const& index = audit_entries.get<db::AuditEntryObjectTypeTag>();
         auto range = index.equal_range(object_type);
         for (auto it = range.first; it != range.second; ++it) {
             if ((*it)->getModificationType() != db::AuditEntry::ModificationType::DELETE) {
@@ -346,7 +346,7 @@ protected:
 
         // Get the audit entries sorted by modification time and id,
        // and pick the latest entry.
-        const auto& index = audit_entries.get<db::AuditEntryModificationTimeIdTag>();
+        auto const& index = audit_entries.get<db::AuditEntryModificationTimeIdTag>();
         last_audit_revision_time_ = (*index.rbegin())->getModificationTime();
         last_audit_revision_id_ = (*index.rbegin())->getRevisionId();
     }
@@ -370,7 +370,7 @@ protected:
 inline bool
 hasObjectId(const db::AuditEntryCollection& audit_entries,
             const uint64_t& object_id) {
-    const auto& object_id_idx = audit_entries.get<db::AuditEntryObjectIdTag>();
+    auto const& object_id_idx = audit_entries.get<db::AuditEntryObjectIdTag>();
     return (object_id_idx.count(object_id) > 0);
 }
 
index 686620e3242bbfb5a936a9ff2d8ffa3eae469985..2f4d6a50918a33b0740a1d728d311e145a83f0e8 100644 (file)
@@ -46,7 +46,7 @@ redact(ElementPtrType const& element, list<string> json_path) {
         if (next_key == "*" || json_path.empty()) {
             // Then iterate through all the children.
             result = Element::createMap();
-            for (const auto& kv : element->mapValue()) {
+            for (auto const& kv : element->mapValue()) {
                 std::string const& key(kv.first);
                 ConstElementPtr const& value(kv.second);
 
index 6c6710944c6eb31c3c9ecec005b73f851036ff5b..4f244db1716cb7376db45ea9f9f8cfc002082827 100644 (file)
@@ -51,7 +51,7 @@ public:
         db::AuditEntryCollection filtered_entries;
 
         // Use the index which orders the audit entries by timestamps.
-        const auto& index = audit_entries_.get<AuditEntryModificationTimeIdTag>();
+        auto const& index = audit_entries_.get<AuditEntryModificationTimeIdTag>();
 
         // Locate the first audit entry after the last one having the
         // specified modification time and id.
index 2a560efafd1c2925dd7e0ccd2dc74d2019cc077d..399f5bf1ed6b39cd98125cd4493023ca18deb18a 100644 (file)
@@ -80,7 +80,7 @@ StatContext::getAll() const {
 void
 StatContext::setMaxSampleCountAll(uint32_t max_samples) {
     // Let's iterate over all stored statistics...
-    for (const auto& s : stats_) {
+    for (auto const& s : stats_) {
         // ... and set count limit for each statistic.
         s.second->setMaxSampleCount(max_samples);
     }
index 3a3786ae5d286d36b3ab4bc303fa9bce94ce617c..c730b9c3c0aa6c983c6e3654cafe32b08e5555f0 100644 (file)
@@ -61,7 +61,7 @@ inline void checkNoStat(const std::string& name) {
 ///
 /// @param expected_stats Map of expected static names and values.
 inline void checkStats(const StatMap& expected_stats) {
-    for (const auto& it : expected_stats) {
+    for (auto const& it : expected_stats) {
         checkStat(it.first, it.second);
     }
 }
index d5fe61018a362f6006911662dfc468c4af62d5d9..b7de361c88829197ed7c034471410b8cef4d5e21 100644 (file)
@@ -113,8 +113,8 @@ TcpConnectionPool::usedByRemoteIpInternal(const IOAddress& remote_ip,
                                           size_t& total_connections) {
     total_connections = connections_.size();
     size_t cnt = 0;
-    for (const auto& conn : connections_) {
-        const auto& ep = conn->getRemoteEndpoint();
+    for (auto const& conn : connections_) {
+        auto const& ep = conn->getRemoteEndpoint();
         if ((ep != TcpConnection::NO_ENDPOINT()) &&
             (IOAddress(ep.address()) == remote_ip)) {
             ++cnt;
index 66a88fa28272768fba5ee4f80a0d17599d545993..6d526482e504de2d7c5ad1083eb7b4cb4258d0fc 100644 (file)
@@ -101,7 +101,7 @@ namespace test {
 #define SKIP_IF(expression) \
 { \
     if (expression) { \
-        const auto info = ::testing::UnitTest::GetInstance()->current_test_info(); \
+        auto const info = ::testing::UnitTest::GetInstance()->current_test_info(); \
         std::cerr << "SKIPPING: " << info->test_case_name() << ":" << info->name() \
                   << ": '" << #expression << "' is true" << std::endl; \
         return; \
@@ -111,7 +111,7 @@ namespace test {
 #define SKIP_IF(expression) \
 { \
     if (expression) { \
-        const auto info = ::testing::UnitTest::GetInstance()->current_test_info(); \
+        auto const info = ::testing::UnitTest::GetInstance()->current_test_info(); \
         GTEST_SKIP() << "SKIPPING: " << info->test_case_name() << ":" << info->name() \
                   << ": '" << #expression << "' is true"; \
     } \
index 043b42d5a45f99c327f59797549ac8219041dda4..cf3eaa8b67b202ce12ecd745247c44a5b19d7dde 100644 (file)
@@ -154,7 +154,7 @@ MultiThreadingMgr::apply(bool enabled, uint32_t thread_count, uint32_t queue_siz
 void
 MultiThreadingMgr::checkCallbacksPermissions() {
     if (getMode()) {
-        for (const auto& cb : cs_callbacks_.getCallbackSets()) {
+        for (auto const& cb : cs_callbacks_.getCallbackSets()) {
             try {
                 (cb.check_cb_)();
             } catch (const isc::MultiThreadingInvalidOperation& ex) {
@@ -177,7 +177,7 @@ MultiThreadingMgr::checkCallbacksPermissions() {
 void
 MultiThreadingMgr::callEntryCallbacks() {
     if (getMode()) {
-        const auto& callbacks = cs_callbacks_.getCallbackSets();
+        auto const& callbacks = cs_callbacks_.getCallbackSets();
         for (auto cb_it = callbacks.begin(); cb_it != callbacks.end(); cb_it++) {
             try {
                 (cb_it->entry_cb_)();
@@ -193,7 +193,7 @@ MultiThreadingMgr::callEntryCallbacks() {
 void
 MultiThreadingMgr::callExitCallbacks() {
     if (getMode()) {
-        const auto& callbacks = cs_callbacks_.getCallbackSets();
+        auto const& callbacks = cs_callbacks_.getCallbackSets();
         for (auto cb_it = callbacks.rbegin(); cb_it != callbacks.rend(); cb_it++) {
             try {
                 (cb_it->exit_cb_)();
index e5d2496a80e96437381f9e5f570cec373e0120fb..4182692efe64f16e849469577dae940982f50e55 100644 (file)
@@ -365,7 +365,7 @@ typedef boost::shared_ptr<StringSanitizer> StringSanitizerPtr;
 /// @return True if empty or contains only printable characters, False otherwise
 inline bool
 isPrintable(const std::string& content) {
-    for (const auto& ch : content) {
+    for (auto const& ch : content) {
         if (isprint(static_cast<int>(ch)) == 0) {
             return (false);
         }
@@ -380,7 +380,7 @@ isPrintable(const std::string& content) {
 /// @return True if empty or contains only printable characters, False otherwise
 inline bool
 isPrintable(const std::vector<uint8_t>& content) {
-    for (const auto& ch : content) {
+    for (auto const& ch : content) {
         if (isprint(static_cast<int>(ch)) == 0) {
             return (false);
         }
index 0c0df198f641b9a3192a4c599a4c6369b3d74f38..fc9d9381cf6fb2bf1cf68568d687a392e0c645f1 100644 (file)
@@ -130,7 +130,7 @@ public:
         // signal threads that are waiting
         signalThreads();
         // wait for all test threads to exit
-        for (const auto& thread : threads_) {
+        for (auto const& thread : threads_) {
             thread->join();
         }
         // reset all threads
@@ -172,7 +172,7 @@ public:
     void checkRunHistory(uint32_t items_count) {
         uint32_t count = 0;
         // iterate over all threads history and count all the processed tasks
-        for (const auto& element : history_) {
+        for (auto const& element : history_) {
             count += element.second.size();
         }
         ASSERT_EQ(count, items_count);
index 379cb93b641d49f7856f491b3bc73aff204e0347..db2d415bca74f00f96d05b0db42f7ff1f8cb90e2 100644 (file)
@@ -242,7 +242,7 @@ private:
             isc_throw(MultiThreadingInvalidOperation, "thread pool stop called by worker thread");
         }
         queue_.disable();
-        for (const auto& thread : threads_) {
+        for (auto const& thread : threads_) {
             thread->join();
         }
         threads_.clear();
@@ -252,7 +252,7 @@ private:
     ///
     /// @return true if thread is owned, false otherwise
     bool checkThreadId(std::thread::id id) {
-        for (const auto& thread : threads_) {
+        for (auto const& thread : threads_) {
             if (id == thread->get_id()) {
                 return (true);
             }
index 11f3c4ab25f4e4918000742885c9f15c3ea0c298..dc05164da9ff10b0f03f8dbd87ae700ac9944b08 100644 (file)
@@ -280,7 +280,7 @@ void sanityCheckConfig(const string& model, const YRTree& tree) {
 // This is test environment sanity check. It verifies that all configuration
 // defined in yang_configs.h are sane.
 TEST(YangReprTest, verifyConfigs) {
-    for (const auto& x : TEST_CONFIGS) {
+    for (auto const& x : TEST_CONFIGS) {
         sanityCheckConfig(x.first, x.second);
     }
 }