| # Gaudi Framework, version v23r1 |

Home |  | Generated: Wed Feb 29 2012

# SequencerTimerTool.h

Go to the documentation of this file.

    00001 // $Id: SequencerTimerTool.h,v 1.7 2005/07/29 16:49:43 hmd Exp $
    00002 #ifndef SEQUENCERTIMERTOOL_H
    00003 #define SEQUENCERTIMERTOOL_H 1
    00004
    00005 // Include files
    00006 // from Gaudi
    00007 #include "GaudiAlg/GaudiTool.h"
    00008 #include "GaudiAlg/ISequencerTimerTool.h"
    00009
    00010 // local
    00011 #include "TimerForSequencer.h"
    00012
    00013
    00027 class SequencerTimerTool : public GaudiTool, virtual public ISequencerTimerTool{
    00028 public:
    00029
    00031   SequencerTimerTool( const std::string& type,
    00032                       const std::string& name,
    00033                       const IInterface* parent);
    00034
    00035   virtual ~SequencerTimerTool( );
    00036
    00038   virtual StatusCode initialize();
    00039
    00041   virtual StatusCode finalize();
    00042
    00044   virtual int addTimer( std::string name ) {
    00045     std::string myName;
    00046     if ( 0 < m_indent ) {
    00047       std::string prefix( m_indent, ' ' );
    00048       myName += prefix;
    00049     }
    00050     std::string space( m_headerSize, ' ' );
    00051     myName += name + space ;
    00052     myName = myName.substr( 0, m_headerSize );
    00053
    00054     m_timerList.push_back( TimerForSequencer(myName, m_normFactor) );
    00055     return m_timerList.size() -1;
    00056   };
    00057
    00059   virtual void increaseIndent()    { m_indent += 2; };
    00060
    00062   virtual void decreaseIndent()    {
    00063     m_indent -= 2;
    00064     if ( 0 > m_indent ) m_indent = 0;
    00065   };
    00066
    00067   using ISequencerTimerTool::start;
    00069   void start( int index )  {   m_timerList[index].start();  };
    00070
    00071   using ISequencerTimerTool::stop;
    00073   double stop( int index )  {   return m_timerList[index].stop();  };
    00074
    00076   double lastTime( int index )  {   return m_timerList[index].lastTime();  };
    00077
    00078   using ISequencerTimerTool::name;
    00080   std::string name( int index )  {   return m_timerList[index].name();  };
    00081
    00083   int indexByName( std::string name );
    00084
    00086   virtual bool globalTiming() { return m_globalTiming; };
    00087
    00088 protected:
    00089
    00090 private:
    00091   int m_shots;
    00092   bool m_normalised;
    00093   int m_indent;
    00094   std::vector<TimerForSequencer> m_timerList;
    00095   double m_normFactor;
    00096   double m_speedRatio;
    00097   bool   m_globalTiming;
    00098   std::string::size_type m_headerSize;
    00099 };
    00100 #endif // SEQUENCERTIMERTOOL_H

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines