summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/examples/FaultTolerance/FLARe/DeCoRAM/src/FTRMFF_Bestfit.h
blob: 15ac9a93051d79574aec8b641cea6f78cc6355e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// -*- C++ -*-

//=============================================================================
/**
 *  @file     FTRMFF_Bestfit.h
 *
 *  $Id$
 *
 *  @author  Friedhelm Wolf (fwolf@dre.vanderbilt.edu)
 */
//=============================================================================

#ifndef FTRMFF_BEST_FIT_ALGORITHM_H_
#define FTRMFF_BEST_FIT_ALGORITHM_H_

#include "Forward_Ranking_Scheduler.h"

class FTRMFF_Bestfit : public FTRMFF_Algorithm
{
public:
  virtual ~FTRMFF_Bestfit ();

  virtual FTRMFF_Output operator () (const FTRMFF_Input & input);
};

typedef std::map <Processor, ScheduleResult> RESULT_MAP;

class FTRMFF_Bestfit_Algorithm : 
  public std::unary_function <TASK_LIST,
                              SCHEDULING_MAP>
{
public:
  FTRMFF_Bestfit_Algorithm (const PROCESSOR_LIST & processors,
                            unsigned int consistency_level);

  virtual ~FTRMFF_Bestfit_Algorithm ();

  virtual SCHEDULING_MAP operator () (const TASK_LIST & tasks);

  SCHEDULE_PROGRESS_LIST get_unschedulable ();

  const SCHEDULE & schedule () const;

private:
  PROCESSOR_LIST best_processors (void);

private:
  SCHEDULE_PROGRESS_LIST unschedulable_;
  RESULT_MAP last_results_;
  unsigned int consistency_level_;
  Forward_Ranking_Scheduler scheduler_;
};

#endif /* FTRMFF_BEST_FIT_ALGORITHM_H_ */