CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/FWCore/Framework/src/HCTypeTag.cc

Go to the documentation of this file.
00001 #ifndef Framework_HCTypeTag_icc
00002 #define Framework_HCTypeTag_icc
00003 // -*- C++ -*-
00004 //
00005 // Package:     HeteroContainer
00006 // Module:      HCTypeTag
00007 // 
00008 // Description: <one line class summary>
00009 //
00010 // Implementation:
00011 //     <Notes on implementation>
00012 //
00013 // Author:      Chris D. Jones
00014 // Created:     Sun Sep 20 15:27:25 EDT 1998
00015 // $Id: HCTypeTag.cc,v 1.3 2010/01/25 23:23:31 chrjones Exp $
00016 //
00017 // Revision history
00018 //
00019 // $Log: HCTypeTag.cc,v $
00020 // Revision 1.3  2010/01/25 23:23:31  chrjones
00021 // modified to use the new 'findType' return value
00022 //
00023 // Revision 1.2  2010/01/23 02:03:42  chrjones
00024 // moved type lookup used by EventSetup to FWCore/Utilities to avoid unneeded external dependencies from FWCore/Framework
00025 //
00026 // Revision 1.1  2010/01/15 20:35:49  chrjones
00027 // Changed type identifier for the EventSetup to no longer be a template
00028 //
00029 // Revision 1.6  2005/11/11 20:55:54  chrjones
00030 // use new TypeIDBase for basis of all type comparisons
00031 //
00032 // Revision 1.5  2005/09/01 23:30:48  wmtan
00033 // fix rule violations found by rulechecker
00034 //
00035 // Revision 1.4  2005/09/01 05:20:56  wmtan
00036 // Fix Rules violations found by RuleChecker
00037 //
00038 // Revision 1.3  2005/07/14 22:50:52  wmtan
00039 // Rename packages
00040 //
00041 // Revision 1.2  2005/06/23 19:59:30  wmtan
00042 // fix rules violations found by rulechecker
00043 //
00044 // Revision 1.1  2005/05/29 02:29:53  wmtan
00045 // initial population
00046 //
00047 // Revision 1.2  2005/04/04 20:31:22  chrjones
00048 // added namespace
00049 //
00050 // Revision 1.1  2005/03/28 15:03:30  chrjones
00051 // first submission
00052 //
00053 // Revision 1.2  2000/07/25 13:42:37  cdj
00054 // HCTypeTag can now find a TypeTag from the name of a type
00055 //
00056 // Revision 1.1.1.1  1998/09/23 14:13:12  cdj
00057 // first submission
00058 //
00059 
00060 // system include files
00061 #include <map>
00062 #include <cstring>
00063 
00064 // user include files
00065 //#include "Logger/interface/report.h"
00066 #include "FWCore/Framework/interface/HCTypeTag.h"
00067 
00068 // STL classes
00069 
00070 //
00071 // constants, enums and typedefs
00072 //
00073 namespace edm {
00074    namespace eventsetup {
00075       namespace heterocontainer {
00076          
00077          //
00078          // static data member definitions
00079          //
00080                   
00081          //
00082          // constructors and destructor
00083          //
00084          //HCTypeTag::HCTypeTag()
00085          //{
00086          //}
00087          
00088          // HCTypeTag::HCTypeTag(const HCTypeTag& rhs)
00089          // {
00090          //    // do actual copying here; if you implemented
00091          //    // operator= correctly, you may be able to use just say      
00092          //    *this = rhs;
00093          // }
00094          
00095          //HCTypeTag::~HCTypeTag()
00096          //{
00097          //}
00098          
00099          //
00100          // assignment operators
00101          //
00102          // const HCTypeTag& HCTypeTag::operator=(const HCTypeTag& rhs)
00103          // {
00104          //   if(this != &rhs) {
00105          //      // do actual copying here, plus:
00106          //      // "SuperClass"::operator=(rhs);
00107          //   }
00108          //
00109          //   return *this;
00110          // }
00111          
00112          //
00113          // member functions
00114          //
00115          
00116          //
00117          // const member functions
00118          //
00119          
00120          //
00121          // static member functions
00122          //
00123          HCTypeTag
00124          HCTypeTag::findType(const std::string& iTypeName) {
00125             return HCTypeTag::findType(iTypeName.c_str());
00126          }
00127          
00128          HCTypeTag
00129          HCTypeTag::findType(const char* iTypeName)
00130          {
00131             std::pair<const char*,const std::type_info*> p = typelookup::findType(iTypeName);
00132             
00133             if(0 == p.second) {
00134                return HCTypeTag();
00135             }
00136             //need to take name from the 'findType' since that address is guaranteed to be long lived
00137             return HCTypeTag(*p.second, p.first);
00138          }         
00139       }
00140    }
00141 }
00142 
00143 #endif