Skip to content

Commit

Permalink
Merge pull request #11805 from alja/MuonDigi
Browse files Browse the repository at this point in the history
74x Fireworks: fix MuonDigi accessor type
  • Loading branch information
davidlange6 committed Oct 24, 2015
2 parents a03f29e + e0542f8 commit 764f442
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions Fireworks/Core/src/FWItemAccessorFactory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ FWItemAccessorFactory::~FWItemAccessorFactory()
we return the a FWItemTVirtualCollectionProxyAccessor
constructed using the associated TVirtualCollectionProxy.
If above is not true, we lookup the plugin based
FWItemAccessorRegistry for a plugin that can handle the
given type.
If the type is not a collection but it contains only
one element which is a collection, we return a
FWItemTVirtualCollectionProxyAccessor using the
TVirtualCollectionProxy of that element.
If none of the above is true, we lookup the plugin based
FWItemAccessorRegistry for a plugin that can handle the
given type.
Failing that, we return a FWItemSingleAccessor which threats
the object as if it was not a collection. Notice that this also will
mean that the product associated to @a iClass will not show up in the
Expand All @@ -107,19 +107,6 @@ FWItemAccessorFactory::accessorFor(const TClass* iClass) const
new FWItemTVirtualCollectionProxyAccessor(iClass,
boost::shared_ptr<TVirtualCollectionProxy>(iClass->GetCollectionProxy()->Generate())));
}
else if (hasMemberTVirtualCollectionProxy(iClass, member,offset))
{
if (debug)
fwLog(fwlog::kDebug) << "class "<< iClass->GetName()
<< " only contains data member " << member->GetName()
<< " which uses FWItemTVirtualCollectionProxyAccessor."
<< std::endl;

return boost::shared_ptr<FWItemAccessorBase>(
new FWItemTVirtualCollectionProxyAccessor(iClass,
boost::shared_ptr<TVirtualCollectionProxy>(member->GetCollectionProxy()->Generate()),
offset));
}

// Iterate on the available plugins and use the one which handles
// the iClass type.
Expand All @@ -137,6 +124,20 @@ FWItemAccessorFactory::accessorFor(const TClass* iClass) const
return boost::shared_ptr<FWItemAccessorBase>(FWItemAccessorRegistry::get()->create(accessorName, iClass));
}

if (hasMemberTVirtualCollectionProxy(iClass, member,offset))
{
if (debug)
fwLog(fwlog::kDebug) << "class "<< iClass->GetName()
<< " only contains data member " << member->GetName()
<< " which uses FWItemTVirtualCollectionProxyAccessor."
<< std::endl;

return boost::shared_ptr<FWItemAccessorBase>(
new FWItemTVirtualCollectionProxyAccessor(iClass,
boost::shared_ptr<TVirtualCollectionProxy>(member->GetCollectionProxy()->Generate()),
offset));
}

return boost::shared_ptr<FWItemAccessorBase>(new FWItemSingleAccessor(iClass));
}

Expand Down

0 comments on commit 764f442

Please sign in to comment.