2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
7 * @file D3PDMakerUtils/CollectionGetterFilterTool.icc
8 * @author scott snyder <snyder@bnl.gov>
10 * @brief A collection getter that filters the results of another.
18 * @brief Standard Gaudi tool constructor.
19 * @param type The name of the tool type.
20 * @param name The tool name.
21 * @param parent The tool's Gaudi parent.
24 CollectionGetterFilterTool<T>::CollectionGetterFilterTool
25 (const std::string& type,
26 const std::string& name,
27 const IInterface* parent)
28 : CollectionGetterFilterToolImpl (type, name, parent)
34 * @brief Return the element type of the collection.
36 * I.e., @c nextUntyped returns a pointer to this type.
39 const std::type_info& CollectionGetterFilterTool<T>::elementTypeinfo() const
46 * @brief Return a pointer to the next element in the collection.
48 * Return 0 when the collection has been exhausted.
51 const void* CollectionGetterFilterTool<T>::nextUntyped()
53 // Loop until the filter passes.
54 while (const T* p = m_getter->next<T>()) {
58 m_getter->releaseElement<T> (p);
65 * @brief Release an object retrieved from the getter.
66 * @param p The object to release.
68 * Call this when you are done with the object returned by
69 * @c nextUntyped(). The default implementation is a no-op,
70 * but if the getter dynamically allocated the object which
71 * it returned, this gives it a chance to free it.
74 void CollectionGetterFilterTool<T>::releaseElementUntyped (const void* p)
76 m_getter->releaseElementUntyped (p);