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