CMS 3D CMS Logo

MemberWithDict.cc
Go to the documentation of this file.
2 
5 #include <ostream>
6 #include <sstream>
7 
8 namespace edm {
9 
10  MemberWithDict::MemberWithDict() : dataMember_(nullptr) {}
11 
12  MemberWithDict::MemberWithDict(TDataMember* dataMember) : dataMember_(dataMember) {}
13 
14  MemberWithDict::operator bool() const { return dataMember_ != nullptr; }
15 
16  std::string MemberWithDict::name() const { return dataMember_->GetName(); }
17 
19  if (isArray()) {
20  std::ostringstream name;
21  name << dataMember_->GetTrueTypeName();
22  for (int i = 0; i < dataMember_->GetArrayDim(); ++i) {
23  name << '[';
24  name << dataMember_->GetMaxIndex(i);
25  name << ']';
26  }
27  return TypeWithDict::byName(name.str());
28  }
29  return TypeWithDict::byName(dataMember_->GetTrueTypeName());
30  }
31 
33 
34  bool MemberWithDict::isArray() const { return dataMember_->Property() & kIsArray; }
35 
36  bool MemberWithDict::isConst() const { return dataMember_->Property() & kIsConstant; }
37 
38  bool MemberWithDict::isPublic() const { return dataMember_->Property() & kIsPublic; }
39 
40  bool MemberWithDict::isStatic() const { return dataMember_->Property() & kIsStatic; }
41 
42  bool MemberWithDict::isTransient() const { return !dataMember_->IsPersistent(); }
43 
44  size_t MemberWithDict::offset() const { return dataMember_->GetOffset(); }
45 
47  return ObjectWithDict(typeOf(), reinterpret_cast<void*>(dataMember_->GetOffset()));
48  }
49 
51  return ObjectWithDict(typeOf(), reinterpret_cast<char*>(obj.address()) + dataMember_->GetOffset());
52  }
53 
54 } // namespace edm
edm::TypeWithDict::byName
static TypeWithDict byName(std::string const &name)
Definition: TypeWithDict.cc:74
electrons_cff.bool
bool
Definition: electrons_cff.py:393
mps_fire.i
i
Definition: mps_fire.py:428
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ObjectWithDict
Definition: ObjectWithDict.h:17
edm::MemberWithDict::declaringType
TypeWithDict declaringType() const
Definition: MemberWithDict.cc:32
TypeWithDict.h
edm::MemberWithDict::isArray
bool isArray() const
Definition: MemberWithDict.cc:34
Utilities.operator
operator
Definition: Utilities.py:24
ObjectWithDict.h
edm::MemberWithDict::offset
size_t offset() const
Definition: MemberWithDict.cc:44
edm::MemberWithDict::isPublic
bool isPublic() const
Definition: MemberWithDict.cc:38
edm::MemberWithDict::get
ObjectWithDict get() const
Definition: MemberWithDict.cc:46
edm::MemberWithDict::typeOf
TypeWithDict typeOf() const
Definition: MemberWithDict.cc:18
edm::MemberWithDict::MemberWithDict
MemberWithDict()
Definition: MemberWithDict.cc:10
edm::MemberWithDict::isConst
bool isConst() const
Definition: MemberWithDict.cc:36
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::MemberWithDict::dataMember_
TDataMember * dataMember_
Definition: MemberWithDict.h:21
edm::TypeWithDict
Definition: TypeWithDict.h:38
edm::MemberWithDict::isStatic
bool isStatic() const
Definition: MemberWithDict.cc:40
edm::MemberWithDict::name
std::string name() const
Definition: MemberWithDict.cc:16
reco::parser::kIsStatic
Definition: ErrorCodes.h:34
MemberWithDict.h
edm::MemberWithDict::isTransient
bool isTransient() const
Definition: MemberWithDict.cc:42