Commits

Anonymous committed f60b6c5

EventCounter.cxx Sequencer.cxx
Changes for Gaudi Release 4 and improved comments etc.

David Quarrie

Comments (0)

Files changed (2)

src/EventCounter.cxx

 static const AlgFactory<EventCounter>    Factory;
 const IAlgFactory& EventCounterFactory = Factory;
 
+/**
+ ** Constructor(s)
+ **/
 EventCounter::EventCounter(const std::string& name, ISvcLocator* pSvcLocator) :
   Algorithm(name, pSvcLocator),
   m_skip ( 0 ),
     m_frequency.setBounds( 0, 1000 );
 }
 
+/**
+ ** Destructor
+ **/
 EventCounter::~EventCounter( )
 {
 }

src/Sequencer.cxx

-//$Header: /build/atlas/cvs/atlas/offline/Control/GaudiSequencer/src/Sequencer.cxx,v 1.1 2000-05-02 18:27:23 calaf Exp $
+//$Header: /build/atlas/cvs/atlas/offline/Control/GaudiSequencer/src/Sequencer.cxx,v 1.2 2000-06-02 08:24:01 dquarrie Exp $
 
 // Sequencer class
 // Implements:
 static const AlgFactory<Sequencer>    Factory;
 const IAlgFactory& SequencerFactory = Factory;
 
-// Constructor
-GaudiDllCall
+/**
+ ** Constructor(s)
+ **/
 Sequencer::Sequencer( const std::string& name, ISvcLocator* pSvcLocator )
 : Algorithm( name, pSvcLocator )
 {
     declareProperty( "StopOverride", m_stopOverride=false );
 }
 
-// Default Destructor
-GaudiDllCall
+/**
+ ** Destructor
+ **/
 Sequencer::~Sequencer()
 {
 }
 
-GaudiDllCall StatusCode
+StatusCode
 Sequencer::initialize()
 {
     StatusCode result = StatusCode::SUCCESS;
     if ( result.isSuccess( ) ) {
 
         // Build the list of member algorithms from the "Members" property
-        std::vector<std::string>::iterator it;
-        for (it = m_Names.begin(); it != m_Names.end(); it++) {
+        std::vector<std::string>::const_iterator it;
+        std::vector<std::string>::const_iterator itend = m_Names.end( );
+        for (it = m_Names.begin(); it != itend; it++) {
 
             // Parse the name for a syntax of the form:
             //
             } else {
 
                 // The specified name doesn't exist - create a new object of the specified type
-                // and append  it to the membership list.
+                // and append it to the membership list.
                 status = createAndAppend( theType, theName, theAlgorithm );
                 if ( status.isSuccess( ) ) {
                     log << MSG::INFO << theName << " doesn't exist - created and appended to member list" << endreq;
     return result;
 }
 
-GaudiDllCall StatusCode
+StatusCode
 Sequencer::execute()
 {
     StatusCode result = StatusCode::SUCCESS;
     StatusCode status;
     MsgStream log( messageService( ), name( ) );
 
-    log << MSG::INFO << name( ) << " Sequencer::execute( )" << endreq;
+    log << MSG::DEBUG << name( ) << " Sequencer::execute( )" << endreq;
 
     // Bypass the loop if this sequencer is disabled or has already been executed
     if ( isEnabled( ) && ! isExecuted( ) ) {
         // are (a) not disabled, and (b) aren't already executed. Note that
         // in the latter case the filter state is still examined. Terminate
         // the loop if an algorithm indicates that it's filter didn't pass.
+        std::vector<Algorithm*>* subAlgms = subAlgorithms( );
         std::vector<Algorithm*>::iterator it;
-        std::vector<Algorithm*>* subAlgms = subAlgorithms( );
-        for (it = subAlgms->begin(); it != subAlgms->end(); it++) {
+        std::vector<Algorithm*>::iterator itend = subAlgms->end( );
+        for (it = subAlgms->begin(); it != itend; it++) {
             Algorithm* theAlgorithm = (*it);
             if ( theAlgorithm->isEnabled( ) ) {
                 if ( ! theAlgorithm->isExecuted( ) ) {
     return result;
 }
 
-GaudiDllCall StatusCode
+StatusCode
 Sequencer::finalize()
 {
     return StatusCode::SUCCESS;
 }
 
-GaudiDllCall StatusCode
+StatusCode
 Sequencer::reset( )
 {
     Algorithm::reset( );
 
     // Loop over all algorithms calling their reset functions if they
-    //are not disabled.
+    // are not disabled.
+    std::vector<Algorithm*>* subAlgms = subAlgorithms( );
     std::vector<Algorithm*>::iterator it;
-    std::vector<Algorithm*>* subAlgms = subAlgorithms( );
-    for (it = subAlgms->begin(); it != subAlgms->end(); it++) {
+    std::vector<Algorithm*>::iterator itend = subAlgms->end( );
+    for (it = subAlgms->begin(); it != itend; it++) {
         Algorithm* theAlgorithm = (*it);
         theAlgorithm->reset( );
     }
     return StatusCode::SUCCESS;
 }
 
-GaudiDllCall StatusCode
+StatusCode
 Sequencer::append( Algorithm* pAlgorithm )
 {
     StatusCode result = StatusCode::SUCCESS;
 
-    // Check that the specified algorithm doesn't already exist in the path
+    // Check that the specified algorithm doesn't already exist in the membership list
+    std::vector<Algorithm*>* subAlgms = subAlgorithms( );
     std::vector<Algorithm*>::iterator it;
-    std::vector<Algorithm*>* subAlgms = subAlgorithms( );
-    for (it = subAlgms->begin(); it != subAlgms->end(); it++) {
+    std::vector<Algorithm*>::iterator itend = subAlgms->end( );
+    for (it = subAlgms->begin(); it != itend; it++) {
         Algorithm* theAlgorithm = (*it);
         if ( theAlgorithm == pAlgorithm ) {
             result = StatusCode::FAILURE;
     return result;
 }
 
-GaudiDllCall StatusCode
+StatusCode
 Sequencer::createAndAppend( const std::string& type,
                             const std::string& name,
 				            Algorithm*& pAlgorithm )
     return result;
 }
 
-GaudiDllCall StatusCode
+StatusCode
 Sequencer::remove( Algorithm* pAlgorithm )
 {
-    StatusCode result = StatusCode::SUCCESS;
-    // Test that the algorithm exists in the path
-
-    if ( StatusCode::SUCCESS == result ) {
-        // Remove the algorithm from the path
-		//// m_Algorithms->push_back( pAlgorithm );
-	}	
+    std::string theName = pAlgorithm->name( );
+    StatusCode result = remove( theName );
     return result;
 }
 
-GaudiDllCall StatusCode
+StatusCode
 Sequencer::remove( const std::string& name )
 {
-    StatusCode result = StatusCode::SUCCESS;
-    // Test that the algorithm exists in the path
+    StatusCode result = StatusCode::FAILURE;
 
-    Algorithm* pAlgorithm;
+    // Test that the algorithm exists in the member list
+    std::vector<Algorithm*>* subAlgms = subAlgorithms( );
+    std::vector<Algorithm*>::iterator it;
+    std::vector<Algorithm*>::iterator itend = subAlgms->end( );
+    for (it = subAlgms->begin(); it != itend; it++) {
+        Algorithm* theAlgorithm = (*it);
+        if ( theAlgorithm->name( ) == name ) {
 
-    if ( StatusCode::SUCCESS == result ) {
-        // Remove the algorithm from the path
-		//// m_Algorithms->push_back( pAlgorithm );
-	}	
+            // Algorithm with specified name exists in the algorithm list - remove it
+            // THIS ISN'T IMPLEMENTED YET!!!!
+            result = StatusCode::SUCCESS;
+            break;
+        }
+    }
     return result;
 }