Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:29:19

0001 #ifndef FWCore_Utilities_LuminosityBlockIndex_h
0002 #define FWCore_Utilities_LuminosityBlockIndex_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     FWCore/Utilities
0006 // Class  :     edm::LuminosityBlockIndex
0007 //
0008 /**\class edm::LuminosityBlockIndex LuminosityBlockIndex.h "FWCore/Utilities/interface/LuminosityBlockIndex.h"
0009 
0010  Description: Identifies a 'slot' being used to hold an active LuminosityBlock
0011 
0012  Usage:
0013  Various APIs used this to access per LuminosityBlock information.
0014  It is important to realize that the same LuminosityBockIndex may be used to refer
0015  to different LuminosityBlocks over the lifetime of a job. A LuminosityBlockIndex
0016  will only get a new LuminosityBlock after the previous LuminosityBlock using
0017  that index has finished being used.
0018 
0019 */
0020 //
0021 // Original Author:  Chris Jones
0022 //         Created:  Fri, 26 Apr 2013 19:39:10 GMT
0023 //
0024 
0025 // system include files
0026 
0027 // user include files
0028 
0029 // forward declarations
0030 namespace edm {
0031   class LuminosityBlockPrincipal;
0032 
0033   class LuminosityBlockIndex {
0034   public:
0035     LuminosityBlockIndex(const LuminosityBlockIndex&) = default;
0036     LuminosityBlockIndex() = delete;
0037     LuminosityBlockIndex& operator=(const LuminosityBlockIndex&) = default;
0038     ~LuminosityBlockIndex() = default;
0039 
0040     // ---------- const member functions ---------------------
0041     operator unsigned int() const { return value_; }
0042 
0043     bool operator==(LuminosityBlockIndex const& iRHS) const { return value() == iRHS.value(); }
0044 
0045     /** \return value ranging from 0 to one less than max number of simultaneous luminosityblocks.
0046      */
0047     unsigned int value() const { return value_; }
0048 
0049     static LuminosityBlockIndex invalidLuminosityBlockIndex();
0050 
0051   private:
0052     ///Only the LuminosityBlockPrincipal is allowed to make one of these
0053     friend class LuminosityBlockPrincipal;
0054 
0055     explicit LuminosityBlockIndex(unsigned int iValue) : value_{iValue} {}
0056 
0057     // ---------- member data --------------------------------
0058     unsigned int value_;
0059 
0060     static const unsigned int invalidValue_;
0061   };
0062 }  // namespace edm
0063 
0064 #endif