|
ATLAS Offline Software
|
Go to the documentation of this file.
27 #include "AthLinks/DataLink.h"
28 #include "AthLinks/ElementLink.h"
38 ISvcLocator* pSvcLocator) :
80 return StatusCode::SUCCESS;
106 dobj = std::make_unique<MyDataObj>(1);
113 dobj = std::make_unique<MyDataObj>(2));
119 dobj3 = std::make_unique<MyDataObj>(3);
129 ATH_CHECK( dobj4.recordOrRetrieve (std::make_unique<MyDataObj>(4)) );
131 ATH_CHECK( dobj4.recordOrRetrieve (std::make_unique<MyDataObj>(4)) );
132 assert (pp == &*dobj4);
140 ATH_CHECK(
h.record (std::make_unique<MyDataObj> (
i+100)) );
151 cobj->push_back (std::make_unique<MyContObj> (11.3, 132));
152 cobj->push_back (std::make_unique<MyContObj> (41.7, 291));
156 vFloat = std::make_unique<std::vector<float> >();
157 vFloat->push_back(1.0);
158 vFloat->push_back(2.0);
159 vFloat->push_back(3.0);
162 ATH_CHECK(
m.record (std::make_unique<MapStringFloat>()) );
227 dobj2 = std::make_unique<MyDataObj> (2);
251 VecElemLink thirdElementLink(*vFloat, 2);
256 float& anElement = vFloat->operator[](0);
261 aLink.toContainedElement(*vFloat, anElement);
268 pLinkList = std::make_unique<std::list<VecElemLink> >();
269 pLinkList->push_back(aLink);
270 pLinkList->push_back(thirdElementLink);
277 linkVector = std::make_unique<std::vector<MapElemLink> >();
278 linkVector->push_back(MapElemLink(*
m,
"uno"));
280 mLink.toContainedElement(*
m, (*
m)[
"due"]);
281 linkVector->push_back(mLink);
288 if ( (
evtStore()->symLink(dobj.
cptr(), pDO)).isFailure() ) {
294 if ( (
evtStore()->symLink(dobj3.cptr(), pDO)).isFailure() ) {
302 ATH_MSG_INFO (
" StoreGate structure before returning from execute \n"
305 return StatusCode::SUCCESS;
313 return StatusCode::SUCCESS;
321 return StatusCode::FAILURE;
SG::WriteHandleKey< DataVector< MyContObj > > m_cobjKey
Testing reentrant algorithms.
virtual StatusCode initialize() override final
virtual StatusCode execute(const EventContext &ctx) const override final
SG::WriteHandleKey< std::vector< float > > m_vFloatKey
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
SG::WriteHandleKey< std::vector< ElementLink< MapStringFloat > > > m_linkVectorKey
#define EXPECT_EXCEPTION(EXC, CODE)
Helper to check that an exception is thrown.
const_pointer_type cptr() const
Dereference the pointer.
SG::WriteHandleKey< std::list< ElementLink< std::vector< float > > > > m_pLinkListKey
bool empty() const
Test if the key is blank.
SG::WriteHandleKey< MyDataObj > m_dobjKey3
An algorithm that can be simultaneously executed in multiple threads.
SG::DataObjectSharedPtr< TestDataObject > m_testObject
StatusCode onError() const
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
WriteDataReentrant(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode finalize() override final
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
SG::WriteHandleKey< MyDataObj > m_dobjKey
Handle class for recording to StoreGate.
Object reference supporting deferred reading from StoreGate.
::StatusCode StatusCode
StatusCode definition for legacy code.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
ElementLink implementation for ROOT usage.
SG::WriteHandleKey< MyDataObj > m_dobjKey2
SG::WriteHandleKeyArray< MyDataObj > m_dobjKeyArray
static void hideErrorLocus(bool flag=true)
If set to true, hide the source file and line number in the output.
Helpers for checking error return status codes and reporting errors.
void toStorableObject(const_reference data, IProxyDict *sg=0)
Set the link to an object given by a reference.
SG::WriteHandleKey< MapStringFloat > m_mKey
Helper to check that an exception is thrown.
An STL vector of pointers that by default owns its pointed-to elements.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
#define ATH_MSG_WARNING(x)
SG::WriteHandleKey< TestDataObject > m_testObjectKey