Skip to content
Snippets Groups Projects
Commit 5b31ffa1 authored by Scott Snyder's avatar Scott Snyder Committed by Adam Edward Barton
Browse files

IOVSvc: Fix ubsan warning; general cleanup.

Remove releaseTool calls from finalize().
They're not really needed, and it's possible for the tools to be
deleted before this is called, which results in warnings
from the ub sanitizer.

Also do some general cleanup.
parent d592c835
No related branches found
No related tags found
No related merge requests found
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef ATHENAKERNEL_IIOVSVC_H #ifndef ATHENAKERNEL_IIOVSVC_H
...@@ -39,8 +39,7 @@ namespace SG { ...@@ -39,8 +39,7 @@ namespace SG {
class IIOVSvc : virtual public IService { class IIOVSvc : virtual public IService {
public: public:
/// Retrieve interface ID DeclareInterfaceID (IIOVSvc, 1, 0);
static const InterfaceID& interfaceID();
virtual StatusCode createIOVTool( const std::string& storeName ) = 0; virtual StatusCode createIOVTool( const std::string& storeName ) = 0;
virtual std::vector<std::string> getStoreNames() const = 0; virtual std::vector<std::string> getStoreNames() const = 0;
...@@ -153,11 +152,4 @@ public: ...@@ -153,11 +152,4 @@ public:
}; };
inline
const InterfaceID&
IIOVSvc::interfaceID() {
static const InterfaceID IID("IIOVSvc", 1, 0);
return IID;
}
#endif #endif
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef IOVSVC_IOVSVC_H #ifndef IOVSVC_IOVSVC_H
...@@ -18,51 +18,20 @@ ...@@ -18,51 +18,20 @@
*****************************************************************************/ *****************************************************************************/
#include "AthenaBaseComps/AthService.h" #include "AthenaBaseComps/AthService.h"
#ifndef KERNEL_STATUSCODES_H
#include "GaudiKernel/StatusCode.h" #include "GaudiKernel/StatusCode.h"
#endif
#ifndef GAUDIKERNEL_CLASSID_H
#include "GaudiKernel/ClassID.h" #include "GaudiKernel/ClassID.h"
#endif
#ifndef GAUDIKERNEL_MSGSTREAM_H
#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/MsgStream.h"
#endif
#ifndef SGTOOLS_DATAPROXY_H
#include "SGTools/DataProxy.h" #include "SGTools/DataProxy.h"
#endif
#ifndef ATHENAKERNEL_IIOVSVC_H
#include "AthenaKernel/IIOVSvc.h" #include "AthenaKernel/IIOVSvc.h"
#endif
#ifndef IOVSVC_IOVENTRY_H
#include "IOVSvc/IOVEntry.h" #include "IOVSvc/IOVEntry.h"
#endif
#ifndef SGTOOLS_CALLBACKID_H
#include "SGTools/CallBackID.h" #include "SGTools/CallBackID.h"
#endif
#ifndef ATHENAKERNEL_IOVTIME_H
#include "AthenaKernel/IOVTime.h" #include "AthenaKernel/IOVTime.h"
#endif
#ifndef ATHENAKERNEL_IOVSVCDEFS_H
#include "AthenaKernel/IOVSvcDefs.h" #include "AthenaKernel/IOVSvcDefs.h"
#endif
#include "IOVSvc/IIOVSvcTool.h" #include "IOVSvc/IIOVSvcTool.h"
#ifndef _CPP_SET
#include <set> #include <set>
#endif
#ifndef _CPP_MAP
#include <map> #include <map>
#endif
#ifndef _CPP_LIST
#include <list> #include <list>
#endif
#ifndef _CPP_STRING
#include <string> #include <string>
#endif
#include <mutex> #include <mutex>
#include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ServiceHandle.h"
...@@ -82,112 +51,110 @@ namespace SG { ...@@ -82,112 +51,110 @@ namespace SG {
class DataProxy; class DataProxy;
} }
class IOVSvc: virtual public AthService, class IOVSvc: public extends<AthService, IIOVSvc>
virtual public IIOVSvc { {
public: public:
IOVSvc( const std::string& name, ISvcLocator* svc ); IOVSvc( const std::string& name, ISvcLocator* svc );
virtual ~IOVSvc(); virtual ~IOVSvc();
virtual StatusCode initialize(); virtual StatusCode initialize() override;
virtual StatusCode reinitialize(); virtual StatusCode reinitialize() override;
virtual StatusCode finalize(); virtual StatusCode finalize() override;
/// Query the interfaces. virtual StatusCode createIOVTool( const std::string& storeName ) override;
virtual StatusCode queryInterface( const InterfaceID& riid, void** ppvInterface ); virtual std::vector<std::string> getStoreNames() const override;
/// static const InterfaceID& interfaceID();
StatusCode createIOVTool( const std::string& storeName );
std::vector<std::string> getStoreNames() const;
/// register callback functions /// register callback functions
virtual
StatusCode regFcn(SG::DataProxy *dp, const CallBackID c, StatusCode regFcn(SG::DataProxy *dp, const CallBackID c,
const IOVSvcCallBackFcn& fcn, bool trigger=false); const IOVSvcCallBackFcn& fcn, bool trigger=false) override;
virtual
StatusCode regFcn(const CallBackID c1, StatusCode regFcn(const CallBackID c1,
const CallBackID c2, const IOVSvcCallBackFcn& fcn2, const CallBackID c2, const IOVSvcCallBackFcn& fcn2,
bool trigger); bool trigger) override;
virtual
StatusCode regFcn(const std::string& toolName, StatusCode regFcn(const std::string& toolName,
const CallBackID c2, const IOVSvcCallBackFcn& fcn2, const CallBackID c2, const IOVSvcCallBackFcn& fcn2,
bool trigger); bool trigger) override;
/// Update Range from dB /// Update Range from dB
virtual StatusCode setRange(const CLID& clid, const std::string& key, virtual StatusCode setRange(const CLID& clid, const std::string& key,
IOVRange&); IOVRange&) override;
virtual StatusCode setRange(const CLID& clid, const std::string& key, virtual StatusCode setRange(const CLID& clid, const std::string& key,
IOVRange& io, IOVRange& io,
const std::string& storeName); const std::string& storeName) override;
virtual StatusCode getRange(const CLID& clid, const std::string& key, virtual StatusCode getRange(const CLID& clid, const std::string& key,
IOVRange& io) const; IOVRange& io) const override;
/// Subscribe method for DataProxy. key StoreGate key /// Subscribe method for DataProxy. key StoreGate key
virtual StatusCode regProxy( const SG::DataProxy *proxy, virtual StatusCode regProxy( const SG::DataProxy *proxy,
const std::string& key, const std::string& key,
const std::string& storeName); const std::string& storeName) override;
/// replace a registered DataProxy with a new version /// replace a registered DataProxy with a new version
virtual StatusCode replaceProxy( const SG::DataProxy *pOld, virtual StatusCode replaceProxy( const SG::DataProxy *pOld,
const SG::DataProxy *pNew, const SG::DataProxy *pNew,
const std::string& storeName); const std::string& storeName) override;
/// Another way to subscribe /// Another way to subscribe
virtual StatusCode regProxy( const CLID& clid, const std::string& key, virtual StatusCode regProxy( const CLID& clid, const std::string& key,
const std::string& storeName ); const std::string& storeName ) override;
virtual StatusCode deregProxy( const SG::DataProxy *proxy ); virtual StatusCode deregProxy( const SG::DataProxy *proxy ) override;
virtual StatusCode deregProxy( const CLID& clid, const std::string& key ); virtual StatusCode deregProxy( const CLID& clid, const std::string& key ) override;
/// Get IOVRange from db for current event /// Get IOVRange from db for current event
virtual StatusCode getRangeFromDB(const CLID& clid, const std::string& key, virtual StatusCode getRangeFromDB(const CLID& clid, const std::string& key,
IOVRange& range, std::string &tag, IOVRange& range, std::string &tag,
IOpaqueAddress*& ioa) const; IOpaqueAddress*& ioa) const override;
/// Get IOVRange from db for a particular event /// Get IOVRange from db for a particular event
virtual StatusCode getRangeFromDB(const CLID& clid, const std::string& key, virtual StatusCode getRangeFromDB(const CLID& clid, const std::string& key,
const IOVTime& time, const IOVTime& time,
IOVRange& range, std::string &tag, IOVRange& range, std::string &tag,
IOpaqueAddress*& ioa) const; IOpaqueAddress*& ioa) const override;
/// Set a particular IOVRange in db (and memory) /// Set a particular IOVRange in db (and memory)
virtual StatusCode setRangeInDB(const CLID& clid, const std::string& key, virtual StatusCode setRangeInDB(const CLID& clid, const std::string& key,
const IOVRange& range, const IOVRange& range,
const std::string &tag); const std::string &tag) override;
/// supply a list of TADs whose proxies will be preloaded /// supply a list of TADs whose proxies will be preloaded
virtual StatusCode preLoadTAD( const SG::TransientAddress *, virtual StatusCode preLoadTAD( const SG::TransientAddress *,
const std::string& storeName ); const std::string& storeName ) override;
/// supply a list of TADs whose data will be preloaded /// supply a list of TADs whose data will be preloaded
virtual StatusCode preLoadDataTAD( const SG::TransientAddress *, virtual StatusCode preLoadDataTAD( const SG::TransientAddress *,
const std::string& storeName ); const std::string& storeName ) override;
/// return list of tools (or functions) that have been triggered by key /// return list of tools (or functions) that have been triggered by key
/// will return FAILURE if no tools found, or no key found /// will return FAILURE if no tools found, or no key found
virtual StatusCode getTriggeredTools(const std::string& key, virtual StatusCode getTriggeredTools(const std::string& key,
std::set<std::string>& tools, std::set<std::string>& tools,
const std::string& storeName); const std::string& storeName) override;
virtual void resetAllProxies(); virtual void resetAllProxies() override;
virtual void ignoreProxy(const CLID& clid, const std::string& key, virtual void ignoreProxy(const CLID& clid, const std::string& key,
const std::string& storeName); const std::string& storeName) override;
virtual StatusCode createCondObj(CondContBase*, const DataObjID&, virtual StatusCode createCondObj(CondContBase*, const DataObjID&,
const EventIDBase&); const EventIDBase&) override;
private: private:
bool createIOVTool(const std::string& storeName, IIOVSvcTool*& tool) const; StatusCode createIOVTool(const std::string& storeName, IIOVSvcTool*& tool);
IIOVSvcTool* getTool( const std::string& storeName, IIOVSvcTool* getTool( const std::string& storeName,
bool createIF=true ) const; bool createIF=true );
IIOVSvcTool* getTool( const CLID& clid, const std::string& key) const; IIOVSvcTool* getTool( const CLID& clid, const std::string& key) const;
IIOVSvcTool* getTool( const SG::DataProxy* proxy ) const; IIOVSvcTool* getTool( const SG::DataProxy* proxy ) const;
IIOVSvcTool* getTool( const CallBackID& c1 ) const; IIOVSvcTool* getTool( const CallBackID& c1 ) const;
...@@ -197,8 +164,7 @@ private: ...@@ -197,8 +164,7 @@ private:
typedef std::map< std::string, IIOVSvcTool* > toolMap; typedef std::map< std::string, IIOVSvcTool* > toolMap;
toolMap m_toolMap;
mutable toolMap m_toolMap;
BooleanProperty m_preLoadRanges, m_preLoadData, m_partialPreLoadData; BooleanProperty m_preLoadRanges, m_preLoadData, m_partialPreLoadData;
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment