ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaKernel
AthenaKernel
RecyclableDataObject.h
Go to the documentation of this file.
1
// This file's extension implies that it's C, but it's really -*- C++ -*-.
2
/*
3
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
4
*/
5
/*
6
*/
13
14
15
#ifndef ATHENAKERNEL_RECYCLABLEDATAOBJECT_H
16
#define ATHENAKERNEL_RECYCLABLEDATAOBJECT_H
17
18
19
// tbb/machine/gcc_generic.h has spurious trailing semicolons after
20
// the clz() functiosn (as of TBB 2019 U1).
21
#if defined(__GNUC__)
22
# pragma GCC diagnostic push
23
# pragma GCC diagnostic ignored "-Wpedantic"
24
#endif
25
#include "tbb/concurrent_queue.h"
26
#if defined(__GNUC__)
27
# pragma GCC diagnostic pop
28
#endif
29
#include <memory>
30
31
32
namespace
Athena
{
33
34
86
template
<
class
DOBJ>
87
class
RecyclableDataObject
:
public
DOBJ
88
{
89
public
:
91
typedef
tbb::concurrent_queue<DOBJ*> queue_t;
92
93
99
template
<
typename
... ARGS>
100
RecyclableDataObject
(std::shared_ptr<queue_t> queue, ARGS&&... args);
101
102
110
virtual
unsigned
long
release
()
override
;
111
112
113
private
:
115
std::shared_ptr<queue_t>
m_queue
;
116
};
117
118
124
template
<
class
DOBJ>
125
class
RecyclableDataQueue
126
{
127
public
:
129
typedef
typename
RecyclableDataObject<DOBJ>::queue_t
queue_t
;
130
131
135
RecyclableDataQueue
();
136
137
142
template
<
typename
... ARGS>
143
DOBJ*
get
(ARGS&&... args);
144
145
151
~RecyclableDataQueue
();
152
153
154
private
:
157
std::shared_ptr<queue_t>
m_queue
;
158
};
159
160
161
}
// namespace Athena
162
163
164
#include "
AthenaKernel/RecyclableDataObject.icc
"
165
166
167
#endif
// not ATHENAKERNEL_RECYCLABLEDATAOBJECT_H
RecyclableDataObject.icc
Athena::RecyclableDataQueue::m_queue
std::shared_ptr< queue_t > m_queue
Shared reference to the actual queue. Each data object also has a reference to the queue.
Definition
RecyclableDataObject.h:157
Athena::RecyclableDataQueue::get
DOBJ * get(ARGS &&... args)
Get an object, either a new one or one recycled from a previous event.
Athena::RecyclableDataQueue::queue_t
RecyclableDataObject< DOBJ >::queue_t queue_t
Underlying queue type holding these objects.
Definition
RecyclableDataObject.h:129
Athena::RecyclableDataQueue::RecyclableDataQueue
RecyclableDataQueue()
Constructor.
Athena::RecyclableDataQueue::~RecyclableDataQueue
~RecyclableDataQueue()
Destructor.
Athena
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc....
Definition
AthDsoUtils.h:10
Athena::m_queue
std::shared_ptr< queue_t > m_queue
The queue on which this object will be placed when it is recycled.
Definition
RecyclableDataObject.h:115
Athena::release
virtual unsigned long release() override
DataObject release method.
Athena::RecyclableDataObject
RecyclableDataObject(std::shared_ptr< queue_t > queue, ARGS &&... args)
Helper for recycling objects from event to event.
Generated on
for ATLAS Offline Software by
1.17.0