ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
DataModelTest
DataModelTestDataRead
src
AllocTestWriteWithAlloc.cxx
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration.
3
*/
10
11
12
#include "
AllocTestWriteWithAlloc.h
"
13
#include "
DataModelTestDataRead/AllocTestAuxContainer.h
"
14
15
16
namespace
DMTest
{
17
18
22
StatusCode
AllocTestWriteWithAlloc::initialize
()
23
{
24
ATH_CHECK
(
m_containerKey
.initialize() );
25
return
StatusCode::SUCCESS;
26
}
27
28
32
StatusCode
AllocTestWriteWithAlloc::execute
(
const
EventContext& ctx)
const
33
{
34
static
const
SG::AuxElement::Accessor<int, std::pmr::polymorphic_allocator<int> >
35
atInt3 (
"atInt3"
);
36
static
const
SG::AuxElement::Accessor<int, Athena_test::TestAlloc<int> >
37
atInt4 (
"atInt4"
);
38
39
SG::WriteHandle<AllocTestContainer>
cont (
m_containerKey
, ctx);
40
ATH_CHECK
( cont.
record
(std::make_unique<AllocTestContainer>(),
41
std::make_unique<AllocTestAuxContainer>()) );
42
43
for
(
size_t
i = 0; i < 10; i++) {
44
cont->push_back (std::make_unique<AllocTest>());
45
cont->back()->setAtInt1 (ctx.evt()*100 + i);
46
cont->back()->setAtInt2 (ctx.evt()*100 + i + 10);
47
atInt3(*cont->back()) = ctx.evt()*100 + i + 20;
48
atInt4(*cont->back()) = ctx.evt()*100 + i + 30;
49
}
50
return
StatusCode::SUCCESS;
51
}
52
53
54
}
// namespace DMTest
AllocTestWriteWithAlloc.h
Test writing AllocTest with a non-default allocator.
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
AllocTestAuxContainer.h
Testing an xAOD object with a non-standard memory allocator.
DMTest::AllocTestWriteWithAlloc::execute
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm event processing.
Definition
AllocTestWriteWithAlloc.cxx:32
DMTest::AllocTestWriteWithAlloc::initialize
virtual StatusCode initialize() override
Gaudi initialize method.
Definition
AllocTestWriteWithAlloc.cxx:22
DMTest::AllocTestWriteWithAlloc::m_containerKey
SG::WriteHandleKey< AllocTestContainer > m_containerKey
Definition
AllocTestWriteWithAlloc.h:54
SG::WriteHandle
Definition
StoreGate/StoreGate/WriteHandle.h:73
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
DMTest
Definition
B.h:23
Generated on
for ATLAS Offline Software by
1.17.0