Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef Framework_HCTypeTag_icc
0002 #define Framework_HCTypeTag_icc
0003 // -*- C++ -*-
0004 //
0005 // Package:     HeteroContainer
0006 // Module:      HCTypeTag
0007 //
0008 // Description: <one line class summary>
0009 //
0010 // Implementation:
0011 //     <Notes on implementation>
0012 //
0013 // Author:      Chris D. Jones
0014 // Created:     Sun Sep 20 15:27:25 EDT 1998
0015 //
0016 // Revision history
0017 //
0018 // $Log: HCTypeTag.cc,v $
0019 // Revision 1.2  2010/01/23 02:03:42  chrjones
0020 // moved type lookup used by EventSetup to FWCore/Utilities to avoid unneeded external dependencies from FWCore/Framework
0021 //
0022 // Revision 1.1  2010/01/15 20:35:49  chrjones
0023 // Changed type identifier for the EventSetup to no longer be a template
0024 //
0025 // Revision 1.6  2005/11/11 20:55:54  chrjones
0026 // use new TypeIDBase for basis of all type comparisons
0027 //
0028 // Revision 1.5  2005/09/01 23:30:48  wmtan
0029 // fix rule violations found by rulechecker
0030 //
0031 // Revision 1.4  2005/09/01 05:20:56  wmtan
0032 // Fix Rules violations found by RuleChecker
0033 //
0034 // Revision 1.3  2005/07/14 22:50:52  wmtan
0035 // Rename packages
0036 //
0037 // Revision 1.2  2005/06/23 19:59:30  wmtan
0038 // fix rules violations found by rulechecker
0039 //
0040 // Revision 1.1  2005/05/29 02:29:53  wmtan
0041 // initial population
0042 //
0043 // Revision 1.2  2005/04/04 20:31:22  chrjones
0044 // added namespace
0045 //
0046 // Revision 1.1  2005/03/28 15:03:30  chrjones
0047 // first submission
0048 //
0049 // Revision 1.2  2000/07/25 13:42:37  cdj
0050 // HCTypeTag can now find a TypeTag from the name of a type
0051 //
0052 // Revision 1.1.1.1  1998/09/23 14:13:12  cdj
0053 // first submission
0054 //
0055 
0056 // system include files
0057 #include <map>
0058 #include <cstring>
0059 
0060 // user include files
0061 //#include "Logger/interface/report.h"
0062 #include "FWCore/Framework/interface/HCTypeTag.h"
0063 
0064 // STL classes
0065 
0066 //
0067 // constants, enums and typedefs
0068 //
0069 namespace edm {
0070   namespace eventsetup {
0071     namespace heterocontainer {
0072 
0073       //
0074       // static data member definitions
0075       //
0076 
0077       //
0078       // constructors and destructor
0079       //
0080       //HCTypeTag::HCTypeTag()
0081       //{
0082       //}
0083 
0084       // HCTypeTag::HCTypeTag(const HCTypeTag& rhs)
0085       // {
0086       //    // do actual copying here; if you implemented
0087       //    // operator= correctly, you may be able to use just say
0088       //    *this = rhs;
0089       // }
0090 
0091       //HCTypeTag::~HCTypeTag()
0092       //{
0093       //}
0094 
0095       //
0096       // assignment operators
0097       //
0098       // const HCTypeTag& HCTypeTag::operator=(const HCTypeTag& rhs)
0099       // {
0100       //   if(this != &rhs) {
0101       //      // do actual copying here, plus:
0102       //      // "SuperClass"::operator=(rhs);
0103       //   }
0104       //
0105       //   return *this;
0106       // }
0107 
0108       //
0109       // member functions
0110       //
0111 
0112       //
0113       // const member functions
0114       //
0115 
0116       //
0117       // static member functions
0118       //
0119       HCTypeTag HCTypeTag::findType(const std::string& iTypeName) { return HCTypeTag::findType(iTypeName.c_str()); }
0120 
0121       HCTypeTag HCTypeTag::findType(const char* iTypeName) {
0122         std::pair<const char*, const std::type_info*> p = typelookup::findType(iTypeName);
0123 
0124         if (nullptr == p.second) {
0125           return HCTypeTag();
0126         }
0127         //need to take name from the 'findType' since that address is guaranteed to be long lived
0128         return HCTypeTag(*p.second, p.first);
0129       }
0130     }  // namespace heterocontainer
0131   }    // namespace eventsetup
0132 }  // namespace edm
0133 
0134 #endif