The Gaudi Framework  v30r3 (a5ef0a68)
Sequencer.h
Go to the documentation of this file.
1 #ifndef ALGORITHM_SEQUENCER_H
2 #define ALGORITHM_SEQUENCER_H
3 
4 // Include files
6 #include "GaudiKernel/Property.h"
7 
8 class MsgStream;
9 
24 {
25 public:
29  Sequencer( const std::string& name, // The path object's name
30  ISvcLocator* svcloc // A pointer to a service location service
31  );
32 
33  /*****************************
34  ** Public Function Members **
35  *****************************/
36 
43  StatusCode initialize() override;
44 
48  StatusCode reinitialize() override;
49 
53  StatusCode start() override;
54 
59  StatusCode execute() override;
60 
64  StatusCode stop() override;
65 
69  StatusCode finalize() override;
70 
74  void resetExecuted() override;
75 
83  bool isSequence() const override final { return true; }
84 
88  virtual bool branchFilterPassed() const;
89 
93  virtual StatusCode setBranchFilterPassed( bool state );
94 
98  virtual bool isStopOverride() const;
99 
103  StatusCode append( Algorithm* pAlgorithm );
104 
108  StatusCode appendToBranch( Algorithm* pAlgorithm );
109 
119  StatusCode createAndAppend( const std::string& type, // The concrete algorithm class of the algorithm
120  const std::string& name, // The name to be given to the algorithm
121  Algorithm*& pAlgorithm // Set to point to the newly created algorithm object
122  );
123 
133  StatusCode createAndAppendToBranch( const std::string& type, // The concrete algorithm class of the algorithm
134  const std::string& name, // The name to be given to the algorithm
135  Algorithm*& pAlgorithm // Set to point to the newly created algorithm object
136  );
137 
141  StatusCode remove( Algorithm* pAlgorithm );
142  StatusCode remove( const std::string& name );
143  StatusCode removeFromBranch( Algorithm* pAlgorithm );
144  StatusCode removeFromBranch( const std::string& name );
145 
152  const std::vector<Algorithm*>& branchAlgorithms() const;
153  std::vector<Algorithm*>& branchAlgorithms();
154 
156  StatusCode decodeMemberNames();
157 
159  StatusCode decodeBranchMemberNames();
160 
161 protected:
165  StatusCode append( Algorithm* pAlgorithm, std::vector<Algorithm*>& theAlgs );
166 
176  StatusCode createAndAppend( const std::string& type, // The concrete algorithm class of the algorithm
177  const std::string& name, // The name to be given to the algorithm
178  Algorithm*& pAlgorithm, // Set to point to the newly created algorithm object
179  std::vector<Algorithm*>& theAlgs );
180 
185  std::vector<bool>& theLogic );
186 
190  StatusCode execute( const std::vector<Algorithm*>& theAlgs, std::vector<bool>& theLogic, Algorithm*& lastAlgorithm,
191  unsigned int first = 0 );
192 
196  StatusCode executeMember( Algorithm* theAlgorithm );
197 
202  StatusCode remove( const std::string& algname, std::vector<Algorithm*>& theAlgs );
203 
204  // NO COPY / ASSIGNMENT ALLOWED
205  Sequencer( const Sequencer& a ) = delete;
206  Sequencer& operator=( const Sequencer& rhs ) = delete;
207 
208 public:
210  std::ostream& toControlFlowExpression( std::ostream& os ) const override;
211 
212 private:
213  /**************************
214  ** Private Data Members **
215  **************************/
216 
217  Gaudi::Property<std::vector<std::string>> m_names{this, "Members", {}, "member names"};
218  Gaudi::Property<std::vector<std::string>> m_branchNames{this, "BranchMembers", {}, "branch member names"};
219  Gaudi::Property<bool> m_stopOverride{this, "StopOverride", false, "stop on filter failure override"};
220 
221  std::vector<bool> m_isInverted; // Member logic inverted list
222  std::vector<Algorithm*> m_branchAlgs; // Branch algorithms
223  std::vector<bool> m_isBranchInverted; // Branch Member logic inverted list
224 
225  bool m_branchFilterPassed = false; // Branch filter passed flag
226 };
227 
228 #endif // ALGORITHM_SEQUENCER_H
void resetExecuted() override
Reset the executed state of the Algorithm for the duration of the current event.
Definition: Algorithm.cpp:785
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
bool isSequence() const override final
additional interface methods
Definition: Sequencer.h:83
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:765
Implementation of property with value of concrete type.
Definition: Property.h:381
std::ostream & toControlFlowExpression(std::ostream &os) const override
Produce string represention of the control flow expression.
Definition: Algorithm.cpp:997
StatusCode execute() override final
StatusCode finalize() override
the default (empty) implementation of IStateful::finalize() method
Definition: Algorithm.h:185
STL class.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:78
std::vector< Algorithm * > m_branchAlgs
Definition: Sequencer.h:222
std::vector< bool > m_isInverted
Definition: Sequencer.h:221
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
Definition: Algorithm.h:179
StatusCode start() override
the default (empty) implementation of IStateful::start() method
Definition: Algorithm.h:181
Algorithm & operator=(const Algorithm &rhs)=delete
Private assignment operator: NO ASSIGNMENT ALLOWED.
StatusCode stop() override
the default (empty) implementation of IStateful::stop() method
Definition: Algorithm.h:183
ClassName: Sequencer.
Definition: Sequencer.h:23
#define GAUDI_API
Definition: Kernel.h:104
StatusCode reinitialize() override
the default (empty) implementation of IStateful::reinitialize() method
Definition: Algorithm.cpp:728
STL class.
std::vector< bool > m_isBranchInverted
Definition: Sequencer.h:223