LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
art::Assns< L, R, D > Class Template Reference

#include "Assns.h"

Public Types

using left_t = typename base::left_t
 
using right_t = typename base::right_t
 
using data_t = D
 
using partner_t = art::Assns< right_t, left_t, data_t >
 
using const_iterator = typename art::const_AssnsIter< L, R, D, Direction::Forward >
 
using const_reverse_iterator = typename art::const_AssnsIter< L, R, D, Direction::Reverse >
 
using size_type = typename base::size_type
 

Public Member Functions

 Assns ()
 
 Assns (partner_t const &other)
 
size_type size () const
 
const_iterator begin () const
 
const_iterator end () const
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
data_t const & data (typename std::vector< data_t >::size_type index) const
 
data_t const & data (const_iterator it) const
 
void addSingle (Ptr< left_t > const &left, Ptr< right_t > const &right, data_t const &data)
 
void swap (art::Assns< L, R, D > &other)
 
std::unique_ptr< EDProductmakePartner (std::type_info const &wanted_wrapper_type) const
 
void aggregate (Assns const &) const
 

Static Public Member Functions

static short Class_Version ()
 

Private Types

using base = Assns< L, R >
 

Private Member Functions

void swap_ (art::Assns< L, R, void > &other) override
 
std::unique_ptr< EDProductmakePartner_ (std::type_info const &wanted_wrapper_type) const override
 

Private Attributes

std::vector< data_tdata_
 

Friends

class art::Assns< right_t, left_t, data_t >
 

Detailed Description

template<typename L, typename R, typename D>
class art::Assns< L, R, D >

Definition at line 102 of file Assns.h.

Member Typedef Documentation

template<typename L, typename R, typename D>
using art::Assns< L, R, D >::base = Assns<L, R>
private

Definition at line 209 of file Assns.h.

template<typename L, typename R, typename D>
using art::Assns< L, R, D >::const_iterator = typename art::const_AssnsIter<L, R, D, Direction::Forward>

Definition at line 217 of file Assns.h.

template<typename L, typename R, typename D>
using art::Assns< L, R, D >::const_reverse_iterator = typename art::const_AssnsIter<L, R, D, Direction::Reverse>

Definition at line 219 of file Assns.h.

template<typename L, typename R, typename D>
using art::Assns< L, R, D >::data_t = D

Definition at line 214 of file Assns.h.

template<typename L, typename R, typename D>
using art::Assns< L, R, D >::left_t = typename base::left_t

Definition at line 212 of file Assns.h.

template<typename L, typename R, typename D>
using art::Assns< L, R, D >::partner_t = art::Assns<right_t, left_t, data_t>

Definition at line 215 of file Assns.h.

template<typename L, typename R, typename D>
using art::Assns< L, R, D >::right_t = typename base::right_t

Definition at line 213 of file Assns.h.

template<typename L, typename R, typename D>
using art::Assns< L, R, D >::size_type = typename base::size_type

Definition at line 220 of file Assns.h.

Constructor & Destructor Documentation

template<typename L , typename R , typename D >
art::Assns< L, R, D >::Assns ( )
inline

Definition at line 427 of file Assns.h.

References fhicl::detail::atom::value().

428 {
429  static_assert((!std::is_pointer<D>::value),
430  "Data template argument must not be pointer type!");
431 }
std::string value(boost::any const &)
template<typename L , typename R , typename D >
art::Assns< L, R, D >::Assns ( partner_t const &  other)

Definition at line 434 of file Assns.h.

435  : base(other), data_(other.data_)
436 {}
Assns< L, R > base
Definition: Assns.h:209
std::vector< data_t > data_
Definition: Assns.h:264

Member Function Documentation

template<typename L , typename R , typename D >
void art::Assns< L, R, D >::addSingle ( Ptr< left_t > const &  left,
Ptr< right_t > const &  right,
data_t const &  data 
)
inline

Definition at line 489 of file Assns.h.

References art::Assns< L, R, D >::data_.

Referenced by util::CreateAssn(), evgb::util::CreateAssn(), util::CreateAssnD(), evgb::util::CreateAssnD(), t0::IndirectHitParticleAssns::CreateHitParticleAssociations(), t0::DirectHitParticleAssns::CreateHitParticleAssociations(), trkf::Track3DKalmanHit::createOutputs(), and reco3d::SpacePointSolver::FillSystemToSpacePointsAndAssns().

492 {
494  data_.push_back(data);
495 }
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:112
data_t const & data(typename std::vector< data_t >::size_type index) const
Definition: Assns.h:475
std::vector< data_t > data_
Definition: Assns.h:264
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:104
void addSingle(Ptr< left_t > const &left, Ptr< right_t > const &right, data_t const &data)
Definition: Assns.h:489
template<typename L, typename R, typename D>
void art::Assns< L, R, D >::aggregate ( Assns< L, R, D > const &  ) const
inline

Definition at line 254 of file Assns.h.

255  {}
template<typename L , typename R , typename D >
art::Assns< L, R, D >::const_iterator art::Assns< L, R, D >::begin ( ) const
inline

Definition at line 447 of file Assns.h.

Referenced by trkf::KalmanFilterTrajectoryFitter::produce(), and trkf::KalmanFilterFinalTrackFitter::produce().

448 {
449  return const_iterator{*this, 0};
450 }
template<typename L, typename R, typename D>
static short art::Assns< L, R, D >::Class_Version ( )
inlinestatic

Definition at line 248 of file Assns.h.

249  {
250  return 11;
251  }
template<typename L , typename R , typename D >
art::Assns< L, R, D >::data_t const & art::Assns< L, R, D >::data ( typename std::vector< data_t >::size_type  index) const
inline

Definition at line 475 of file Assns.h.

References art::Assns< L, R, D >::data_.

476 {
477  return data_.at(index);
478 }
std::vector< data_t > data_
Definition: Assns.h:264
template<typename L , typename R , typename D >
art::Assns< L, R, D >::data_t const & art::Assns< L, R, D >::data ( const_iterator  it) const
inline

Definition at line 482 of file Assns.h.

References art::Assns< L, R, D >::data_.

483 {
484  return data_.at(it.getIndex());
485 }
std::vector< data_t > data_
Definition: Assns.h:264
template<typename L , typename R , typename D >
art::Assns< L, R, D >::const_iterator art::Assns< L, R, D >::end ( void  ) const
inline

Definition at line 454 of file Assns.h.

Referenced by trkf::KalmanFilterTrajectoryFitter::produce(), and trkf::KalmanFilterFinalTrackFitter::produce().

455 {
456  return const_iterator{*this};
457 }
template<typename L , typename R , typename D >
std::unique_ptr< art::EDProduct > art::Assns< L, R, D >::makePartner ( std::type_info const &  wanted_wrapper_type) const
inline

Definition at line 508 of file Assns.h.

References art::Assns< L, R, D >::makePartner_().

510 {
511  return makePartner_(wanted_wrapper_type);
512 }
std::unique_ptr< EDProduct > makePartner_(std::type_info const &wanted_wrapper_type) const override
Definition: Assns.h:529
template<typename L , typename R , typename D >
std::unique_ptr< art::EDProduct > art::Assns< L, R, D >::makePartner_ ( std::type_info const &  wanted_wrapper_type) const
overrideprivate

Definition at line 529 of file Assns.h.

References art::detail::throwPartnerException().

Referenced by art::Assns< L, R, void >::makePartner(), and art::Assns< L, R, D >::makePartner().

531 {
532  using bp = typename base::partner_t;
533  std::unique_ptr<art::EDProduct> result;
534  if (wanted_wrapper_type == typeid(Wrapper<partner_t>)) { // Partner.
535  result =
536  std::make_unique<Wrapper<partner_t>>(std::make_unique<partner_t>(*this));
537  } else if (wanted_wrapper_type == typeid(Wrapper<base>)) { // Base.
538  result = std::make_unique<Wrapper<base>>(
539  std::make_unique<base>(static_cast<base>(*this)));
540  } else if (wanted_wrapper_type == typeid(Wrapper<bp>)) { // Base of partner.
541  result = std::make_unique<Wrapper<bp>>(
542  std::make_unique<bp>(static_cast<base>(*this)));
543  } else { // Oops.
544  detail::throwPartnerException(typeid(*this), wanted_wrapper_type);
545  }
546  return result;
547 }
void throwPartnerException(std::type_info const &generator, std::type_info const &wanted_wrapper_type)
Assns< L, R > base
Definition: Assns.h:209
art::Assns< right_t, left_t, data_t > partner_t
Definition: Assns.h:215
template<typename L , typename R , typename D >
art::Assns< L, R, D >::const_reverse_iterator art::Assns< L, R, D >::rbegin ( ) const
inline

Definition at line 461 of file Assns.h.

References art::Assns< L, R, D >::size().

462 {
463  return const_reverse_iterator{*this, size()};
464 }
size_type size() const
Definition: Assns.h:440
typename art::const_AssnsIter< L, R, D, Direction::Reverse > const_reverse_iterator
Definition: Assns.h:219
template<typename L , typename R , typename D >
art::Assns< L, R, D >::const_reverse_iterator art::Assns< L, R, D >::rend ( ) const
inline

Definition at line 468 of file Assns.h.

469 {
470  return const_reverse_iterator{*this, 0};
471 }
typename art::const_AssnsIter< L, R, D, Direction::Reverse > const_reverse_iterator
Definition: Assns.h:219
template<typename L , typename R , typename D >
art::Assns< L, R, void >::size_type art::Assns< L, R, D >::size ( void  ) const
inline
template<typename L, typename R, typename D>
void art::Assns< L, R, D >::swap ( art::Assns< L, R, D > &  other)
inline

Definition at line 499 of file Assns.h.

References art::Assns< L, R, D >::data_, and art::Assns< L, R, D >::swap_().

Referenced by art::Assns< L, R, void >::fill_transients(), and art::Assns< L, R, D >::swap_().

500 {
501  using std::swap;
502  base::swap_(other);
503  swap(data_, other.data_);
504 }
void swap(art::Assns< L, R, D > &other)
Definition: Assns.h:499
void swap_(art::Assns< L, R, void > &other) override
Definition: Assns.h:516
void swap(art::HLTGlobalStatus &lhs, art::HLTGlobalStatus &rhs)
std::vector< data_t > data_
Definition: Assns.h:264
template<typename L, typename R, typename D >
void art::Assns< L, R, D >::swap_ ( art::Assns< L, R, void > &  other)
inlineoverrideprivate

Definition at line 516 of file Assns.h.

References art::errors::LogicError, and art::Assns< L, R, D >::swap().

Referenced by art::Assns< L, R, void >::swap(), and art::Assns< L, R, D >::swap().

517 {
518  try {
519  swap(dynamic_cast<Assns<L, R, D>&>(other));
520  }
521  catch (std::bad_cast const&) {
522  throw Exception(errors::LogicError, "AssnsBadCast")
523  << "Attempt to swap base with derived!\n";
524  }
525 }
void swap(art::Assns< L, R, D > &other)
Definition: Assns.h:499
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66

Friends And Related Function Documentation

template<typename L, typename R, typename D>
friend class art::Assns< right_t, left_t, data_t >
friend

Definition at line 258 of file Assns.h.

Member Data Documentation

template<typename L, typename R, typename D>
std::vector<data_t> art::Assns< L, R, D >::data_
private

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