Main Page Class Hierarchy Compound List File List Compound Members File Members

# VersionSelector Class Reference

Version selectors provide the mechanism for comparing two Use objects and decide which one has to be kept WRT their version id . More...

Inheritance diagram for VersionSelector

[legend]
List of all members.

## Public Methods
virtual Use* | operate (Use* ref_use, Use* new_use)
## Static Public Methods
VersionSelector& | instance ()

## Detailed Description

Version selectors provide the mechanism for comparing two Use objects and decide which one has to be kept WRT their version id .

Each strategy is implemented as a separate class (which overrides the operate method)

Definition at line 97 of file cmt_use.cxx.

## Member Function Documentation

VersionSelector & VersionSelector::instance ( | )`[static]`

| Definition at line 2318 of file cmt_use.cxx. Referenced by Use::add().
    02319 {
    02320   static BestFitSelector best_fit;
    02321   static BestFitNoCheckSelector best_fit_no_check;
    02322   static FirstChoiceSelector first_choice;
    02323   static LastChoiceSelector last_choice;
    02324   static KeepAllSelector keep_all;
    02325
    02326   switch (Cmt::get_current_strategy ())
    02327     {
    02328     case BestFit:
    02329       return (best_fit);
    02330     case BestFitNoCheck:
    02331       return (best_fit_no_check);
    02332     case FirstChoice:
    02333       return (first_choice);
    02334     case LastChoice:
    02335       return (last_choice);
    02336     case KeepAll:
    02337       return (keep_all);
    02338     default:
    02339       return (best_fit);
    02340     }
    02341 }

Use * VersionSelector::operate ( | Use * ref_use,
| Use * new_use )`[inline, virtual]`

| Reimplemented in BestFitSelector, BestFitNoCheckSelector, FirstChoiceSelector, LastChoiceSelector, and KeepAllSelector. Definition at line 102 of file cmt_use.cxx. Referenced by Use::add().
    00103   {
    00104     return (ref_use);
    00105   }

The documentation for this class was generated from the following file:

- cmt_use.cxx