20 std::vector<const Resource*> initial_list)
22 TLOG_DEBUG(2) <<
"construct the object from Resource " << root->
UID() ;
23 update(root, initial_list);
28 std::vector<const Resource*> initial_list) {
33 if (initial_list.empty()) {
34 TLOG_DEBUG( 6) <<
"We have no disabled components";
41 std::vector<const ResourceSet*> resource_sets;
42 fill(*root, resource_sets, cd_fuse);
44 for (
auto & comp : initial_list) {
46 TLOG_DEBUG(6) << comp->UID() <<
" is disabled in session";
52 for (
unsigned long count = 1;
true; ++count) {
53 const unsigned long num(
size());
55 TLOG_DEBUG(6) <<
"before auto-disabling iteration " << count <<
" the number of disabled components is " << num ;
56 for (
const auto& res_set : resource_sets) {
58 if (res_set->compute_disabled_state(
m_disabled)) {
59 TLOG_DEBUG(6) <<
"disable custom resource-set- " << res_set->UID() <<
" because children are disabled" ;
67 TLOG_DEBUG(6) <<
"after " << count <<
" iteration(s) auto-disabling algorithm found no newly disabled sets, exiting loop ..." ;
71 unsigned int iLimit(1000);
81 std::vector<const ResourceSet*>& all_resource_sets,
85 all_resource_sets.push_back(&rs);
87 if (rptr->cast<
Resource>() ==
nullptr) {
93 fill(*rs2, all_resource_sets, cd_fuse);
105 TLOG_DEBUG(6) <<
"Disabling child " << res->UID();
std::string full_name() const noexcept
const TARGET * cast() const noexcept
Casts object to different class.
const std::string & class_name() const noexcept
const std::string & UID() const noexcept
void disable_children(const ResourceSet &)
std::set< std::string > m_disabled
bool is_enabled(const Resource *component) const
void update(const ResourceSet *root, std::vector< const Resource * > initial_list)
DisabledResources()=default
void fill(const ResourceSet &rs, std::vector< const ResourceSet * > &all_resource_sets, TestCircularDependency &cd_fuse)
void disable(const Resource &component)
virtual std::vector< const Resource * > contained_resources() const =0
#define TLOG_DEBUG(lvl,...)
void error(const Issue &issue)