Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:13:12

0001 #ifndef FWCore_Utilities_InputTag_h
0002 #define FWCore_Utilities_InputTag_h
0003 
0004 #include <atomic>
0005 #include <iosfwd>
0006 #include <string>
0007 
0008 #include "FWCore/Utilities/interface/TypeID.h"
0009 #include "FWCore/Utilities/interface/BranchType.h"
0010 #include "FWCore/Utilities/interface/ProductResolverIndex.h"
0011 #include "FWCore/Utilities/interface/thread_safety_macros.h"
0012 
0013 namespace edm {
0014 
0015   class InputTag {
0016   public:
0017     InputTag();
0018     InputTag(std::string const& label, std::string const& instance, std::string const& processName = "");
0019     InputTag(char const* label, char const* instance, char const* processName = "");
0020     /// the input string is of the form:
0021     /// label
0022     /// label:instance
0023     /// label:instance:process
0024     InputTag(std::string const& s);
0025     ~InputTag();
0026 
0027     InputTag(InputTag const& other);
0028 
0029     InputTag(InputTag&& other);
0030     InputTag& operator=(InputTag const& other);
0031 
0032     InputTag& operator=(InputTag&& other);
0033 
0034     std::string encode() const;
0035 
0036     std::string const& label() const { return label_; }
0037     std::string const& instance() const { return instance_; }
0038     ///an empty string means find the most recently produced
0039     ///product with the label and instance
0040     std::string const& process() const { return process_; }
0041 
0042     bool willSkipCurrentProcess() const { return skipCurrentProcess_; }
0043 
0044     bool operator==(InputTag const& tag) const;
0045 
0046     ProductResolverIndex indexFor(TypeID const& typeID, BranchType branchType, void const* productRegistry) const;
0047 
0048     void tryToCacheIndex(ProductResolverIndex index,
0049                          TypeID const& typeID,
0050                          BranchType branchType,
0051                          void const* productRegistry) const;
0052 
0053     static const std::string kSkipCurrentProcess;
0054     static const std::string kCurrentProcess;
0055 
0056   private:
0057     bool calcSkipCurrentProcess() const;
0058 
0059     std::string label_;
0060     std::string instance_;
0061     std::string process_;
0062 
0063     CMS_THREAD_GUARD(index_) mutable TypeID typeID_;
0064     CMS_THREAD_GUARD(index_) mutable void const* productRegistry_;
0065 
0066     mutable std::atomic<unsigned int> index_;
0067 
0068     CMS_THREAD_GUARD(index_) mutable char branchType_;
0069 
0070     bool skipCurrentProcess_;
0071   };
0072 
0073   std::ostream& operator<<(std::ostream& ost, InputTag const& tag);
0074 }  // namespace edm
0075 #endif