ATLAS Offline Software
Loading...
Searching...
No Matches
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*/
12
13
14#ifndef D3PDMAKERUTILS_SINGLEASSOCIATIONTOOLMULTI_H
15#define D3PDMAKERUTILS_SINGLEASSOCIATIONTOOLMULTI_H
16
17
20#ifndef D3PDMAKERUTILS_SINGLEASSOCIATIONTOOL_H // prevent recursive include
22#endif
23
24#include <cstdlib>
25
26
27
28namespace D3PD {
29
30
48template <class T0, class TO_T>
50 : public SingleAssociationToolTo<TO_T>
51{
52public:
59 SingleAssociationTool (const std::string& type,
60 const std::string& name,
61 const IInterface* parent);
62
63
72 virtual StatusCode configureD3PD (IAddVariable* tree,
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
134protected:
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
168private:
170 const std::type_info* m_fromTypeinfo;
171};
172
173
174} // namespace D3PD
175
176
178
179
180#endif // not D3PDMAKERUTILS_SINGLEASSOCIATIONTOOLMULTI_H
A simple tuple of multiple types.
Non-template parts of SingleAssociationTool.
Type-safe wrapper for single associator tools.
Common interface for adding a variable to a tuple.
SingleAssociationToolTo(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
virtual void push_ti(std::vector< const std::type_info * > &tis)
Helper to collect the list of type_info's that we accept.
virtual const void * getUntyped(const void *p) override
Return the target object.
const std::type_info * m_fromTypeinfo
type_info for the selected type.
virtual const SelectType< TO_T, 0 >::type * get(const T0 &p)=0
Return the target object.
size_t m_which
Index of which type we're expecting.
virtual const std::type_info & typeinfo() const override
Return the type of object retrieved by this tool.
SingleAssociationTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
virtual void releaseObjectUntyped(const void *p) override
Release an object retrieved from the association.
virtual StatusCode configureD3PD(IAddVariable *tree, const std::type_info &ti) override
Configure during initialization: type-check.
virtual const void * doGetUntyped(const void *p, size_t count)
Helper to decide which which get method to call.
virtual const std::type_info & fromTypeinfo() const override
Return the std::type_info for the source of the association.
virtual void releaseObject(const typename SelectType< TO_T, 0 >::type *) override
Release an object retrieved from the association.
virtual void doReleaseObjectUntyped(const void *p, size_t count)
virtual const std::type_info & doTypeinfo(size_t count) const
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:146
Block filler tool for noisy FEB information.
std::tuple< WrapType< TYPES >... > Types
A simple tuple of multiple types.
TChain * tree