示例#1
0
void SimpleQueryMatcher::solve_both_diff_qvar(
                    const ConditionSet& left, const ConditionSet& right,
    /* output */    ConditionSet& new_left, ConditionSet& new_right,
                    std::vector<ConditionPair>& result_pairs) 
{
    for(ConditionSet::iterator left_it = left.begin(); 
            left_it != left.end(); ++left_it)
    {
        for(ConditionSet::iterator right_it = right.begin();
              right_it != right.end(); ++right_it)
        {
            if(_solver->validate(left_it->get(), right_it->get())) {
                new_left.insert(*left_it);
                new_right.insert(*right_it);
                result_pairs.push_back(ConditionPair(*left_it, *right_it));
            }
        }
    }
}
示例#2
0
void SimpleQueryMatcher::solve_both_same_qvar(const ConditionSet& values,
     /* output */   ConditionSet& new_values,
                    std::vector<ConditionPair>& result_pairs)
{
    for(ConditionSet::iterator it = values.begin();
            it != values.end(); ++it)
    {
        if(_solver->validate(it->get(), it->get())) {
            new_values.insert(*it);
            result_pairs.push_back(ConditionPair(*it, *it));
        }
    }
}
示例#3
0
void SimpleQueryLinker::update_results(const std::string& qvar, 
        const ConditionSet& new_set)
{
    if(!is_initialized(qvar)) {
        _qvar_table[qvar] = new_set;
    } else {
        ConditionSet difference = _qvar_table[qvar].difference_with(new_set);
        if(!difference.is_empty()) {
            for(ConditionSet::iterator it = difference.begin(); 
                    it != difference.end(); ++it )
            {
                remove_condition(qvar, *it);
            }
        }
    }
}