예제 #1
0
/// Callback to output conditions information
int ConditionPrinter::operator()(Condition cond)    {
    if ( cond.isValid() )   {
        printout(INFO,"Condition","++ %s%s",m_prefix.c_str(),cond.str(m_flag).c_str());
        const AbstractMap& data = cond.get<AbstractMap>();
        string new_prefix = m_prefix;
        new_prefix.assign(m_prefix.length(),' ');
        printout(INFO,"Condition","++ %s Path:%s Class:%d [%s]",
                 m_prefix.c_str(),
                 cond.name().c_str(),
                 data.classID,
                 cond.data().dataType().c_str());
        if ( !data.params.empty() )  {
            if ( m_print )  {
                const string& tmp = m_print->prefix();
                m_print->setPrefix(new_prefix);
                for_each(data.params.begin(), data.params.end(),*m_print);
                m_print->setPrefix(tmp);
                return 1;
            }
            for_each(data.params.begin(), data.params.end(),ParamPrinter(new_prefix));
        }
    }
    return 1;
}