Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

74x Fireworks: fix MuonDigi accessor type #11805

Merged
merged 1 commit into from
Oct 24, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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