2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
5 #include "VP1Base/VP1Msg.h"
8 inline const T* VP1SGAccessHelper::retrieve( const QString& key ) const
10 if (VP1Msg::verbose())
11 messageVerbose("retrieve(..) called with key = "+key+" for type "+QString(typeid(T).name()));
14 message("ERROR Does not have StoreGate pointer. Returning null pointer.");
19 message("ERROR retrieve called with empty key. Returning null pointer.");
23 if (!contains(ClassID_traits<T>::ID(),key)) {
24 messageDebug("WARNING retrieve called for key="+key+", which is not found in storeGate.");
29 bool exception = true;
32 t = storeGate()->retrieve<const T>(key.toStdString());
34 } catch (const std::runtime_error& e) {
39 message("ERROR: Exception thrown during call to StoreGateSvc::retrieve(..) with key="+key);
40 // sc.isFailure();//To make sure it is checked.
44 message("ERROR: Failed StoreGateSvc::retrieve(..) with key="+key+" claimed to be succesful, but resulted in NULL pointer.");
47 if (VP1Msg::verbose())
48 messageVerbose("Succesfully retrieved collection "+key);
53 inline bool VP1SGAccessHelper::retrieve( const T* & t, const QString& key ) const
60 inline bool VP1SGAccessHelper::retrieve(SG::ConstIterator<T>& begin, SG::ConstIterator<T>& end, bool silent )
63 if (VP1Msg::verbose())
64 messageVerbose("retrieve(DataHandle<"+QString(typeid(T).name())+">,DataHandle<"
65 +QString(typeid(T).name())+">) called.");
67 QString str("ERROR Does not have StoreGate pointer. Returning null pointer.");
68 silent ? messageVerbose(str) : message(str);
72 bool exception = true;
75 sc = storeGate()->retrieve(begin,end);
77 } catch (const std::runtime_error& e) {
81 QString str("ERROR: Exception thrown during call to StoreGateSvc::retrieve(DataHandle<"
82 +QString(typeid(T).name())+">,DataHandle<"+QString(typeid(T).name())+">)");
83 silent ? messageVerbose(str) : message(str);
84 sc.isFailure();//To make sure it is checked.
88 QString str( "ERROR: Failed StoreGateSvc::retrieve(DataHandle<"
89 +QString(typeid(T).name())+">,DataHandle<"
90 +QString(typeid(T).name())+">)");
91 silent ? messageVerbose(str) : message(str);
95 if (VP1Msg::verbose())
96 messageVerbose("Successfully retrieved datahandles to "+QString(typeid(T).name())+".");