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 
11  }
12 
13  MemberWithDict::MemberWithDict(TDataMember* dataMember) : dataMember_(dataMember) {
14  }
15 
16  MemberWithDict::operator bool() const {
17  return dataMember_ != nullptr;
18  }
19 
22  return dataMember_->GetName();
23  }
24 
27  if(isArray()) {
28  std::ostringstream name;
29  name << dataMember_->GetTrueTypeName();
30  for(int i = 0; i < dataMember_->GetArrayDim(); ++i) {
31  name << '[';
32  name << dataMember_->GetMaxIndex(i);
33  name << ']';
34  }
35  return TypeWithDict::byName(name.str());
36  }
37  return TypeWithDict::byName(dataMember_->GetTrueTypeName());
38  }
39 
42  return TypeWithDict(dataMember_->GetClass());
43  }
44 
45  bool
47  return dataMember_->Property() & kIsArray;
48  }
49 
50  bool
52  return dataMember_->Property() & kIsConstant;
53  }
54 
55  bool
57  return dataMember_->Property() & kIsPublic;
58  }
59 
60  bool
62  return dataMember_->Property() & kIsStatic;
63  }
64 
65  bool
67  return !dataMember_->IsPersistent();
68  }
69 
70  size_t
72  return dataMember_->GetOffset();
73  }
74 
77  return ObjectWithDict(typeOf(), reinterpret_cast<void*>(dataMember_->GetOffset()));
78  }
79 
82  return ObjectWithDict(typeOf(), reinterpret_cast<char*>(obj.address()) + dataMember_->GetOffset());
83  }
84 
85 } // namespace edm
int i
Definition: DBlmapReader.cc:9
void * address() const
bool isStatic() const
size_t offset() const
bool isArray() const
#define nullptr
static TypeWithDict byName(std::string const &name)
Definition: TypeWithDict.cc:60
bool isPublic() const
TypeWithDict declaringType() const
TDataMember * dataMember_
std::string name() const
ObjectWithDict get() const
TypeWithDict typeOf() const
bool isConst() const
bool isTransient() const
HLT enums.