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 Configure during initialization: type-check.
17 * @param tree Our parent for tuple making.
18 * @param ti Gives the type of the object being passed to @c fillUntyped.
20 * @c configureD3PD should check that the type of the object coming as input
21 * is compatible with what it expects, and raise an error otherwise.
25 BlockFillerTool<T>::configureD3PD (IAddVariable* tree,
26 const std::type_info& ti)
28 return configureImpl (tree, ti, typeid(T));
33 * @brief Fill one block.
34 * @param p The input object.
35 * @param again Set if this is a subsequent call requested by an AGAIN return
37 * This is called once per object. The type of the object at which @c p
38 * points is given by the @c ti argument to @c configureD3PD. The caller
39 * is responsible for arranging that all the pointers for booked variables
40 * are set appropriately upon entry.
42 * If the return status is the special code @c AGAIN (defined above),
43 * then this filler tool wants to make multiple entries.
44 * The parent should set up to capture a new `row' and run
45 * through the list of block filler
46 * tools again, but for this tool call @c fillAgainUntyped
47 * instead of @c fillUntyped. This should be repeated as long
48 * as @c fillAgainUntyped returns @c AGAIN.
50 * Once @c fillUntyped returns @c AGAIN, the parent should
51 * call @c fillUntyped with the same @a p argument and @c again
52 * set to @c true. This continues until @c fillUntyped returns something
53 * other than @c AGAIN.
55 * Not all parents may support this. In that case, returning
56 * @c AGAIN will be treated as an error.
60 BlockFillerTool<T>::fillUntyped (const void* p,
61 bool again /*= false*/)
63 if (!p) return StatusCode::SUCCESS;
64 StatusCode stat = convert (p);
68 return fillAgain (*reinterpret_cast<const T*> (p));
69 return fill (*reinterpret_cast<const T*> (p));
75 * @brief Fill one block, after @c AGAIN has been returned (type-safe).
76 * @param p The input object.
78 * Once @c fill returns @c AGAIN, the parent should
79 * call @c fillAgain with the same arguments.
80 * This continues until @c fillAgain returns something
81 * other than @c AGAIN.
83 * By default, this just calls @c fill().
86 StatusCode BlockFillerTool<T>::fillAgain (const T& p)
88 return this->fill (p);