CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HCTypeTag.cc
Go to the documentation of this file.
1 #ifndef Framework_HCTypeTag_icc
2 #define Framework_HCTypeTag_icc
3 // -*- C++ -*-
4 //
5 // Package: HeteroContainer
6 // Module: HCTypeTag
7 //
8 // Description: <one line class summary>
9 //
10 // Implementation:
11 // <Notes on implementation>
12 //
13 // Author: Chris D. Jones
14 // Created: Sun Sep 20 15:27:25 EDT 1998
15 //
16 // Revision history
17 //
18 // $Log: HCTypeTag.cc,v $
19 // Revision 1.2 2010/01/23 02:03:42 chrjones
20 // moved type lookup used by EventSetup to FWCore/Utilities to avoid unneeded external dependencies from FWCore/Framework
21 //
22 // Revision 1.1 2010/01/15 20:35:49 chrjones
23 // Changed type identifier for the EventSetup to no longer be a template
24 //
25 // Revision 1.6 2005/11/11 20:55:54 chrjones
26 // use new TypeIDBase for basis of all type comparisons
27 //
28 // Revision 1.5 2005/09/01 23:30:48 wmtan
29 // fix rule violations found by rulechecker
30 //
31 // Revision 1.4 2005/09/01 05:20:56 wmtan
32 // Fix Rules violations found by RuleChecker
33 //
34 // Revision 1.3 2005/07/14 22:50:52 wmtan
35 // Rename packages
36 //
37 // Revision 1.2 2005/06/23 19:59:30 wmtan
38 // fix rules violations found by rulechecker
39 //
40 // Revision 1.1 2005/05/29 02:29:53 wmtan
41 // initial population
42 //
43 // Revision 1.2 2005/04/04 20:31:22 chrjones
44 // added namespace
45 //
46 // Revision 1.1 2005/03/28 15:03:30 chrjones
47 // first submission
48 //
49 // Revision 1.2 2000/07/25 13:42:37 cdj
50 // HCTypeTag can now find a TypeTag from the name of a type
51 //
52 // Revision 1.1.1.1 1998/09/23 14:13:12 cdj
53 // first submission
54 //
55 
56 // system include files
57 #include <map>
58 #include <cstring>
59 
60 // user include files
61 //#include "Logger/interface/report.h"
63 
64 // STL classes
65 
66 //
67 // constants, enums and typedefs
68 //
69 namespace edm {
70  namespace eventsetup {
71  namespace heterocontainer {
72 
73  //
74  // static data member definitions
75  //
76 
77  //
78  // constructors and destructor
79  //
80  //HCTypeTag::HCTypeTag()
81  //{
82  //}
83 
84  // HCTypeTag::HCTypeTag(const HCTypeTag& rhs)
85  // {
86  // // do actual copying here; if you implemented
87  // // operator= correctly, you may be able to use just say
88  // *this = rhs;
89  // }
90 
91  //HCTypeTag::~HCTypeTag()
92  //{
93  //}
94 
95  //
96  // assignment operators
97  //
98  // const HCTypeTag& HCTypeTag::operator=(const HCTypeTag& rhs)
99  // {
100  // if(this != &rhs) {
101  // // do actual copying here, plus:
102  // // "SuperClass"::operator=(rhs);
103  // }
104  //
105  // return *this;
106  // }
107 
108  //
109  // member functions
110  //
111 
112  //
113  // const member functions
114  //
115 
116  //
117  // static member functions
118  //
119  HCTypeTag
120  HCTypeTag::findType(const std::string& iTypeName) {
121  return HCTypeTag::findType(iTypeName.c_str());
122  }
123 
124  HCTypeTag
125  HCTypeTag::findType(const char* iTypeName)
126  {
127  std::pair<const char*,const std::type_info*> p = typelookup::findType(iTypeName);
128 
129  if(0 == p.second) {
130  return HCTypeTag();
131  }
132  //need to take name from the 'findType' since that address is guaranteed to be long lived
133  return HCTypeTag(*p.second, p.first);
134  }
135  }
136  }
137 }
138 
139 #endif
std::pair< const char *, const std::type_info * > findType(const char *iClassName)
Definition: typelookup.cc:76
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
Definition: HCTypeTag.cc:125