Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 10:00:30

0001 /***********************************************************************************\
0002 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
0003 *                                                                                   *
0004 * This software is distributed under the terms of the Apache version 2 licence,     *
0005 * copied verbatim in the file "LICENSE".                                            *
0006 *                                                                                   *
0007 * In applying this licence, CERN does not waive the privileges and immunities       *
0008 * granted to it by virtue of its status as an Intergovernmental Organization        *
0009 * or submit itself to any jurisdiction.                                             *
0010 \***********************************************************************************/
0011 #ifndef GAUDIKERNEL_ICHRONOSVC_H
0012 #define GAUDIKERNEL_ICHRONOSVC_H 1
0013 // ============================================================================
0014 // Include files
0015 // ============================================================================
0016 // STD&STL
0017 // ============================================================================
0018 #include <string>
0019 // ============================================================================
0020 // GaudiKernel
0021 // ============================================================================
0022 #include "GaudiKernel/IInterface.h"
0023 // ============================================================================
0024 // forward declaration
0025 // ============================================================================
0026 class ChronoEntity;
0027 // ============================================================================
0028 /** @class IChronoSvc IChronoSvc.h GaudiKernel/IChronoSvc.h
0029  *  "Chrono"-related part of interface IChronoStatSvc
0030  *
0031  *  The IChronoSvc is the interface implemented by the ChronoStatService.
0032  *  This interface is used by any algorithm or services wanting to study
0033  *  its own performance and CPU consumption and some statistical computation
0034  *
0035  *  @author Vanya BELYAEV ibelyaev@physics.syr.edu
0036  *         (inspired by Mauro VILLA's codes used within ARTE framework )
0037  *
0038  *  @date December 1, 1999
0039  *  @date 2007-07-08
0040  */
0041 class GAUDI_API IChronoSvc : virtual public IInterface {
0042 public:
0043   /// InterfaceID
0044   DeclareInterfaceID( IChronoSvc, 3, 0 );
0045   // ==========================================================================
0046   /// the actual type of identifier for Chrono objects
0047   typedef std::string ChronoTag;
0048   /// Type of the delta-time
0049   typedef double ChronoTime;
0050   // ==========================================================================
0051 public:
0052   // ==========================================================================
0053   // status of Chrono objects
0054   enum ChronoStatus { UNKNOWN = 0, RUNNING, STOPPED };
0055   // types of Chrono objects
0056   enum ChronoType { USER = 0, KERNEL, ELAPSED };
0057   // ==========================================================================
0058 public:
0059   // ==========================================================================
0060   /**    start   chrono, tagged by its name
0061    *     @param t chrono tag (name)
0062    *     @return chrono object
0063    */
0064   virtual ChronoEntity* chronoStart( const ChronoTag& t ) = 0;
0065   // ==========================================================================
0066   /**    stop    chrono, tagged by its name
0067    *     @param t chrono tag (name)
0068    *     @return status code
0069    */
0070   virtual const ChronoEntity* chronoStop( const ChronoTag& t ) = 0;
0071   // ==========================================================================
0072   /**    return chrono delta time of last start/stop pair
0073    *     @param t chrono tag (name)
0074    *     @param f chtono type
0075    *     @return delta time
0076    */
0077   virtual ChronoTime chronoDelta( const ChronoTag& t, ChronoType f ) = 0;
0078   // ==========================================================================
0079   /**    prints (using message service)  info about chrono, tagged by its name
0080    *     @param t chrono tag (name)
0081    *     @return status code
0082    */
0083   virtual void chronoPrint( const ChronoTag& t ) = 0;
0084   // ==========================================================================
0085   /**    return the status of named chrono
0086    *     @param t chrono tag (name)
0087    *     @return chrono status
0088    */
0089   virtual ChronoStatus chronoStatus( const ChronoTag& t ) = 0;
0090   // ==========================================================================
0091   /** extract the chrono entity for the given tag (name)
0092    *  @param t chrono tag(name)
0093    *  @return pointer to chrono entity
0094    */
0095   virtual const ChronoEntity* chrono( const ChronoTag& t ) const = 0;
0096   // ==========================================================================
0097 };
0098 // ============================================================================
0099 // The END
0100 // ============================================================================
0101 #endif // GAUDIKERNEL_ICHRONOSVC_H