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
00055 virtual StatusCode execute( );
00056
00060 virtual StatusCode finalize( );
00061
00065 StatusCode resetExecuted( );
00066
00070 virtual bool branchFilterPassed( ) const;
00071
00075 virtual StatusCode setBranchFilterPassed( bool state );
00076
00080 virtual bool isStopOverride( ) const;
00081
00085 StatusCode append( Algorithm* pAlgorithm );
00086
00090 StatusCode appendToBranch( Algorithm* pAlgorithm );
00091
00101 StatusCode createAndAppend(
00102 const std::string& type,
00103 const std::string& name,
00104 Algorithm*& pAlgorithm
00105 );
00106
00116 StatusCode createAndAppendToBranch(
00117 const std::string& type,
00118 const std::string& name,
00119 Algorithm*& pAlgorithm
00120 );
00121
00125 StatusCode remove( Algorithm* pAlgorithm );
00126 StatusCode remove( const std::string& name );
00127 StatusCode removeFromBranch( Algorithm* pAlgorithm );
00128 StatusCode removeFromBranch( const std::string& name );
00129
00136 std::vector<Algorithm*>* branchAlgorithms( ) const;
00137
00139 StatusCode decodeMemberNames( );
00140
00142 void membershipHandler( Property& theProp );
00143
00145 StatusCode decodeBranchMemberNames( );
00146
00148 void branchMembershipHandler( Property& theProp );
00149
00150 protected:
00151
00155 StatusCode append( Algorithm* pAlgorithm,
00156 std::vector<Algorithm*>* theAlgs );
00157
00167 StatusCode createAndAppend(
00168 const std::string& type,
00169 const std::string& name,
00170 Algorithm*& pAlgorithm,
00171 std::vector<Algorithm*>* theAlgs
00172 );
00173
00177 StatusCode decodeNames( StringArrayProperty& theNames,
00178 std::vector<Algorithm*>* theAlgs,
00179 std::vector<bool>& theLogic );
00180
00184 StatusCode execute( std::vector<Algorithm*>* theAlgs,
00185 std::vector<bool>& theLogic,
00186 Algorithm*& lastAlgorithm, unsigned int first = 0 );
00187
00191 StatusCode executeMember( Algorithm* theAlgorithm );
00192
00197 StatusCode remove( const std::string& algname, std::vector<Algorithm*>* theAlgs );
00198
00199 private:
00200
00201
00202
00203
00204
00208 Sequencer( const Sequencer& a );
00209
00213 Sequencer& operator=( const Sequencer& rhs );
00214
00215
00216
00217
00218
00219 StringArrayProperty m_names;
00220 std::vector<bool> m_isInverted;
00221 StringArrayProperty m_branchNames;
00222 std::vector<Algorithm*>* m_branchAlgs;
00223 std::vector<bool> m_isBranchInverted;
00224 BooleanProperty m_stopOverride;
00225 bool m_branchFilterPassed;
00226 };
00227
00228 #endif //ALGORITHM_SEQUENCER_H
00229