CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/FWCore/Utilities/src/MemberWithDict.cc

Go to the documentation of this file.
00001 
00002 #include "FWCore/Utilities/interface/MemberWithDict.h"
00003 #include "FWCore/Utilities/interface/ObjectWithDict.h"
00004 #include "FWCore/Utilities/interface/TypeWithDict.h"
00005 
00006 namespace edm {
00007 
00008   MemberWithDict::MemberWithDict() :
00009     dataMember_() {
00010   }
00011 
00012   MemberWithDict::MemberWithDict(TDataMember* dataMember) :
00013     dataMember_(dataMember) {
00014   }
00015 
00016   std::string
00017   MemberWithDict::name() const {
00018     return dataMember_->GetName();
00019   }
00020 
00021   ObjectWithDict
00022   MemberWithDict::get() const {
00023     return (ObjectWithDict(typeOf(), reinterpret_cast<void*>(dataMember_->GetOffset())));
00024   }
00025 
00026   ObjectWithDict
00027   MemberWithDict::get(ObjectWithDict const& obj) const {
00028     return (ObjectWithDict(typeOf(), static_cast<char*>(obj.address()) + dataMember_->GetOffset()));
00029   }
00030 
00031   TypeWithDict
00032   MemberWithDict::typeOf() const {
00033     return TypeWithDict::byName(dataMember_->GetTypeName(), dataMember_->Property());
00034   }
00035 
00036   TypeWithDict
00037   MemberWithDict::declaringType() const {
00038     return TypeWithDict(dataMember_->GetClass(), dataMember_->Property());
00039   }
00040 
00041   bool
00042   MemberWithDict::isConst() const {
00043     return (dataMember_->Property() & kIsConstant);
00044   }
00045 
00046   bool
00047   MemberWithDict::isPublic() const {
00048     return (dataMember_->Property() & kIsPublic);
00049   }
00050 
00051   bool
00052   MemberWithDict::isStatic() const {
00053     return (dataMember_->Property() & kIsStatic);
00054   }
00055 
00056   bool
00057   MemberWithDict::isTransient() const {
00058     return !dataMember_->IsPersistent();
00059   }
00060 
00061   size_t
00062   MemberWithDict::offset() const {
00063     return (dataMember_->GetOffset());
00064   }
00065 
00066   MemberWithDict::operator bool() const {
00067     return (dataMember_ != nullptr);
00068   }
00069 
00070 }