File indexing completed on 2024-04-06 12:04:10
0001 #ifndef DataFormats_FWLite_InternalDataKey_h
0002 #define DataFormats_FWLite_InternalDataKey_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include "FWCore/Reflection/interface/ObjectWithDict.h"
0023 #include "FWCore/Utilities/interface/TypeID.h"
0024 #include "FWCore/Utilities/interface/propagate_const.h"
0025
0026 #include "TBranch.h"
0027
0028 #include <cstring>
0029
0030 namespace edm {
0031 class WrapperBase;
0032 }
0033
0034 namespace fwlite {
0035 namespace internal {
0036 class DataKey {
0037 public:
0038
0039
0040
0041
0042 DataKey(const edm::TypeID& iType, char const* iModule, char const* iProduct, char const* iProcess)
0043 : type_(iType),
0044 module_(iModule != nullptr ? iModule : kEmpty()),
0045 product_(iProduct != nullptr ? iProduct : kEmpty()),
0046 process_(iProcess != nullptr ? iProcess : kEmpty()) {}
0047
0048 ~DataKey() {}
0049
0050 bool operator<(const DataKey& iRHS) const {
0051 if (type_ < iRHS.type_) {
0052 return true;
0053 }
0054 if (iRHS.type_ < type_) {
0055 return false;
0056 }
0057 int comp = std::strcmp(module_, iRHS.module_);
0058 if (0 != comp) {
0059 return comp < 0;
0060 }
0061 comp = std::strcmp(product_, iRHS.product_);
0062 if (0 != comp) {
0063 return comp < 0;
0064 }
0065 comp = std::strcmp(process_, iRHS.process_);
0066 return comp < 0;
0067 }
0068 char const* kEmpty() const { return ""; }
0069 char const* module() const { return module_; }
0070 char const* product() const { return product_; }
0071 char const* process() const { return process_; }
0072 const edm::TypeID& typeID() const { return type_; }
0073
0074 private:
0075 edm::TypeID type_;
0076 char const* module_;
0077 char const* product_;
0078 char const* process_;
0079 };
0080
0081 struct Data {
0082 edm::propagate_const<TBranch*> branch_;
0083 Long64_t lastProduct_;
0084 edm::ObjectWithDict obj_;
0085 void* pObj_;
0086 edm::WrapperBase const* pProd_;
0087
0088 ~Data() { obj_.destruct(true); }
0089 };
0090
0091 class ProductGetter;
0092 }
0093
0094 }
0095
0096 #endif