#ifndef MINISAT_STATS_2_BSON
#define MINISAT_STATS_2_BSON

#include "util/convert.h"
#include "util/minisatstats.h"

#include "bsoncxx/document/value.hpp"
#include "bsoncxx/builder/stream/document.hpp"

namespace satlab
{

template<typename = bsoncxx::builder::stream::document, typename = MinisatStats>
bsoncxx::builder::stream::document convert(const MinisatStats& stats)
{
    bsoncxx::builder::stream::document builder;
    
    builder << "solves" << static_cast<int>(stats.getSolves())
            << "starts" << static_cast<int>(stats.getStarts())
            << "decisions" << static_cast<int>(stats.getDecisions())
            << "rnd_decisions" << static_cast<int>(stats.getRndDecisions())
            << "propagations" << static_cast<int>(stats.getPropagations())
            << "conflicts" << static_cast<int>(stats.getConflicts())
            << "dec_vars" << static_cast<int>(stats.getDecVars())
            << "clauses_literals" << static_cast<int>(stats.getClausesLiterals())
            << "learnts_literals" << static_cast<int>(stats.getLearntsLiterals())
            << "max_literals" << static_cast<int>(stats.getMaxLiterals())
            << "tot_literals" << static_cast<int>(stats.getTotLiterals());
    
    return builder;
}


}
#endif // MINISAT_STATS_2_BSON
