Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
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 "
FWCore/Utilities/interface/BaseWithDict.h
"
16
17
// user include files
18
#include "
CommonTools/Utils/src/findDataMember.h
"
19
#include "
CommonTools/Utils/src/ErrorCodes.h
"
20
21
//
22
// constants, enums and typedefs
23
//
24
25
namespace
reco
{
26
edm::MemberWithDict
findDataMember
(
const
edm::TypeWithDict
& iType,
const
std::string
& iName,
int
& oError) {
27
edm::MemberWithDict
returnValue;
28
oError =
parser::kNameDoesNotExist
;
29
edm::TypeWithDict
type
= iType;
30
if
(type) {
31
if
(type.
isPointer
()) {
32
type = type.
toType
();
// for Pointers, I get the real type this way
33
}
34
returnValue = type.
dataMemberByName
(iName);
35
if
(!returnValue) {
36
//check inheriting classes
37
edm::TypeBases
bases(type);
38
for
(
auto
const
&
base
: bases) {
39
returnValue =
findDataMember
(
edm::BaseWithDict
(
base
).typeOf(), iName, oError);
40
//only stop if we found it or some other error happened
41
if
(returnValue ||
parser::kNameDoesNotExist
!= oError) {
42
break
;
43
}
44
}
45
}
46
if
(returnValue && !returnValue.
isPublic
()) {
47
returnValue =
edm::MemberWithDict
();
48
oError =
parser::kIsNotPublic
;
49
}
50
}
51
if
(returnValue) {
52
oError =
parser::kNoError
;
53
}
54
return
returnValue;
55
}
56
}
newFWLiteAna.base
tuple base
Main Program
Definition:
newFWLiteAna.py:92
type
type
Definition:
HCALResponse.h:21
reco::findDataMember
edm::MemberWithDict findDataMember(const edm::TypeWithDict &iType, const std::string &iName, int &oError)
Definition:
findDataMember.cc:26
edm::BaseWithDict
Definition:
BaseWithDict.h:18
dt_dqm_sourceclient_common_cff.reco
tuple reco
Definition:
dt_dqm_sourceclient_common_cff.py:105
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
edm::TypeWithDict::toType
TypeWithDict toType() const
Definition:
TypeWithDict.cc:392
edm::MemberWithDict::isPublic
bool isPublic() const
Definition:
MemberWithDict.cc:47
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:189
edm::MemberWithDict
Definition:
MemberWithDict.h:19
edm::TypeWithDict::dataMemberByName
MemberWithDict dataMemberByName(std::string const &member) const
Definition:
TypeWithDict.cc:300
edm::TypeWithDict
Definition:
TypeWithDict.h:45
BaseWithDict.h
edm::TypeWithDict::isPointer
bool isPointer() const
Definition:
TypeWithDict.cc:367
findDataMember.h
Generated for CMSSW Reference Manual by
1.8.5