Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-01-13 01:43:36

0001 #ifndef FWCore_Framework_ComponentDescription_h
0002 #define FWCore_Framework_ComponentDescription_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Framework
0006 // Class  :     ComponentDescription
0007 //
0008 /**\struct edm::eventsetup::ComponentDescription
0009 
0010  Description: minimal set of information to describe an EventSetup component (ESSource or ESProducer)
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Chris Jones
0018 //         Created:  Thu Dec 15 14:07:57 EST 2005
0019 //
0020 
0021 // user include files
0022 #include "DataFormats/Provenance/interface/ParameterSetID.h"
0023 
0024 // system include files
0025 #include <string>
0026 
0027 // forward declarations
0028 namespace edm {
0029   namespace eventsetup {
0030     struct ComponentDescription {
0031       std::string label_;  // A human friendly string that uniquely identifies the label
0032       std::string type_;   // A human friendly string that uniquely identifies the name
0033 
0034       // ID of parameter set of the creator
0035       ParameterSetID pid_;
0036 
0037       unsigned int id_;
0038 
0039       bool isSource_;
0040       bool isLooper_;
0041 
0042       /* ----------- end of provenance information ------------- */
0043 
0044       ComponentDescription() : label_(), type_(), pid_(), id_(unknownID()), isSource_(false), isLooper_(false) {}
0045 
0046       ComponentDescription(
0047           std::string const& iType, std::string const& iLabel, unsigned int iId, bool iIsSource, bool iIsLooper = false)
0048           : label_(iLabel), type_(iType), pid_(), id_(iId), isSource_(iIsSource), isLooper_(iIsLooper) {}
0049 
0050       [[nodiscard]] static constexpr unsigned int unknownID() noexcept { return 0xFFFFFFFF; }
0051 
0052       bool operator<(ComponentDescription const& iRHS) const {
0053         return (type_ == iRHS.type_) ? (label_ < iRHS.label_) : (type_ < iRHS.type_);
0054       }
0055       bool operator==(ComponentDescription const& iRHS) const {
0056         return label_ == iRHS.label_ && type_ == iRHS.type_ && isSource_ == iRHS.isSource_;
0057       }
0058     };
0059   }  // namespace eventsetup
0060 }  // namespace edm
0061 #endif