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

Inheritance graph
[legend]
List of all members.

Public Methods

virtual Useoperate (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 2139 of file cmt_use.cxx.

Referenced by Use::add().

02140 {
02141   static BestFitSelector best_fit;
02142   static BestFitNoCheckSelector best_fit_no_check;
02143   static FirstChoiceSelector first_choice;
02144   static LastChoiceSelector last_choice;
02145   static KeepAllSelector keep_all;
02146 
02147   switch (Cmt::get_current_strategy ())
02148     {
02149     case BestFit:
02150       return (best_fit);
02151     case BestFitNoCheck:
02152       return (best_fit_no_check);
02153     case FirstChoice:
02154       return (first_choice);
02155     case LastChoice:
02156       return (last_choice);
02157     case KeepAll:
02158       return (keep_all);
02159     default:
02160       return (best_fit);
02161     }
02162 }

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:
Generated at Thu May 16 16:28:03 2002 for CMT by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000