2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
7 * @file D3PDMakerInterfaces/ICollectionGetterTool.icc
8 * @author scott snyder <snyder@bnl.gov>
10 * @brief Template implementations for ICollectionGetterTool.
18 * @brief Type-safe wrapper for @c next.
20 * Return the next element from the collection as a pointer to @c T.
21 * Return 0 if the pointer can't be converted or at the end of the
24 * This is implemented in terms of @c nextTypeinfo().
27 const T* ICollectionGetterTool::next()
29 return reinterpret_cast<const T*> (nextTypeinfo (typeid(T)));
34 * @brief Test type compatibility.
36 * Test to see if the object being returned by the tool can be converted
37 * to a pointer to @c T. This can be used to perform type checks during job
40 * This is implemented in terms of @c configureElementTypeinfo.
43 StatusCode ICollectionGetterTool::configureD3PD()
45 return configureElementTypeinfo (typeid(T));
50 * @brief Type-safe wrapper for @c releaseElementUntyped.
51 * @param p The element to release.
53 * Call this when you are done with the object returned by
54 * @c next(). The default implementation is a no-op,
55 * but if the getter dynamically allocated the object which
56 * it returned, this gives it a chance to free it.
58 * This is implemented in terms of @c releaseElementTypeinfo().
61 void ICollectionGetterTool::releaseElement (const T* p)
63 this->releaseElementTypeinfo (p, typeid(T));
68 * @brief Release an element retrieved from the getter.
69 * @param p The element to release.
70 * @param ti The type of p.
72 * Call this when you are done with the element returned by
73 * @c nextUntyped(). The default implementation is a no-op,
74 * but if the getter dynamically allocated the object which
75 * it returned, this gives it a chance to free it.
79 ICollectionGetterTool::releaseElementTypeinfo (const void* /*p*/,
80 const std::type_info& /*ti*/)