The Gaudi Framework  v30r1 (5d4f4ae2)
GaudiSequencer.h
Go to the documentation of this file.
1 #ifndef GAUDISEQUENCER_H
2 #define GAUDISEQUENCER_H 1
3 
4 // Include files
5 // from Gaudi
7 
8 // Forward declarations
10 
27 {
28 public:
30  GaudiSequencer( const std::string& name, ISvcLocator* pSvcLocator );
31 
32  StatusCode initialize() override;
33  StatusCode execute() override;
34 
35  StatusCode beginRun() override;
36  StatusCode endRun() override;
37 
38  bool isSequence() const override final { return true; }
39 
41  std::ostream& toControlFlowExpression( std::ostream& os ) const override;
42 
43 private:
44  class AlgorithmEntry final
45  {
46  public:
48  AlgorithmEntry( Algorithm* alg ) : m_algorithm( alg ) {}
49 
50  void setReverse( bool flag ) { m_reverse = flag; }
51 
52  Algorithm* algorithm() const { return m_algorithm; }
53  bool reverse() const { return m_reverse; }
54  void setTimer( int nb ) { m_timer = nb; }
55  int timer() const { return m_timer; }
56 
57  private:
58  Algorithm* m_algorithm = nullptr;
59  bool m_reverse = false;
60  int m_timer = 0;
61  };
62 
64  StatusCode decodeNames();
65 
67  void membershipHandler( Gaudi::Details::PropertyBase& theProp );
68 
70  GaudiSequencer( const GaudiSequencer& a ) = delete;
71  GaudiSequencer& operator=( const GaudiSequencer& a ) = delete;
72 
73  Gaudi::Property<std::vector<std::string>> m_names = {this, "Members", {}, "list of algorithms"};
74  Gaudi::Property<bool> m_sequential = {this, "Sequential", false, "execute members one at a time"};
75  Gaudi::Property<bool> m_modeOR = {this, "ModeOR", false, "use OR logic instead of AND"};
76  Gaudi::Property<bool> m_ignoreFilter = {this, "IgnoreFilterPassed", false, "always continue"};
77  Gaudi::Property<bool> m_measureTime = {this, "MeasureTime", false, "measure time"};
78  Gaudi::Property<bool> m_returnOK = {this, "ReturnOK", false, "forces the sequencer to return a good status"};
79  Gaudi::Property<bool> m_shortCircuit = {this, "ShortCircuit", true, "stop processing as soon as possible"};
80  Gaudi::Property<bool> m_invert = {this, "Invert", false, "invert the logic result of the sequencer"};
81 
83  ISequencerTimerTool* m_timerTool = nullptr;
84  int m_timer;
85 };
86 #endif // GAUDISEQUENCER_H
StatusCode endRun() override
Algorithm end run. This method is called at the end of the event loop.
Definition: Algorithm.cpp:506
bool isSequence() const override final
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
Implementation of property with value of concrete type.
Definition: Property.h:319
std::ostream & toControlFlowExpression(std::ostream &os) const override
Produce string represention of the control flow expression.
Definition: Algorithm.cpp:1002
StatusCode initialize() override
standard initialization method
Sequencer for executing several algorithms, stopping when one is faulty.
Header file for class GaudiAlgorithm.
void setReverse(bool flag)
Algorithm * algorithm() const
StatusCode execute() override
standard execution method
PropertyMgr & operator=(const PropertyMgr &)=delete
STL class.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode beginRun() override
Algorithm begin run.
Definition: Algorithm.cpp:458
The useful base class for data processing algorithms.
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:78
STL class.
Implements the time measurement inside a sequencer.
AlgorithmEntry(Algorithm *alg)
Standard constructor.
int timer() const
bool reverse() const
#define GAUDI_API
Definition: Kernel.h:110
STL class.
void setTimer(int nb)
int m_timer
Timer number for the sequencer.
std::vector< AlgorithmEntry > m_entries
List of algorithms to process.