CMS 3D CMS Logo

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 
19 
20 // user include files
23 
24 //
25 // constants, enums and typedefs
26 //
27 
28 namespace reco {
29 
30  edm::MemberWithDict findDataMember(const edm::TypeWithDict& iType, const std::string& iName, int& oError) {
33  edm::TypeWithDict type = iType;
34  if (!bool(type)) {
35  return ret;
36  }
37  if (type.isPointer()) {
38  type = type.toType();
39  }
40  ret = type.dataMemberByName(iName);
41  if (!bool(ret)) {
42  // check base classes
43  edm::TypeBases bases(type);
44  for (auto const& B : bases) {
45  ret = findDataMember(edm::BaseWithDict(B).typeOf(), iName, oError);
46  //only stop if we found it or some other error happened
47  if (bool(ret) || (oError != parser::kNameDoesNotExist)) {
48  break;
49  }
50  }
51  }
52  if (bool(ret) && !ret.isPublic()) {
54  oError = parser::kIsNotPublic;
55  } else if (bool(ret)) {
56  oError = parser::kNoError;
57  }
58  return ret;
59  }
60 
61 } // namespace reco
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:542
reco::findDataMember
edm::MemberWithDict findDataMember(const edm::TypeWithDict &iType, const std::string &iName, int &oError)
Definition: findDataMember.cc:30
reco::parser::kIsNotPublic
Definition: ErrorCodes.h:33
ErrorCodes.h
reco::parser::kNameDoesNotExist
Definition: ErrorCodes.h:32
BaseWithDict.h
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::BaseWithDict
Definition: BaseWithDict.h:18
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::TypeWithDict
Definition: TypeWithDict.h:38
reco::parser::kNoError
Definition: ErrorCodes.h:31
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
edm::MemberWithDict
Definition: MemberWithDict.h:19
TtFullHadDaughter::B
static const std::string B
Definition: TtFullHadronicEvent.h:9
findDataMember.h
edm::TypeBases
Definition: TypeWithDict.h:153