test
Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
CommonTools
Utils
src
findDataMember.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: Utilities
4
// Class : findDataMember
5
//
6
// Implementation:
7
// <Notes on implementation>
8
//
9
// Original Author: Chris Jones
10
// Created: Wed Aug 13 10:07:46 EDT 2008
11
// $Id: findDataMember.cc,v 1.3 2012/08/03 18:08:11 wmtan Exp $
12
//
13
14
// system include files
15
#include "TInterpreter.h"
16
#include "TVirtualMutex.h"
17
18
#include "
FWCore/Utilities/interface/BaseWithDict.h
"
19
20
// user include files
21
#include "
CommonTools/Utils/src/findDataMember.h
"
22
#include "
CommonTools/Utils/src/ErrorCodes.h
"
23
24
//
25
// constants, enums and typedefs
26
//
27
28
namespace
reco
{
29
30
edm::
31
MemberWithDict
32
findDataMember
(
const
edm::TypeWithDict
& iType,
33
const
std::string
& iName,
34
int
& oError)
35
{
36
edm::MemberWithDict
ret
;
37
oError =
parser::kNameDoesNotExist
;
38
edm::TypeWithDict
type
= iType;
39
if
(!
bool
(type)) {
40
return
ret
;
41
}
42
if
(type.
isPointer
()) {
43
type = type.
toType
();
44
}
45
ret = type.
dataMemberByName
(iName);
46
if
(!
bool
(ret)) {
47
// check base classes
48
edm::TypeBases
bases(type);
49
for
(
auto
const
&
B
: bases) {
50
ret =
findDataMember
(
edm::BaseWithDict
(
B
).typeOf(), iName, oError);
51
//only stop if we found it or some other error happened
52
if
(
bool
(ret) || (oError !=
parser::kNameDoesNotExist
)) {
53
break
;
54
}
55
}
56
}
57
if
(
bool
(ret) && !ret.
isPublic
()) {
58
ret =
edm::MemberWithDict
();
59
oError =
parser::kIsNotPublic
;
60
}
61
else
if
(
bool
(ret)) {
62
oError =
parser::kNoError
;
63
}
64
return
ret
;
65
}
66
67
}
// namespace reco
68
type
type
Definition:
HCALResponse.h:21
runTheMatrix.ret
tuple ret
prodAgent to be discontinued
Definition:
runTheMatrix.py:273
reco::findDataMember
edm::MemberWithDict findDataMember(const edm::TypeWithDict &iType, const std::string &iName, int &oError)
Definition:
findDataMember.cc:32
edm::BaseWithDict
Definition:
BaseWithDict.h:19
dt_dqm_sourceclient_common_cff.reco
tuple reco
Definition:
dt_dqm_sourceclient_common_cff.py:107
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
edm::TypeWithDict::toType
TypeWithDict toType() const
Definition:
TypeWithDict.cc:694
double_binary
Definition:
DDStreamer.cc:227
edm::TypeWithDict::dataMemberByName
MemberWithDict dataMemberByName(std::string const &) const
Definition:
TypeWithDict.cc:631
edm::MemberWithDict::isPublic
bool isPublic() const
Definition:
MemberWithDict.cc:56
reco::parser::kNoError
Definition:
ErrorCodes.h:31
reco::parser::kNameDoesNotExist
Definition:
ErrorCodes.h:32
ErrorCodes.h
reco::parser::kIsNotPublic
Definition:
ErrorCodes.h:33
edm::TypeBases
Definition:
TypeWithDict.h:154
edm::MemberWithDict
Definition:
MemberWithDict.h:20
edm::TypeWithDict
Definition:
TypeWithDict.h:38
BaseWithDict.h
edm::TypeWithDict::isPointer
bool isPointer() const
Definition:
TypeWithDict.cc:435
findDataMember.h
Generated for CMSSW Reference Manual by
1.8.5