}
}
+void
+CfgSubnets4::clear() {
+ subnets_.clear();
+}
+
ElementPtr
CfgSubnets4::toElement() const {
ElementPtr result = Element::createList();
/// @brief Calls @c initAllocatorsAfterConfigure for each subnet.
void initAllocatorsAfterConfigure();
+ /// @brief Clears all subnets from the configuration.
+ void clear();
+
/// @brief Unparse a configuration object
///
/// @return a pointer to unparsed configuration
}
}
+void
+CfgSubnets6::clear() {
+ subnets_.clear();
+}
+
ElementPtr
CfgSubnets6::toElement() const {
ElementPtr result = Element::createList();
/// @brief Calls @c initAllocatorsAfterConfigure for each subnet.
void initAllocatorsAfterConfigure();
+ /// @brief Clears all subnets from the configuration.
+ void clear();
+
/// @brief Unparse a configuration object
///
/// @return a pointer to unparsed configuration
}
// Clear all subnets defined in previous tests.
- for (Subnet4Ptr const& subnet : *CfgMgr::instance().getStagingCfg()->getCfgSubnets4()->getAll()) {
- CfgMgr::instance().getStagingCfg()->getCfgSubnets4()->del(subnet);
- }
- for (Subnet6Ptr const& subnet : *CfgMgr::instance().getStagingCfg()->getCfgSubnets6()->getAll()) {
- CfgMgr::instance().getStagingCfg()->getCfgSubnets6()->del(subnet);
- }
+ CfgMgr::instance().getStagingCfg()->getCfgSubnets4()->clear();
+ CfgMgr::instance().getStagingCfg()->getCfgSubnets6()->clear();
// Clear all stats.
StatsMgr::instance().removeAll();