Sequencer.h
Go to the documentation of this file.
1 #ifndef ALGORITHM_SEQUENCER_H
2 #define ALGORITHM_SEQUENCER_H
3 
4 // Include files
5 #include "GaudiKernel/Algorithm.h"
6 #include "GaudiKernel/Property.h"
7 
8 class MsgStream;
9 
23 class GAUDI_API Sequencer: public Algorithm {
24  public:
25 
29  Sequencer( const std::string& name, // The path object's name
30  ISvcLocator* svcloc // A pointer to a service location service
31  );
32 
36  ~Sequencer( ) override = default;
37 
38  /*****************************
39  ** Public Function Members **
40  *****************************/
41 
48  StatusCode initialize( ) override;
49 
53  StatusCode reinitialize( ) override;
54 
58  StatusCode start( ) override;
59 
64  StatusCode execute( ) override;
65 
69  StatusCode stop( ) override;
70 
74  StatusCode finalize( ) override;
75 
79  StatusCode beginRun( ) override;
80 
84  StatusCode endRun( ) override;
85 
89  void resetExecuted( ) override;
90 
91 
99  virtual bool branchFilterPassed( ) const;
100 
104  virtual StatusCode setBranchFilterPassed( bool state );
105 
109  virtual bool isStopOverride( ) const;
110 
114  StatusCode append( Algorithm* pAlgorithm );
115 
119  StatusCode appendToBranch( Algorithm* pAlgorithm );
120 
130  StatusCode createAndAppend(
131  const std::string& type, // The concrete algorithm class of the algorithm
132  const std::string& name, // The name to be given to the algorithm
133  Algorithm*& pAlgorithm // Set to point to the newly created algorithm object
134  );
135 
145  StatusCode createAndAppendToBranch(
146  const std::string& type, // The concrete algorithm class of the algorithm
147  const std::string& name, // The name to be given to the algorithm
148  Algorithm*& pAlgorithm // Set to point to the newly created algorithm object
149  );
150 
154  StatusCode remove( Algorithm* pAlgorithm );
155  StatusCode remove( const std::string& name );
156  StatusCode removeFromBranch( Algorithm* pAlgorithm );
157  StatusCode removeFromBranch( const std::string& name );
158 
165  const std::vector<Algorithm*>& branchAlgorithms( ) const;
166  std::vector<Algorithm*>& branchAlgorithms( );
167 
169  StatusCode decodeMemberNames( );
170 
172  void membershipHandler( Property& theProp );
173 
175  StatusCode decodeBranchMemberNames( );
176 
178  void branchMembershipHandler( Property& theProp );
179 
180 protected:
181 
185  StatusCode append( Algorithm* pAlgorithm,
186  std::vector<Algorithm*>& theAlgs );
187 
197  StatusCode createAndAppend(
198  const std::string& type, // The concrete algorithm class of the algorithm
199  const std::string& name, // The name to be given to the algorithm
200  Algorithm*& pAlgorithm, // Set to point to the newly created algorithm object
201  std::vector<Algorithm*>& theAlgs
202  );
203 
207  StatusCode decodeNames( StringArrayProperty& theNames,
208  std::vector<Algorithm*>& theAlgs,
209  std::vector<bool>& theLogic );
210 
214  StatusCode execute( const std::vector<Algorithm*>& theAlgs,
215  std::vector<bool>& theLogic,
216  Algorithm*& lastAlgorithm, unsigned int first = 0 );
217 
221  StatusCode executeMember( Algorithm* theAlgorithm );
222 
227  StatusCode remove( const std::string& algname, std::vector<Algorithm*>& theAlgs );
228 
229  // NO COPY / ASSIGNMENT ALLOWED
230  Sequencer( const Sequencer& a ) = delete;
231  Sequencer& operator=( const Sequencer& rhs ) = delete;
232 
233 private:
234 
235  /**************************
236  ** Private Data Members **
237  **************************/
238 
239  StringArrayProperty m_names; // Member names
240  std::vector<bool> m_isInverted; // Member logic inverted list
241  StringArrayProperty m_branchNames; // Branch Member names
242  std::vector<Algorithm*> m_branchAlgs; // Branch algorithms
243  std::vector<bool> m_isBranchInverted; // Branch Member logic inverted list
244  BooleanProperty m_stopOverride; // Stop on filter failure Override flag
245  bool m_branchFilterPassed = false; // Branch filter passed flag
246 };
247 
248 #endif //ALGORITHM_SEQUENCER_H
249 
StatusCode endRun() override
Algorithm end run. This method is called at the end of the event loop.
Definition: Algorithm.cpp:647
void resetExecuted() override
Reset the executed state of the Algorithm for the duration of the current event.
Definition: Algorithm.cpp:939
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
#define GAUDI_API
Definition: Kernel.h:107
StatusCode finalize() override
the default (empty) implementation of IStateful::finalize() method
Definition: Algorithm.h:186
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Algorithm & operator=(const Algorithm &rhs)
Private assignment operator: NO ASSIGNMENT ALLOWED.
StatusCode beginRun() override
Algorithm begin run.
Definition: Algorithm.cpp:576
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:77
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
Definition: Algorithm.h:180
StatusCode start() override
the default (empty) implementation of IStateful::start() method
Definition: Algorithm.h:182
StatusCode stop() override
the default (empty) implementation of IStateful::stop() method
Definition: Algorithm.h:184
ClassName: Sequencer.
Definition: Sequencer.h:23
StatusCode reinitialize() override
the default (empty) implementation of IStateful::reinitialize() method
Definition: Algorithm.cpp:880
string type
Definition: gaudirun.py:151