LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
art::FindOne< ProdB, Data > Class Template Reference

#include "FindOne.h"

Public Types

using dataColl_t = std::vector< Data const * >
 
using value_type = typename base::value_type
 
using size_type = typename base::size_type
 
using difference_type = typename base::difference_type
 
using const_reference = typename base::const_reference
 
using reference = typename base::reference
 
using assoc_t = typename base::assoc_t
 
using data_const_pointer = Data const *
 
using data_const_reference = Data const &
 
using data_reference = Data &
 
using data_t = Data
 

Public Member Functions

template<typename Handle , typename DataContainer , typename Tag >
 FindOne (Handle const &aCollection, DataContainer const &dc, Tag const &tag, std::enable_if_t< detail::is_handle< Handle >::value > *=nullptr)
 
template<typename ProdAColl , typename DataContainer , typename Tag >
 FindOne (ProdAColl const &view, DataContainer const &dc, Tag const &tag, std::enable_if_t< std::is_pointer< typename ProdAColl::value_type >::value > *=nullptr)
 
template<typename PtrProdAColl , typename DataContainer , typename Tag >
 FindOne (PtrProdAColl const &aPtrColl, DataContainer const &dc, Tag const &tag, std::enable_if_t< std::is_same< typename PtrProdAColl::value_type, art::Ptr< typename PtrProdAColl::value_type::value_type > >::value > *=nullptr)
 
template<typename ProdA , typename DataContainer , typename Tag >
 FindOne (std::initializer_list< Ptr< ProdA > > const &ptrs, DataContainer const &dc, Tag const &tag)
 
cet::maybe_ref< Data const > data (size_type i) const
 
void get (size_type i, cet::maybe_ref< assoc_t const > &item, cet::maybe_ref< Data const > &data) const
 
bool operator== (FindOne< ProdB, Data > const &other) const
 

Private Types

using base = FindOne< ProdB, void >
 

Private Attributes

dataColl_t dataCollection_ {}
 

Detailed Description

template<typename ProdB, typename Data>
class art::FindOne< ProdB, Data >

Definition at line 133 of file FindOne.h.

Member Typedef Documentation

template<typename ProdB, typename Data>
using art::FindOne< ProdB, Data >::assoc_t = typename base::assoc_t

Definition at line 222 of file FindOne.h.

template<typename ProdB, typename Data>
using art::FindOne< ProdB, Data >::base = FindOne<ProdB, void>
private

Definition at line 214 of file FindOne.h.

template<typename ProdB, typename Data>
using art::FindOne< ProdB, Data >::const_reference = typename base::const_reference

Definition at line 220 of file FindOne.h.

template<typename ProdB, typename Data>
using art::FindOne< ProdB, Data >::data_const_pointer = Data const*

Definition at line 224 of file FindOne.h.

template<typename ProdB, typename Data>
using art::FindOne< ProdB, Data >::data_const_reference = Data const&

Definition at line 225 of file FindOne.h.

template<typename ProdB, typename Data>
using art::FindOne< ProdB, Data >::data_reference = Data&

Definition at line 226 of file FindOne.h.

template<typename ProdB, typename Data>
using art::FindOne< ProdB, Data >::data_t = Data

Definition at line 227 of file FindOne.h.

template<typename ProdB, typename Data>
using art::FindOne< ProdB, Data >::dataColl_t = std::vector<Data const*>

Definition at line 216 of file FindOne.h.

template<typename ProdB, typename Data>
using art::FindOne< ProdB, Data >::difference_type = typename base::difference_type

Definition at line 219 of file FindOne.h.

template<typename ProdB, typename Data>
using art::FindOne< ProdB, Data >::reference = typename base::reference

Definition at line 221 of file FindOne.h.

template<typename ProdB, typename Data>
using art::FindOne< ProdB, Data >::size_type = typename base::size_type

Definition at line 218 of file FindOne.h.

template<typename ProdB, typename Data>
using art::FindOne< ProdB, Data >::value_type = typename base::value_type

Definition at line 217 of file FindOne.h.

Constructor & Destructor Documentation

template<typename ProdB , typename Data >
template<typename Handle , typename DataContainer , typename Tag >
art::FindOne< ProdB, Data >::FindOne ( Handle const &  aCollection,
DataContainer const &  dc,
Tag const &  tag,
std::enable_if_t< detail::is_handle< Handle >::value > *  = nullptr 
)

Definition at line 425 of file FindOne.h.

References art::FindOne< ProdB, void >::bCollection(), art::FindOne< ProdB, Data >::dataCollection_, art::detail::input_tag(), and art::FindOne< ProdB, void >::setStoredException().

Referenced by art::FindOne< ProdB, void >::FindOne(), art::FindOne< ProdB, Data >::FindOne(), and art::FindOne< ProdB, void >::throwIfInvalid().

429 {
430  using ProdA = typename Handle::element_type::value_type;
431  detail::IPRHelper<ProdA, ProdB, Data, dataColl_t, DataContainer> finder{dc, detail::input_tag(tag)};
433 }
InputTag input_tag(InputTag const &tag)
Definition: IPRHelper.h:21
dataColl_t dataCollection_
Definition: FindOne.h:273
void setStoredException(std::shared_ptr< art::Exception const > &&e)
Definition: FindOne.h:403
template<typename ProdB , typename Data >
template<typename ProdAColl , typename DataContainer , typename Tag >
art::FindOne< ProdB, Data >::FindOne ( ProdAColl const &  view,
DataContainer const &  dc,
Tag const &  tag,
std::enable_if_t< std::is_pointer< typename ProdAColl::value_type >::value > *  = nullptr 
)

Definition at line 438 of file FindOne.h.

References art::FindOne< ProdB, void >::bCollection(), art::FindOne< ProdB, Data >::dataCollection_, art::FindOne< ProdB, Data >::FindOne(), art::detail::input_tag(), and art::FindOne< ProdB, void >::setStoredException().

442 {
443  using ProdA = std::remove_const_t<std::remove_pointer_t<typename ProdAColl::value_type>>;
444  detail::IPRHelper<ProdA, ProdB, Data, dataColl_t, DataContainer> finder{dc, detail::input_tag(tag)};
446 }
InputTag input_tag(InputTag const &tag)
Definition: IPRHelper.h:21
dataColl_t dataCollection_
Definition: FindOne.h:273
void setStoredException(std::shared_ptr< art::Exception const > &&e)
Definition: FindOne.h:403
template<typename ProdB , typename Data >
template<typename PtrProdAColl , typename DataContainer , typename Tag >
art::FindOne< ProdB, Data >::FindOne ( PtrProdAColl const &  aPtrColl,
DataContainer const &  dc,
Tag const &  tag,
std::enable_if_t< std::is_same< typename PtrProdAColl::value_type, art::Ptr< typename PtrProdAColl::value_type::value_type > >::value > *  = nullptr 
)

Definition at line 451 of file FindOne.h.

References art::FindOne< ProdB, void >::bCollection(), art::FindOne< ProdB, Data >::dataCollection_, art::FindOne< ProdB, Data >::FindOne(), art::detail::input_tag(), and art::FindOne< ProdB, void >::setStoredException().

456 {
457  using ProdA = typename PtrProdAColl::value_type::value_type;
458  detail::IPRHelper<ProdA, ProdB, Data, dataColl_t, DataContainer> finder{dc, detail::input_tag(tag)};
460 }
InputTag input_tag(InputTag const &tag)
Definition: IPRHelper.h:21
dataColl_t dataCollection_
Definition: FindOne.h:273
void setStoredException(std::shared_ptr< art::Exception const > &&e)
Definition: FindOne.h:403
template<typename ProdB , typename Data >
template<typename ProdA , typename DataContainer , typename Tag >
art::FindOne< ProdB, Data >::FindOne ( std::initializer_list< Ptr< ProdA > > const &  ptrs,
DataContainer const &  dc,
Tag const &  tag 
)

Definition at line 465 of file FindOne.h.

References art::FindOne< ProdB, void >::bCollection(), art::FindOne< ProdB, Data >::data(), art::FindOne< ProdB, Data >::dataCollection_, art::detail::input_tag(), and art::FindOne< ProdB, void >::setStoredException().

468 {
469  detail::IPRHelper<ProdA, ProdB, Data, dataColl_t, DataContainer> finder{dc, detail::input_tag(tag)};
471 }
InputTag input_tag(InputTag const &tag)
Definition: IPRHelper.h:21
dataColl_t dataCollection_
Definition: FindOne.h:273
void setStoredException(std::shared_ptr< art::Exception const > &&e)
Definition: FindOne.h:403

Member Function Documentation

template<typename ProdB , typename Data >
cet::maybe_ref< Data const > art::FindOne< ProdB, Data >::data ( size_type  i) const
inline

Definition at line 477 of file FindOne.h.

References art::FindOne< ProdB, Data >::dataCollection_, art::FindOne< ProdB, Data >::get(), and art::FindOne< ProdB, void >::throwIfInvalid().

Referenced by art::FindOne< ProdB, Data >::FindOne().

478 {
480  return cet::maybe_ref<Data const>{*dataCollection_.at(i)};
481 }
dataColl_t dataCollection_
Definition: FindOne.h:273
void throwIfInvalid() const
Definition: FindOne.h:412
template<typename ProdB , typename Data >
void art::FindOne< ProdB, Data >::get ( size_type  i,
cet::maybe_ref< assoc_t const > &  item,
cet::maybe_ref< Data const > &  data 
) const
inline

Definition at line 487 of file FindOne.h.

References art::FindOne< ProdB, Data >::dataCollection_, art::FindOne< ProdB, void >::get(), and art::FindOne< ProdB, Data >::operator==().

Referenced by art::FindOne< ProdB, void >::at(), art::FindOne< ProdB, Data >::data(), and art::FindOne< ProdB, void >::isValid().

494 {
495  base::get(i, item); // Will check validity.
496  data.reseat(*dataCollection_.at(i));
497 }
void get(size_type i, cet::maybe_ref< assoc_t const > &item) const
Definition: FindOne.h:373
dataColl_t dataCollection_
Definition: FindOne.h:273
cet::maybe_ref< Data const > data(size_type i) const
Definition: FindOne.h:477
template<typename ProdB , typename Data >
bool art::FindOne< ProdB, Data >::operator== ( FindOne< ProdB, Data > const &  other) const
inline

Definition at line 503 of file FindOne.h.

References art::FindOne< ProdB, Data >::dataCollection_, and art::FindOne< ProdB, void >::operator==().

Referenced by art::FindOne< ProdB, void >::get(), and art::FindOne< ProdB, Data >::get().

504 {
505  return this->base::operator==(other) && // Will check validity.
506  dataCollection_ == other.dataCollection_;
507 }
bool operator==(FindOne< ProdB, void > const &other) const
Definition: FindOne.h:393
dataColl_t dataCollection_
Definition: FindOne.h:273

Member Data Documentation

template<typename ProdB, typename Data>
dataColl_t art::FindOne< ProdB, Data >::dataCollection_ {}
private

The documentation for this class was generated from the following file: