All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Sequencer.h
Go to the documentation of this file.
1 // $Header: /tmp/svngaudi/tmp.jEpFh25751/Gaudi/GaudiAlg/GaudiAlg/Sequencer.h,v 1.4 2008/06/02 14:22:04 marcocle Exp $
2 #ifndef ALGORITHM_SEQUENCER_H
3 #define ALGORITHM_SEQUENCER_H
4 
5 // Include files
7 #include "GaudiKernel/Property.h"
8 
9 class MsgStream;
10 
24 class GAUDI_API Sequencer: public Algorithm {
25  public:
26 
30  Sequencer( const std::string& name, // The path object's name
31  ISvcLocator* svcloc // A pointer to a service location service
32  );
33 
37  virtual ~Sequencer( );
38 
39  /*****************************
40  ** Public Function Members **
41  *****************************/
42 
49  virtual StatusCode initialize( );
50 
54  virtual StatusCode reinitialize( );
55 
59  virtual StatusCode start( );
60 
65  virtual StatusCode execute( );
66 
70  virtual StatusCode stop( );
71 
75  virtual StatusCode finalize( );
76 
80  virtual StatusCode beginRun( );
81 
85  virtual StatusCode endRun( );
86 
90  void resetExecuted( );
91 
95  virtual bool branchFilterPassed( ) const;
96 
100  virtual StatusCode setBranchFilterPassed( bool state );
101 
105  virtual bool isStopOverride( ) const;
106 
110  StatusCode append( Algorithm* pAlgorithm );
111 
115  StatusCode appendToBranch( Algorithm* pAlgorithm );
116 
126  StatusCode createAndAppend(
127  const std::string& type, // The concrete algorithm class of the algorithm
128  const std::string& name, // The name to be given to the algorithm
129  Algorithm*& pAlgorithm // Set to point to the newly created algorithm object
130  );
131 
141  StatusCode createAndAppendToBranch(
142  const std::string& type, // The concrete algorithm class of the algorithm
143  const std::string& name, // The name to be given to the algorithm
144  Algorithm*& pAlgorithm // Set to point to the newly created algorithm object
145  );
146 
150  StatusCode remove( Algorithm* pAlgorithm );
151  StatusCode remove( const std::string& name );
152  StatusCode removeFromBranch( Algorithm* pAlgorithm );
153  StatusCode removeFromBranch( const std::string& name );
154 
161  std::vector<Algorithm*>* branchAlgorithms( ) const;
162 
164  StatusCode decodeMemberNames( );
165 
167  void membershipHandler( Property& theProp );
168 
170  StatusCode decodeBranchMemberNames( );
171 
173  void branchMembershipHandler( Property& theProp );
174 
175 protected:
176 
180  StatusCode append( Algorithm* pAlgorithm,
181  std::vector<Algorithm*>* theAlgs );
182 
192  StatusCode createAndAppend(
193  const std::string& type, // The concrete algorithm class of the algorithm
194  const std::string& name, // The name to be given to the algorithm
195  Algorithm*& pAlgorithm, // Set to point to the newly created algorithm object
196  std::vector<Algorithm*>* theAlgs
197  );
198 
202  StatusCode decodeNames( StringArrayProperty& theNames,
203  std::vector<Algorithm*>* theAlgs,
204  std::vector<bool>& theLogic );
205 
209  StatusCode execute( std::vector<Algorithm*>* theAlgs,
210  std::vector<bool>& theLogic,
211  Algorithm*& lastAlgorithm, unsigned int first = 0 );
212 
216  StatusCode executeMember( Algorithm* theAlgorithm );
217 
222  StatusCode remove( const std::string& algname, std::vector<Algorithm*>* theAlgs );
223 
224 private:
225 
226  /******************************
227  ** Private Function Members **
228  ******************************/
229 
233  Sequencer( const Sequencer& a );
234 
238  Sequencer& operator=( const Sequencer& rhs );
239 
240  /**************************
241  ** Private Data Members **
242  **************************/
243 
244  StringArrayProperty m_names; // Member names
245  std::vector<bool> m_isInverted; // Member logic inverted list
246  StringArrayProperty m_branchNames; // Branch Member names
247  std::vector<Algorithm*>* m_branchAlgs; // Branch algorithms
248  std::vector<bool> m_isBranchInverted; // Branch Member logic inverted list
249  BooleanProperty m_stopOverride; // Stop on filter failure Override flag
250  bool m_branchFilterPassed; // Branch filter passed flag
251 };
252 
253 #endif //ALGORITHM_SEQUENCER_H
254 
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:26
virtual StatusCode start()
the default (empty) implementation of IStateful::start() method
Definition: Algorithm.h:159
virtual StatusCode execute()=0
The action to be performed by the algorithm on an event.
bool m_branchFilterPassed
Definition: Sequencer.h:250
BooleanProperty m_stopOverride
Definition: Sequencer.h:249
virtual StatusCode beginRun()
Algorithm begin run.
Definition: Algorithm.cpp:497
StringArrayProperty m_branchNames
Definition: Sequencer.h:246
virtual StatusCode reinitialize()
the default (empty) implementation of IStateful::reinitialize() method
Definition: Algorithm.cpp:798
virtual StatusCode endRun()
Algorithm end run. This method is called at the end of the event loop.
Definition: Algorithm.cpp:573
virtual StatusCode stop()
the default (empty) implementation of IStateful::stop() method
Definition: Algorithm.h:161
virtual void resetExecuted()
Reset the executed state of the Algorithm for the duration of the current event.
Definition: Algorithm.cpp:853
string type
Definition: gaudirun.py:126
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
Algorithm & operator=(const Algorithm &rhs)
Private assignment operator: NO ASSIGNMENT ALLOWED.
virtual const std::string & name() const
The identifying name of the algorithm object.
Definition: Algorithm.cpp:837
std::vector< Algorithm * > * m_branchAlgs
Definition: Sequencer.h:247
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:61
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:43
std::vector< bool > m_isInverted
Definition: Sequencer.h:245
StringArrayProperty m_names
Definition: Sequencer.h:244
virtual StatusCode initialize()
the default (empty) implementation of IStateful::initialize() method
Definition: Algorithm.h:157
virtual StatusCode finalize()
the default (empty) implementation of IStateful::finalize() method
Definition: Algorithm.h:163
ClassName: Sequencer.
Definition: Sequencer.h:24
#define GAUDI_API
Definition: Kernel.h:108
std::vector< bool > m_isBranchInverted
Definition: Sequencer.h:248