14 template<>
bool ROOT::Experimental::RAttrMap::Value_t::Get<bool>()
const {
return GetBool(); }
15 template<>
int ROOT::Experimental::RAttrMap::Value_t::Get<int>()
const {
return GetInt(); }
16 template<>
double ROOT::Experimental::RAttrMap::Value_t::Get<double>()
const {
return GetDouble(); }
17 template<> std::string ROOT::Experimental::RAttrMap::Value_t::Get<std::string>()
const {
return GetString(); }
19 template<>
bool ROOT::Experimental::RAttrMap::Value_t::GetValue<bool,void>(
const Value_t *rec) {
return rec ? rec->GetBool() :
false; }
20 template<>
int ROOT::Experimental::RAttrMap::Value_t::GetValue<int,void>(
const Value_t *rec) {
return rec ? rec->GetInt() : 0; }
21 template<>
double ROOT::Experimental::RAttrMap::Value_t::GetValue<double,void>(
const Value_t *rec) {
return rec ? rec->GetDouble() : 0.; }
22 template<> std::string ROOT::Experimental::RAttrMap::Value_t::GetValue<std::string,void>(
const Value_t *rec) {
return rec ? rec->GetString() :
""; }
24 template<>
const ROOT::Experimental::RAttrMap::Value_t *ROOT::Experimental::RAttrMap::Value_t::GetValue<const ROOT::Experimental::RAttrMap::Value_t *,void>(
const Value_t *rec) {
return rec; }
25 template<>
const ROOT::Experimental::RAttrMap::Value_t *ROOT::Experimental::RAttrMap::Value_t::GetValue<const ROOT::Experimental::RAttrMap::Value_t *,bool>(
const Value_t *rec) {
return rec && rec->Kind() == RAttrMap::kBool ? rec :
nullptr; }
26 template<>
const ROOT::Experimental::RAttrMap::Value_t *ROOT::Experimental::RAttrMap::Value_t::GetValue<const ROOT::Experimental::RAttrMap::Value_t *,int>(
const Value_t *rec) {
return rec && rec->Kind() == RAttrMap::kInt ? rec :
nullptr; }
27 template<>
const ROOT::Experimental::RAttrMap::Value_t *ROOT::Experimental::RAttrMap::Value_t::GetValue<const ROOT::Experimental::RAttrMap::Value_t *,double>(
const Value_t *rec) {
return rec && rec->Kind() == RAttrMap::kDouble ? rec :
nullptr; }
28 template<>
const ROOT::Experimental::RAttrMap::Value_t *ROOT::Experimental::RAttrMap::Value_t::GetValue<const ROOT::Experimental::RAttrMap::Value_t *,std::string>(
const Value_t *rec) {
return rec && rec->Kind() == RAttrMap::kString ? rec :
nullptr; }
31 using namespace std::string_literals;
33 ROOT::Experimental::RAttrMap &ROOT::Experimental::RAttrMap::AddDefaults(
const RAttrBase &vis)
35 auto prefix = vis.GetPrefix();
37 for (
const auto &entry : vis.GetDefaults())
38 m[prefix+entry.first] = entry.second->Copy();