Skip to content
Snippets Groups Projects
Commit 54c86aeb authored by scott snyder's avatar scott snyder
Browse files

StoreGate: Remove StoreGate.h.

Remove obsolete StoreGate.h.
parent c107b668
No related branches found
No related tags found
No related merge requests found
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef STOREGATE_STOREGATE_H
#define STOREGATE_STOREGATE_H
/** @class StoreGate
* @brief a multipleton that provides access to StoreGateSvc instances
* @author ATLAS Collaboration
* $Id: StoreGate.h,v 1.10 2003-04-16 01:58:11 calaf Exp $
**/
#include "StoreGate/StoreGateSvc.h"
#include <string>
class NullType;
class ActiveStoreSvc;
class StoreGate {
public:
/// returns active store ptr (see ActiveStoreSvc). Can be slow: use sparingly
static StoreGateSvc* pointer();
/// returns active store ref (see ActiveStoreSvc). Can be slow: use sparingly
static StoreGateSvc& instance();
/// returns ptr to ActiveStoreSvc. Cache it and use it to access active store
/// multiple times
static ActiveStoreSvc* activeStoreSvc();
/** multipleton: get a store by name
* @param sgID name of the StoreGateSvc ptr to be returned */
static StoreGateSvc* pointer(const std::string& sgID);
/** multipleton: get a store by name
* @param sgID name of the StoreGateSvc ptr to be returned
* @throws std::runtime_error if not found*/
static StoreGateSvc& instance(const std::string& sgID);
friend class NullType; //remove compiler warning
protected:
~StoreGate(); //FIXME avoid compiler warning for private
private:
//standard singleton stuff
StoreGate();
StoreGate(StoreGate&);
StoreGate& operator=(const StoreGate&);
};
#endif // STOREGATE_STOREGATE_H
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#include "StoreGate/StoreGate.h"
#include "StoreGate/ActiveStoreSvc.h"
#include "StoreGate/tools/hash_functions.h"
#include <exception>
#include <iostream>
#include "GaudiKernel/Bootstrap.h"
#include "GaudiKernel/Kernel.h"
#include "GaudiKernel/ISvcLocator.h"
#include "GaudiKernel/IService.h"
using namespace std;
ActiveStoreSvc*
getActiveStoreSvc() {
ActiveStoreSvc* pASG(0);
static const bool CREATEIF(true);
if ((Gaudi::svcLocator()->service("ActiveStoreSvc", pASG, CREATEIF)).isSuccess()) {
pASG->addRef(); //FIXME WHO RELEASES?
return pASG;
} else {
#ifndef NDEBUG
cerr << __FILE__ << ':' << __LINE__ << ": "
<< "ERROR Could not locate ActiveStoreSvc " <<endl;
#endif
return 0;
}
}
StoreGateSvc*
getStore() {
ActiveStoreSvc* pASG(0);
StoreGateSvc* pSG(0);
static const bool CREATEIF(true);
if ((Gaudi::svcLocator()->service("ActiveStoreSvc", pASG, CREATEIF)).isSuccess() &&
0 != (pSG = pASG->operator->())) {
pSG->addRef(); //FIXME WHO RELEASES?
return pSG;
} else {
#ifndef NDEBUG
cerr << __FILE__ << ':' << __LINE__ << ": "
<< "ERROR Could not locate active StoreGate " <<endl;
#endif
return 0;
}
}
StoreGateSvc*
getStore(std::string name) {
StoreGateSvc* pSGService(0);
static const bool CREATEIF(true);
if ((Gaudi::svcLocator()->service(name, pSGService, CREATEIF)).isSuccess()) {
pSGService->addRef();
return pSGService;
} else {
#ifndef NDEBUG
cerr << __FILE__ << ':' << __LINE__ << ": "
<< "ERROR Could not locate StoreGate "
<< "instance named " << name << endl;
#endif
return 0;
}
}
StoreGateSvc*
StoreGate::pointer() {
return getStore();
}
StoreGateSvc&
StoreGate::instance() {
StoreGateSvc* ptr(pointer());
if (0 == ptr) {
throw std::runtime_error("Could not locate active StoreGate ");
}
return *ptr;
}
ActiveStoreSvc*
StoreGate::activeStoreSvc() {
return getActiveStoreSvc();
}
StoreGateSvc*
StoreGate::pointer(const std::string& sgID) {
return getStore(sgID);
}
StoreGateSvc&
StoreGate::instance(const std::string& sgID) {
StoreGateSvc* ptr(pointer(sgID));
if (0 == ptr) {
throw std::runtime_error("Could not locate required StoreGate instance");
}
return *ptr;
}
......@@ -32,7 +32,6 @@
#include "StoreGate/SGWPtr.h"
#include "StoreGate/WriteHandle.h"
#include "StoreGate/ReadHandle.h"
#include "StoreGate/StoreGate.h"
#include "StoreGate/StoreGateSvc.h"
#include "SGTools/DataStore.h"
#include "SGTools/SGVersionedKey.h"
......
......@@ -23,7 +23,7 @@
#include "AthenaKernel/errorcheck.h"
#include "AthenaKernel/ExtendedEventContext.h"
#include "CxxUtils/checker_macros.h"
#include "StoreGate/StoreGate.h"
#include "StoreGate/StoreGateSvc.h"
#include <cassert>
#include <iostream>
......
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