DataFormats
PatCandidates
src
UserData.cc
Go to the documentation of this file.
1
#include <cxxabi.h>
2
#include "
DataFormats/PatCandidates/interface/UserData.h
"
3
// Note: these two below are allowed in FWLite even if they come from FWCore
4
#include "
FWCore/Reflection/interface/TypeWithDict.h
"
5
#include "
FWCore/Utilities/interface/EDMException.h
"
6
7
void
pat::UserData::checkDictionaries
(
const
std::type_info&
type
) {
8
if
(!
edm::hasDictionary
(
type
)) {
9
int
status
= 0;
10
char
*
demangled
= abi::__cxa_demangle(
type
.name(),
nullptr
,
nullptr
, &
status
);
11
std::string
typeName
(
status
== 0 ?
demangled
:
type
.name());
12
if
((
demangled
!=
nullptr
) && (
status
== 0))
13
free(
demangled
);
14
throw
edm::Exception
(
edm::errors::DictionaryNotFound
)
15
<<
" No REFLEX data dictionary found for the following class:\n\t"
<<
typeName
16
<<
"\n Most likely the dictionary was never generated,\n"
17
<<
" but it may be that it was generated in the wrong package.\n"
18
<<
" Please add (or move) the specification\n"
19
<<
"\t<class name=\""
<<
typeName
<<
"\" />\n"
20
<<
" to the appropriate classes_def.xml file.\n"
21
<<
" If the class is a template instance, you may need\n"
22
<<
" to define a dummy variable of this type in classes.h.\n"
23
<<
" Also, if this class has any transient members,\n"
24
<<
" you need to specify them in classes_def.xml.\n"
;
25
}
// check for dictionary
26
}
27
28
std::string
pat::UserData::typeNameFor
(std::type_info
const
& iType) {
29
int
status
= 0;
30
const
char
*
demangled
= abi::__cxa_demangle(iType.name(),
nullptr
,
nullptr
, &
status
);
31
return
std::string
(
status
== 0 ?
demangled
:
"[UNKNOWN]"
);
32
}
Exception
Definition:
hltDiff.cc:245
type
type
Definition:
SiPixelVCal_PayloadInspector.cc:39
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
TypeWithDict.h
EDMException.h
mps_update.status
status
Definition:
mps_update.py:68
UserData.h
symbols.demangled
demangled
Definition:
symbols.py:70
pat::UserData::typeNameFor
static std::string typeNameFor(std::type_info const &iInfo)
Definition:
UserData.cc:28
pat::UserData::typeName
virtual const std::string & typeName() const =0
Human readable name of the concrete type of stored data.
edm::errors::DictionaryNotFound
Definition:
EDMException.h:34
edm::hasDictionary
bool hasDictionary(std::type_info const &)
Definition:
TypeWithDict.cc:809
pat::UserData::checkDictionaries
static void checkDictionaries(const std::type_info &type)
Definition:
UserData.cc:7
Generated for CMSSW Reference Manual by
1.8.14