bool PropertyRestrictions<Key, KeyValue, Container>::Qualifies( const Container& rPropertiesContainer ) { bool qualifies = true; // individual has to have one of these properties for( Container& container : _restrictions) { qualifies = false; bool meets_property_restriction_criteria = true; for( auto kv : container ) { if( rPropertiesContainer.Contains( kv ) ) { LOG_DEBUG_F( "Partial property restriction: constraint is %s.\n", kv.ToString().c_str() ); continue; // we're good } else { meets_property_restriction_criteria = false; #ifdef WIN32 LOG_DEBUG_F( "Person does not get the intervention because the allowed property is %s and the person is %s.\n", kv.ToString().c_str(), rPropertiesContainer.Get( kv.GetKey<Key>() ).ToString().c_str() ); #endif break; } } // If verified, we're done since these are OR-ed together if( meets_property_restriction_criteria ) { qualifies = true; LOG_DEBUG_F( "Individual meets at least 1 of the OR-ed together property restriction conditions. Not checking the rest.\n" ); break; } } return qualifies; }