File indexing completed on 2024-09-07 04:36:23
0001 #ifndef Framework_HCTypeTag_h
0002 #define Framework_HCTypeTag_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include "FWCore/Utilities/interface/TypeIDBase.h"
0025 #include "FWCore/Utilities/interface/typelookup.h"
0026
0027
0028 #include <string>
0029 #include <typeinfo>
0030
0031
0032 namespace edm {
0033 namespace eventsetup {
0034 namespace heterocontainer {
0035
0036 using typelookup::className;
0037
0038 class HCTypeTag : public TypeIDBase {
0039 public:
0040 HCTypeTag() = default;
0041
0042
0043
0044
0045 std::type_info const& value() const { return typeInfo(); }
0046 char const* name() const { return m_name; }
0047
0048
0049 static HCTypeTag findType(char const* iTypeName);
0050 static HCTypeTag findType(std::string const& iTypeName);
0051
0052 template <typename T>
0053 static HCTypeTag make() {
0054 return HCTypeTag(typelookup::classTypeInfo<T>(), typelookup::className<T>());
0055 }
0056
0057 protected:
0058
0059 HCTypeTag(std::type_info const& iValue, char const* iName) : TypeIDBase(iValue), m_name(iName) {}
0060
0061 HCTypeTag(TypeIDBase const& iValue, const char* iName) : TypeIDBase(iValue), m_name(iName) {}
0062
0063 private:
0064 char const* m_name{""};
0065 };
0066 }
0067 }
0068 }
0069 #define HCTYPETAG_HELPER_METHODS(_dataclass_) TYPELOOKUP_METHODS(_dataclass_)
0070
0071 #define DEFINE_HCTYPETAG_REGISTRATION(type) DEFINE_TYPELOOKUP_REGISTRATION(type)
0072 #endif