LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
FindManyInChainP.h
Go to the documentation of this file.
1 
11 #ifndef LARDATA_UTILITIES_FINDMANYINCHAINP_H
12 #define LARDATA_UTILITIES_FINDMANYINCHAINP_H
13 
14 // framework
17 
18 // C/C++ standard library
19 #include <vector>
20 #include <utility> // std::forward()
21 #include <initializer_list>
22 #include <cstdlib> // std::size_t
23 
24 
25 
26 namespace lar {
27 
28  namespace details {
29 
30  template <typename T, typename R = void>
32 
33  template <typename T, typename R = void>
35 
36  template <typename H, typename R = void>
39 
40  } // namespace details
41 
42 
44  struct SameAsDataTag {};
45 
48 
108  template <typename Target, typename... Intermediate>
110 
111  public:
112  using Target_t = Target;
114 
115 
117  using TargetPtrCollection_t = std::vector<TargetPtr_t>;
118 
134  template <typename Source, typename Event, typename... InputTags>
135  FindManyInChainP(Source&& source, Event const& event, InputTags... tags)
136  : results(find(std::forward<Source>(source), event, tags...))
137  {}
138 
139 
140 
142  std::size_t size() const noexcept;
143 
181  TargetPtrCollection_t const& at(std::size_t i) const;
182 
183 
220  template <typename Source, typename Event, typename... InputTags>
221  static std::vector<TargetPtrCollection_t> find
222  (Source&& source, Event const& event, InputTags... tags);
223 
224  private:
225  std::vector<TargetPtrCollection_t> results;
226 
227  }; // class FindManyInChainP<>
228 
229 
230 } // namespace lar
231 
232 
233 //------------------------------------------------------------------------------
234 //--- template implementation
235 //---
236 #include "FindManyInChainP.tcc" // expected in the same directory as this file
237 
238 //------------------------------------------------------------------------------
239 
240 
241 #endif // LARDATA_UTILITIES_FINDMANYINCHAINP_H
FindManyInChainP(Source &&source, Event const &event, InputTags...tags)
Constructor: extracts target objects associated to all objects under the specified handle...
enable_if_type_exists_t< typename std::decay_t< H >::HandleTag, R > enable_if_is_handle_t
STL namespace.
constexpr SameAsDataTag SameAsData
Value for default tag in FindManyInChainP constructors.
Type for default tag in FindManyInChainP constructors.
typename enable_if_type_exists< T, R >::type enable_if_type_exists_t
Double_t R
std::vector< TargetPtrCollection_t > results
Stored results.
Query object collecting a list of associated objects.
Target Target_t
Type of the associated objects.
std::vector< TargetPtr_t > TargetPtrCollection_t
Type returned by at() method.
LArSoft-specific namespace.
Definition: fwd.h:25
Event finding and building.