ATLAS Offline Software
Loading...
Searching...
No Matches
IDCCacheCreatorBase.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include "AthViews/View.h"
7
8bool IDCCacheCreatorBase::isInsideView(const EventContext& context) const
9{
10 const IProxyDict* proxy = Atlas::getExtendedEventContext(context).proxy();
11 const SG::View* view = dynamic_cast<const SG::View*>(proxy);
12 return view != nullptr;
13}
14
15IDCCacheCreatorBase::IDCCacheCreatorBase(const std::string &name,ISvcLocator *pSvcLocator) :
16AthReentrantAlgorithm(name,pSvcLocator)
17{
18
19}
20
21StatusCode IDCCacheCreatorBase::checkInsideViewOnce(const EventContext& ctx) const
22{
23 if(!m_disableWarningCheck.test_and_set(std::memory_order_relaxed)){ //Only check once
24 if(isInsideView(ctx)){
25 ATH_MSG_ERROR("CacheCreator is running inside a view, this is probably a misconfiguration");
26 return StatusCode::FAILURE;
27 }
28 }
29 return StatusCode::SUCCESS;
30}
#define ATH_MSG_ERROR(x)
An algorithm that can be simultaneously executed in multiple threads.
IDCCacheCreatorBase(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
StatusCode checkInsideViewOnce(const EventContext &) const
bool isInsideView(const EventContext &) const
A "view" of the event store (IProxyDict).
Definition View.h:46
const ExtendedEventContext & getExtendedEventContext(const EventContext &ctx)
Retrieve an extended context from a context object.