2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5 * @file D3PDMakerUtils/BlockFillerTool.h
6 * @author scott snyder <snyder@bnl.gov>
8 * @brief Template definitions for BlockFillerTool.
16 * @brief Standard Gaudi tool constructor.
17 * @param type The name of the tool type.
18 * @param name The tool name.
19 * @param parent The tool's Gaudi parent.
22 BlockFillerTool<T>::BlockFillerTool (const std::string& type,
23 const std::string& name,
24 const IInterface* parent)
25 : BlockFillerToolImpl (type, name, parent)
27 // cppcheck-suppress missingReturn; false positive
32 * @brief Configure during initialization: type-check.
33 * @param tree Our parent for tuple making.
34 * @param ti Gives the type of the object being passed to @c fillUntyped.
36 * @c configureD3PD should check that the type of the object coming as input
37 * is compatible with what it expects, and raise an error otherwise.
41 BlockFillerTool<T>::configureD3PD (IAddVariable* tree,
42 const std::type_info& ti)
44 return configureImpl (tree, ti, typeid(T));
49 * @brief Fill one block.
50 * @param p The input object.
51 * @param again Set if this is a subsequent call requested by an AGAIN return
53 * This is called once per object. The type of the object at which @c p
54 * points is given by the @c ti argument to @c configureD3PD. The caller
55 * is responsible for arranging that all the pointers for booked variables
56 * are set appropriately upon entry.
58 * If the return status is the special code @c AGAIN (defined above),
59 * then this filler tool wants to make multiple entries.
60 * The parent should set up to capture a new `row' and run
61 * through the list of block filler
62 * tools again, but for this tool call @c fillAgainUntyped
63 * instead of @c fillUntyped. This should be repeated as long
64 * as @c fillAgainUntyped returns @c AGAIN.
66 * Once @c fillUntyped returns @c AGAIN, the parent should
67 * call @c fillUntyped with the same @a p argument and @c again
68 * set to @c true. This continues until @c fillUntyped returns something
69 * other than @c AGAIN.
71 * Not all parents may support this. In that case, returning
72 * @c AGAIN will be treated as an error.
76 BlockFillerTool<T>::fillUntyped (const void* p,
77 bool again /*= false*/)
79 if (!p) return StatusCode::SUCCESS;
80 StatusCode stat = convert (p);
84 return fillAgain (*reinterpret_cast<const T*> (p));
85 return fill (*reinterpret_cast<const T*> (p));
91 * @brief Fill one block, after @c AGAIN has been returned (type-safe).
92 * @param p The input object.
94 * Once @c fill returns @c AGAIN, the parent should
95 * call @c fillAgain with the same arguments.
96 * This continues until @c fillAgain returns something
97 * other than @c AGAIN.
99 * By default, this just calls @c fill().
102 StatusCode BlockFillerTool<T>::fillAgain (const T& p)
104 return this->fill (p);