ATLAS Offline Software
SingleAssociationToolMulti.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-2023 CERN for the benefit of the ATLAS collaboration
4 */
14 #ifndef D3PDMAKERUTILS_SINGLEASSOCIATIONTOOLMULTI_H
15 #define D3PDMAKERUTILS_SINGLEASSOCIATIONTOOLMULTI_H
16 
17 
18 #include "D3PDMakerUtils/Types.h"
20 #ifndef D3PDMAKERUTILS_SINGLEASSOCIATIONTOOL_H // prevent recursive include
22 #endif
23 
24 #include <cstdlib>
25 
26 
27 
28 namespace D3PD {
29 
30 
48 template <class T0, class TO_T>
49 class SingleAssociationTool<Types<T0>, TO_T>
50  : public SingleAssociationToolTo<TO_T>
51 {
52 public:
59  SingleAssociationTool (const std::string& type,
60  const std::string& name,
61  const IInterface* parent);
62 
63 
73  const std::type_info& ti) override;
74 
75 
83  virtual const void* getUntyped (const void* p) override;
84 
85 
89  virtual const std::type_info& fromTypeinfo() const override;
90 
91 
98  virtual const typename SelectType<TO_T, 0>::type* get (const T0& p) = 0;
99 
100 
104  virtual const std::type_info& typeinfo() const override;
105 
106 
108 
118  virtual void releaseObject (const typename SelectType<TO_T, 0>::type* /*p*/)
119  override;
120 
121 
131  virtual void releaseObjectUntyped (const void* p) override;
132 
133 
134 protected:
136  size_t m_which;
137 
138 
149  virtual const void* doGetUntyped (const void* p, size_t count);
150 
151 
152  virtual void doReleaseObjectUntyped (const void* p, size_t count);
153 
154 
162  virtual void push_ti (std::vector<const std::type_info*>& tis);
163 
164 
165  virtual const std::type_info& doTypeinfo (size_t count) const;
166 
167 
168 private:
170  const std::type_info* m_fromTypeinfo;
171 };
172 
173 
174 } // namespace D3PD
175 
176 
178 
179 
180 #endif // not D3PDMAKERUTILS_SINGLEASSOCIATIONTOOLMULTI_H
D3PD::SingleAssociationTool< Types< T0 >, TO_T >::get
virtual const SelectType< TO_T, 0 >::type * get(const T0 &p)=0
Return the target object.
D3PD::SingleAssociationTool< Types< T0 >, TO_T >::m_fromTypeinfo
const std::type_info * m_fromTypeinfo
type_info for the selected type.
Definition: SingleAssociationToolMulti.h:170
D3PD::IAddVariable
Common interface for adding a variable to a tuple.
Definition: IAddVariable.h:70
tree
TChain * tree
Definition: tile_monitor.h:30
D3PD::SingleAssociationTool
Type-safe wrapper for single associator tools.
Definition: SingleAssociationTool.h:133
D3PD::Types
std::tuple< WrapType< TYPES >... > Types
A simple tuple of multiple types.
Definition: PhysicsAnalysis/D3PDMaker/D3PDMakerUtils/D3PDMakerUtils/Types.h:61
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
D3PD::SingleAssociationTool< Types< T0 >, TO_T >::m_which
size_t m_which
Index of which type we're expecting.
Definition: SingleAssociationToolMulti.h:136
SingleAssociationToolMulti.icc
SingleAssociationTool.h
Type-safe wrapper for single associator tools.
D3PD
Block filler tool for noisy FEB information.
Definition: CaloCellDetailsFillerTool.cxx:29
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
D3PD::SingleAssociationTool< Types< T0 >, TO_T >::configureD3PD
virtual StatusCode configureD3PD(IAddVariable *tree, const std::type_info &ti) override
Configure during initialization: type-check.
Types.h
A simple tuple of multiple types.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
D3PD::SingleAssociationTool< Types< T0 >, TO_T >::getUntyped
virtual const void * getUntyped(const void *p) override
Return the target object.
test_pyathena.parent
parent
Definition: test_pyathena.py:15
D3PD::SingleAssociationTool< Types< T0 >, TO_T >::SingleAssociationTool
SingleAssociationTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
D3PD::SingleAssociationTool< Types< T0 >, TO_T >::push_ti
virtual void push_ti(std::vector< const std::type_info * > &tis)
Helper to collect the list of type_info's that we accept.
D3PD::SingleAssociationTool< Types< T0 >, TO_T >::doTypeinfo
virtual const std::type_info & doTypeinfo(size_t count) const
D3PD::SingleAssociationTool< Types< T0 >, TO_T >::typeinfo
virtual const std::type_info & typeinfo() const override
Return the type of object retrieved by this tool.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
D3PD::SingleAssociationTool< Types< T0 >, TO_T >::doReleaseObjectUntyped
virtual void doReleaseObjectUntyped(const void *p, size_t count)
D3PD::SingleAssociationTool< Types< T0 >, TO_T >::doGetUntyped
virtual const void * doGetUntyped(const void *p, size_t count)
Helper to decide which which get method to call.
D3PD::SelectType::type
T type
Definition: PhysicsAnalysis/D3PDMaker/D3PDMakerUtils/D3PDMakerUtils/Types.h:73
D3PD::SingleAssociationTool< Types< T0 >, TO_T >::fromTypeinfo
virtual const std::type_info & fromTypeinfo() const override
Return the std::type_info for the source of the association.
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
D3PD::SingleAssociationTool< Types< T0 >, TO_T >::releaseObject
virtual void releaseObject(const typename SelectType< TO_T, 0 >::type *) override
Release an object retrieved from the association.
D3PD::SingleAssociationTool< Types< T0 >, TO_T >::releaseObjectUntyped
virtual void releaseObjectUntyped(const void *p) override
Release an object retrieved from the association.
D3PD::SingleAssociationToolTo
Helper for SingleAssociationTool.
Definition: SingleAssociationTool.h:36
SingleAssociationToolImpl.h
Non-template parts of SingleAssociationTool.