ATLAS Offline Software
Loading...
Searching...
No Matches
VP1SGAccessHelper.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5
7// //
8// Header file for class VP1SGAccessHelper //
9// //
10// Description: Helper class for safe StoreGate retrieval //
11// //
12// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
13// Initial version: March 2008 //
14// //
16
17#ifndef VP1SGACCESSHELPER_H
18#define VP1SGACCESSHELPER_H
19
22#include <stdexcept>
24
26public:
27
28 VP1SGAccessHelper( IVP1System *, const bool detStore = false );//For messages in gui (detStore=true takes detector rather than event store)
30 virtual ~VP1SGAccessHelper();
31
33 //Retrieve objects by type and key:
34 template <typename T>
35 bool retrieve( const T* &, const QString& key ) const;//returns false and sets to null pointer in case of errors
36
37 template <typename T>
38 const T* retrieve( const QString& key ) const;//returns a null pointer in case of errors
39
40
42 // Retrieve all objects of type T
43 template <typename T>
44 bool retrieve(SG::ConstIterator<T>& begin, SG::ConstIterator<T>& end, bool silent = false );//Returns false in case of errors.
45 //silent = true means all output will be redirected to verbose level
46 // -> NB: This DataHandle retrieval is something we should avoid in VP1!!!
47 // -> If you absolutely need to use it (due to bad implementations
48 // -> in upstream data providers), please use VP1SGContentsHelper
49 // -> to check that there is not more than one collection of the
50 // -> type you re trying to retrieve. If there is, abort!
51
52private:
53
56
57 class Imp;
59
60 StoreGateSvc * storeGate() const;
61 bool contains(const CLID& id, const QString&) const;
62};
63
65
66#endif
uint32_t CLID
The Class ID type.
a const_iterator facade to DataHandle.
Definition SGIterator.h:164
The Athena Transient Store API.
VP1HelperClassBase(IVP1System *sys=0, QString helpername="")
bool retrieve(SG::ConstIterator< T > &begin, SG::ConstIterator< T > &end, bool silent=false)
StoreGateSvc * storeGate() const
VP1SGAccessHelper & operator=(const VP1SGAccessHelper &)
bool retrieve(const T *&, const QString &key) const
bool contains(const CLID &id, const QString &) const
VP1SGAccessHelper(const VP1SGAccessHelper &)
VP1SGAccessHelper(IVP1System *, const bool detStore=false)
const T * retrieve(const QString &key) const