Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef FWCore_Utilities_StreamID_h
0002 #define FWCore_Utilities_StreamID_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     FWCore/Utilities
0006 // Class  :     edm::StreamID
0007 //
0008 /**\class edm::StreamID StreamID.h "FWCore/Utilities/interface/StreamID.h"
0009 
0010  Description: Identifies an edm stream
0011 
0012  Usage:
0013     Various APIs use this type to allow access to per stream information.
0014 
0015 */
0016 //
0017 // Original Author:  Chris Jones
0018 //         Created:  Fri, 26 Apr 2013 19:37:37 GMT
0019 //
0020 
0021 // system include files
0022 
0023 // user include files
0024 
0025 // forward declarations
0026 namespace edm {
0027   class Schedule;
0028   class EventPrincipal;
0029 
0030   class StreamID {
0031   public:
0032     ~StreamID() = default;
0033     StreamID() = delete;
0034     StreamID(const StreamID&) = default;
0035     StreamID& operator=(const StreamID&) = default;
0036 
0037     bool operator==(const StreamID& iID) const { return iID.value_ == value_; }
0038 
0039     operator unsigned int() const { return value_; }
0040 
0041     /** \return value ranging from 0 to one less than max number of streams.
0042      */
0043     unsigned int value() const { return value_; }
0044 
0045     static StreamID invalidStreamID() { return StreamID(0xFFFFFFFFU); }
0046 
0047   private:
0048     ///Only a Schedule is allowed to create one of these
0049     friend class Schedule;
0050     friend class EventPrincipal;
0051     explicit StreamID(unsigned int iValue) : value_(iValue) {}
0052 
0053     // ---------- member data --------------------------------
0054     unsigned int value_;
0055   };
0056 }  // namespace edm
0057 
0058 #endif