00001
00002 #ifndef ALGORITHM_SEQUENCER_H
00003 #define ALGORITHM_SEQUENCER_H
00004
00005
00006 #include "GaudiKernel/Algorithm.h"
00007 #include "GaudiKernel/Property.h"
00008
00009 class MsgStream;
00010
00024 class Sequencer : public Algorithm {
00025 public:
00026
00030 Sequencer( const std::string& name,
00031 ISvcLocator* svcloc
00032 );
00033
00037 virtual ~Sequencer( );
00038
00039
00040
00041
00042
00049 virtual StatusCode initialize( );
00050
00054 virtual StatusCode reinitialize( );
00055
00059 virtual StatusCode start( );
00060
00065 virtual StatusCode execute( );
00066
00070 virtual StatusCode stop( );
00071
00075 virtual StatusCode finalize( );
00076
00080 virtual StatusCode beginRun( );
00081
00085 virtual StatusCode endRun( );
00086
00090 void resetExecuted( );
00091
00095 virtual bool branchFilterPassed( ) const;
00096
00100 virtual StatusCode setBranchFilterPassed( bool state );
00101
00105 virtual bool isStopOverride( ) const;
00106
00110 StatusCode append( Algorithm* pAlgorithm );
00111
00115 StatusCode appendToBranch( Algorithm* pAlgorithm );
00116
00126 StatusCode createAndAppend(
00127 const std::string& type,
00128 const std::string& name,
00129 Algorithm*& pAlgorithm
00130 );
00131
00141 StatusCode createAndAppendToBranch(
00142 const std::string& type,
00143 const std::string& name,
00144 Algorithm*& pAlgorithm
00145 );
00146
00150 StatusCode remove( Algorithm* pAlgorithm );
00151 StatusCode remove( const std::string& name );
00152 StatusCode removeFromBranch( Algorithm* pAlgorithm );
00153 StatusCode removeFromBranch( const std::string& name );
00154
00161 std::vector<Algorithm*>* branchAlgorithms( ) const;
00162
00164 StatusCode decodeMemberNames( );
00165
00167 void membershipHandler( Property& theProp );
00168
00170 StatusCode decodeBranchMemberNames( );
00171
00173 void branchMembershipHandler( Property& theProp );
00174
00175 protected:
00176
00180 StatusCode append( Algorithm* pAlgorithm,
00181 std::vector<Algorithm*>* theAlgs );
00182
00192 StatusCode createAndAppend(
00193 const std::string& type,
00194 const std::string& name,
00195 Algorithm*& pAlgorithm,
00196 std::vector<Algorithm*>* theAlgs
00197 );
00198
00202 StatusCode decodeNames( StringArrayProperty& theNames,
00203 std::vector<Algorithm*>* theAlgs,
00204 std::vector<bool>& theLogic );
00205
00209 StatusCode execute( std::vector<Algorithm*>* theAlgs,
00210 std::vector<bool>& theLogic,
00211 Algorithm*& lastAlgorithm, unsigned int first = 0 );
00212
00216 StatusCode executeMember( Algorithm* theAlgorithm );
00217
00222 StatusCode remove( const std::string& algname, std::vector<Algorithm*>* theAlgs );
00223
00224 private:
00225
00226
00227
00228
00229
00233 Sequencer( const Sequencer& a );
00234
00238 Sequencer& operator=( const Sequencer& rhs );
00239
00240
00241
00242
00243
00244 StringArrayProperty m_names;
00245 std::vector<bool> m_isInverted;
00246 StringArrayProperty m_branchNames;
00247 std::vector<Algorithm*>* m_branchAlgs;
00248 std::vector<bool> m_isBranchInverted;
00249 BooleanProperty m_stopOverride;
00250 bool m_branchFilterPassed;
00251 };
00252
00253 #endif //ALGORITHM_SEQUENCER_H
00254