Logo Search packages:      
Sourcecode: packup version File versions  Download package

void Encoder::encode (  )

features

Definition at line 356 of file Encoder.cc.

                     {
    OUT ( cerr << "encode ()" << endl;  )
    refine_upgrade_request();
    
    // Compute needed units and features (slicing)
    slice();

    // top bound
    solver.set_top(get_top(lexicographic));

    //Sort versions
    InstallableUnitCmp cmp;
    FOR_EACH(PackageUnits::iterator,i,needed_units)
    {
        UnitVector &uv=*(i->second);
        sort(uv.begin(),uv.end(),cmp);
    }
    FOR_EACH(PackageToVersions::iterator,i,needed_feature_versions)
    {
        VersionVector &vv=*(i->second);
        sort(vv.begin(),vv.end());
    }

    ///  features
    encode_provides();

    // Package dependencies
    FOR_EACH(PackageUnits::const_iterator,i,needed_units)
    {
        CONSTANT UnitVector &uv = *(i->second);
        FOR_EACH(UnitVector::const_iterator,vi,uv)
        {
            CONSTANT InstallableUnit *unit = *vi;
            encode(unit);
        }
    }

    // Install
    OUT ( cerr << "install [" <<endl;  )
    FOR_EACH (PackageVersionsSet::const_iterator,i,install)
    {
        LiteralVector literals;
        request_to_clause(*i,literals);
        solver.output_clause(literals);
        if (opt_not_removed && !is_feature(i->name())) not_removed.add(i->name());
    }
    OUT ( cerr << "]" <<endl;  )
    // upgrade
    encode_upgrade ();
    // Remove
    encode_request_remove ();
    // preference
    encode_lexicographic();
    if (opt_not_removed) assert_not_removed();
    //interval variables
    process_interval_variables();
}

Generated by  Doxygen 1.6.0   Back to index