LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
art::PtrVector< T > Class Template Reference

#include "fwd.h"

Inheritance diagram for art::PtrVector< T >:
art::PtrVectorBase

Public Types

typedef data_t::value_type value_type
 
typedef data_t::allocator_type allocator_type
 
typedef data_t::reference reference
 
typedef data_t::const_reference const_reference
 
typedef data_t::pointer pointer
 
typedef data_t::const_pointer const_pointer
 
typedef data_t::iterator iterator
 
typedef data_t::const_iterator const_iterator
 
typedef data_t::reverse_iterator reverse_iterator
 
typedef data_t::const_reverse_iterator const_reverse_iterator
 
typedef data_t::difference_type difference_type
 
typedef data_t::size_type size_type
 
typedef unsigned long key_type
 
typedef std::vector< key_typeindices_t
 

Public Member Functions

 PtrVector ()
 
template<typename U >
 PtrVector (PtrVector< U > const &other)
 
template<typename U >
 PtrVector (std::initializer_list< Ptr< U >> il)
 
template<typename U >
PtrVector< T > & operator= (std::initializer_list< Ptr< U >> il)
 
template<typename U >
PtrVector< T > & operator= (PtrVector< U > const &other)&
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
const_reverse_iterator crbegin () const
 
const_reverse_iterator crend () const
 
size_type size () const
 
size_type max_size () const
 
void resize (size_type n)
 
size_type capacity () const
 
bool empty () const
 
void reserve (size_type n)
 
void shrink_to_fit ()
 
Ptr< T > const & operator[] (unsigned long const idx) const
 
reference at (size_type n)
 
const_reference at (size_type n) const
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
template<typename U >
void assign (size_type n, Ptr< U > const &p)
 
template<class InputIterator >
void assign (InputIterator first, InputIterator last)
 
template<typename U >
void assign (std::initializer_list< Ptr< U >> il)
 
template<typename U >
void push_back (Ptr< U > const &p)
 
void pop_back ()
 
template<typename U >
iterator insert (iterator position, Ptr< U > const &p)
 
template<typename U >
void insert (iterator position, size_type n, Ptr< U > const &p)
 
template<typename InputIterator >
iterator insert (PV_INSERT_POSITION_TYPE position, InputIterator first, InputIterator last)
 
iterator erase (iterator position)
 
iterator erase (iterator first, iterator last)
 
void swap (PtrVector &other)
 
void swap (key_type k1, key_type k2)
 
void clear ()
 
bool operator== (PtrVector const &other) const
 
void sort ()
 
template<class COMP >
void sort (COMP comp)
 
template<typename U >
art::PtrVector< T > & operator= (std::initializer_list< Ptr< U >> il)
 
template<typename U >
art::PtrVector< T > & operator= (PtrVector< U > const &other)&
 
template<typename U >
art::PtrVector< T >::iterator insert (iterator position, Ptr< U > const &p)
 
template<typename InputIterator >
auto insert (PV_INSERT_POSITION_TYPE position, InputIterator first, InputIterator last) -> iterator
 
bool isNonnull () const
 
bool isNull () const
 
bool isAvailable () const
 
ProductID id () const
 
EDProductGetter const * productGetter () const
 
void setProductGetter (EDProductGetter *g) const
 
template<typename T >
art::Ptr< T >::key_type key (Ptr< T > const &ptr) const
 

Static Public Member Functions

static short Class_Version ()
 

Protected Member Functions

void swap (PtrVectorBase &)
 
void updateCore (RefCore const &core)
 
bool operator== (PtrVectorBase const &) const
 

Private Types

typedef std::vector< Ptr< T > > data_t
 

Private Member Functions

void fill_offsets (indices_t &indices) override
 
void fill_from_offsets (indices_t const &indices) const override
 
void zeroTransients () override
 

Private Attributes

data_t ptrs_
 

Detailed Description

template<typename T>
class art::PtrVector< T >

Definition at line 27 of file fwd.h.

Member Typedef Documentation

template<typename T>
typedef data_t::allocator_type art::PtrVector< T >::allocator_type

Definition at line 55 of file PtrVector.h.

template<typename T>
typedef data_t::const_iterator art::PtrVector< T >::const_iterator

Definition at line 61 of file PtrVector.h.

template<typename T>
typedef data_t::const_pointer art::PtrVector< T >::const_pointer

Definition at line 59 of file PtrVector.h.

template<typename T>
typedef data_t::const_reference art::PtrVector< T >::const_reference

Definition at line 57 of file PtrVector.h.

template<typename T>
typedef data_t::const_reverse_iterator art::PtrVector< T >::const_reverse_iterator

Definition at line 63 of file PtrVector.h.

template<typename T>
typedef std::vector<Ptr<T> > art::PtrVector< T >::data_t
private

Definition at line 51 of file PtrVector.h.

template<typename T>
typedef data_t::difference_type art::PtrVector< T >::difference_type

Definition at line 64 of file PtrVector.h.

typedef std::vector<key_type> art::PtrVectorBase::indices_t
inherited

Definition at line 24 of file PtrVectorBase.h.

template<typename T>
typedef data_t::iterator art::PtrVector< T >::iterator

Definition at line 60 of file PtrVector.h.

typedef unsigned long art::PtrVectorBase::key_type
inherited

Definition at line 23 of file PtrVectorBase.h.

template<typename T>
typedef data_t::pointer art::PtrVector< T >::pointer

Definition at line 58 of file PtrVector.h.

template<typename T>
typedef data_t::reference art::PtrVector< T >::reference

Definition at line 56 of file PtrVector.h.

template<typename T>
typedef data_t::reverse_iterator art::PtrVector< T >::reverse_iterator

Definition at line 62 of file PtrVector.h.

template<typename T>
typedef data_t::size_type art::PtrVector< T >::size_type

Definition at line 65 of file PtrVector.h.

template<typename T>
typedef data_t::value_type art::PtrVector< T >::value_type

Definition at line 54 of file PtrVector.h.

Constructor & Destructor Documentation

template<typename T >
art::PtrVector< T >::PtrVector ( )
inline

Definition at line 165 of file PtrVector.h.

165  : PtrVectorBase(), ptrs_()
166 {}
PtrVectorBase()=default
data_t ptrs_
Definition: PtrVector.h:155
template<typename T >
template<typename U >
art::PtrVector< T >::PtrVector ( PtrVector< U > const &  other)
inline

Definition at line 170 of file PtrVector.h.

References art::PtrVector< T >::begin(), art::PtrVector< T >::end(), art::PtrVector< T >::ptrs_, art::PtrVector< T >::size(), and fhicl::detail::atom::value().

172 {
173  // Ensure that types are compatible.
175  "PtrVector: incompatible types");
176  ptrs_.reserve(other.size());
177  std::copy(other.begin(), other.end(), std::back_inserter(ptrs_));
178 }
PtrVectorBase()=default
std::string value(boost::any const &)
data_t ptrs_
Definition: PtrVector.h:155
template<typename T >
template<typename U >
art::PtrVector< T >::PtrVector ( std::initializer_list< Ptr< U >>  il)
inline

Definition at line 182 of file PtrVector.h.

References art::PtrVector< T >::ptrs_, art::PtrVectorBase::updateCore(), and fhicl::detail::atom::value().

183  : PtrVectorBase(), ptrs_()
184 {
187  "PtrVector: incompatible types");
188  ptrs_.reserve(il.size());
189  for (auto&& p : il) {
190  updateCore(p.refCore());
191  ptrs_.push_back(std::move(p));
192  }
193 }
PtrVectorBase()=default
std::string value(boost::any const &)
data_t ptrs_
Definition: PtrVector.h:155
void updateCore(RefCore const &core)

Member Function Documentation

template<typename T >
template<typename U >
void art::PtrVector< T >::assign ( size_type  n,
Ptr< U > const &  p 
)
inline

Definition at line 409 of file PtrVector.h.

References art::PtrVectorBase::clear(), art::PtrVector< T >::ptrs_, art::Ptr< T >::refCore(), art::PtrVectorBase::updateCore(), and fhicl::detail::atom::value().

Referenced by art::PtrVector< T >::assign(), and art::PtrVector< T >::operator=().

410 {
413  "PtrVector: incompatible types");
415  updateCore(p.refCore());
416  ptrs_.assign(n, p);
417 }
std::string value(boost::any const &)
data_t ptrs_
Definition: PtrVector.h:155
Char_t n[5]
void updateCore(RefCore const &core)
template<typename T >
template<typename InputIterator >
void art::PtrVector< T >::assign ( InputIterator  first,
InputIterator  last 
)
inline

Definition at line 422 of file PtrVector.h.

References art::PtrVectorBase::clear(), art::PtrVector< T >::ptrs_, art::Ptr< T >::refCore(), and art::PtrVectorBase::updateCore().

423 {
425  std::for_each(
426  first, last, [this](Ptr<T> const& p) { updateCore(p.refCore()); });
427  ptrs_.assign(first, last);
428 }
data_t ptrs_
Definition: PtrVector.h:155
void updateCore(RefCore const &core)
template<typename T >
template<typename U >
void art::PtrVector< T >::assign ( std::initializer_list< Ptr< U >>  il)
inline

Definition at line 433 of file PtrVector.h.

References art::PtrVector< T >::assign().

434 {
435  assign(il.begin(), il.end());
436 }
void assign(size_type n, Ptr< U > const &p)
Definition: PtrVector.h:409
template<typename T >
auto art::PtrVector< T >::at ( size_type  n) const
inline

Definition at line 372 of file PtrVector.h.

References n, and art::PtrVector< T >::ptrs_.

373 {
374  return ptrs_.at(n);
375 }
data_t ptrs_
Definition: PtrVector.h:155
Char_t n[5]
template<typename T >
auto art::PtrVector< T >::back ( void  )
inline

Definition at line 393 of file PtrVector.h.

References art::PtrVector< T >::ptrs_.

Referenced by cluster::HoughBaseAlg::FastTransform(), cluster::DBcluster::produce(), and cluster::BlurredClustering::produce().

394 {
395  return ptrs_.back();
396 }
data_t ptrs_
Definition: PtrVector.h:155
template<typename T >
auto art::PtrVector< T >::back ( void  ) const
inline

Definition at line 400 of file PtrVector.h.

References art::PtrVector< T >::ptrs_.

401 {
402  return ptrs_.back();
403 }
data_t ptrs_
Definition: PtrVector.h:155
template<typename T >
auto art::PtrVector< T >::begin ( ) const
inline

Definition at line 230 of file PtrVector.h.

References art::PtrVector< T >::ptrs_.

231 {
232  return ptrs_.begin();
233 }
data_t ptrs_
Definition: PtrVector.h:155
template<typename T >
auto art::PtrVector< T >::capacity ( ) const
inline

Definition at line 329 of file PtrVector.h.

References art::PtrVector< T >::ptrs_.

330 {
331  return ptrs_.capacity();
332 }
data_t ptrs_
Definition: PtrVector.h:155
template<typename T >
auto art::PtrVector< T >::cbegin ( ) const
inline

Definition at line 279 of file PtrVector.h.

References art::PtrVector< T >::ptrs_.

280 {
281  return ptrs_.cbegin();
282 }
data_t ptrs_
Definition: PtrVector.h:155
template<typename T >
auto art::PtrVector< T >::cend ( ) const
inline

Definition at line 286 of file PtrVector.h.

References art::PtrVector< T >::ptrs_.

287 {
288  return ptrs_.cend();
289 }
data_t ptrs_
Definition: PtrVector.h:155
template<typename T>
static short art::PtrVector< T >::Class_Version ( )
inlinestatic

Definition at line 144 of file PtrVector.h.

145  {
146  return 11;
147  }
template<typename T >
auto art::PtrVector< T >::crbegin ( ) const
inline

Definition at line 293 of file PtrVector.h.

References art::PtrVector< T >::ptrs_.

294 {
295  return ptrs_.crbegin();
296 }
data_t ptrs_
Definition: PtrVector.h:155
template<typename T >
auto art::PtrVector< T >::crend ( ) const
inline

Definition at line 300 of file PtrVector.h.

References art::PtrVector< T >::ptrs_.

301 {
302  return ptrs_.crend();
303 }
data_t ptrs_
Definition: PtrVector.h:155
template<typename T >
bool art::PtrVector< T >::empty ( void  ) const
inline

Definition at line 336 of file PtrVector.h.

References art::PtrVector< T >::ptrs_.

Referenced by trkf::TrackKalmanCheater::produce(), and CRHitRemovalByPCA::produce().

337 {
338  return ptrs_.empty();
339 }
data_t ptrs_
Definition: PtrVector.h:155
template<typename T >
auto art::PtrVector< T >::end ( void  ) const
inline

Definition at line 244 of file PtrVector.h.

References art::PtrVector< T >::ptrs_.

245 {
246  return ptrs_.end();
247 }
data_t ptrs_
Definition: PtrVector.h:155
template<typename T >
auto art::PtrVector< T >::erase ( iterator  position)
inline
template<typename T >
auto art::PtrVector< T >::erase ( iterator  first,
iterator  last 
)
inline

Definition at line 515 of file PtrVector.h.

References art::PtrVector< T >::ptrs_.

516 {
517  return ptrs_.erase(first, last);
518 }
data_t ptrs_
Definition: PtrVector.h:155
template<typename T >
void art::PtrVector< T >::fill_from_offsets ( indices_t const &  indices) const
overrideprivatevirtual

Implements art::PtrVectorBase.

Definition at line 579 of file PtrVector.h.

References art::PtrVectorBase::productGetter(), and art::PtrVector< T >::ptrs_.

580 {
581  // Precondition: ptrs_ is expected to be empty.
582  assert(ptrs_.empty());
583  ptrs_.reserve(indices.size());
584  for (auto i : indices) {
585  ptrs_.emplace_back(id(), i, productGetter());
586  }
587 }
EDProductGetter const * productGetter() const
Definition: PtrVectorBase.h:90
constexpr std::array< std::size_t, geo::vect::dimension< Vector >)> indices()
Returns a sequence of indices valid for a vector of the specified type.
data_t ptrs_
Definition: PtrVector.h:155
template<typename T >
void art::PtrVector< T >::fill_offsets ( indices_t indices)
overrideprivatevirtual

Implements art::PtrVectorBase.

Definition at line 567 of file PtrVector.h.

References art::PtrVector< T >::ptrs_.

568 {
569  // Precondition: indices is expected to be empty.
570  assert(indices.empty());
571  indices.reserve(ptrs_.size());
572  for (auto const& i : ptrs_) {
573  indices.push_back(i.key());
574  }
575 }
constexpr std::array< std::size_t, geo::vect::dimension< Vector >)> indices()
Returns a sequence of indices valid for a vector of the specified type.
data_t ptrs_
Definition: PtrVector.h:155
template<typename T >
auto art::PtrVector< T >::front ( void  )
inline

Definition at line 379 of file PtrVector.h.

References art::PtrVector< T >::ptrs_.

Referenced by trkf::SpacePointAlg::fillComplexSpacePoint(), cluster::DBcluster::produce(), and cluster::BlurredClustering::produce().

380 {
381  return ptrs_.front();
382 }
data_t ptrs_
Definition: PtrVector.h:155
template<typename T >
auto art::PtrVector< T >::front ( void  ) const
inline

Definition at line 386 of file PtrVector.h.

References art::PtrVector< T >::ptrs_.

387 {
388  return ptrs_.front();
389 }
data_t ptrs_
Definition: PtrVector.h:155
art::ProductID art::PtrVectorBase::id ( ) const
inlineinherited

Definition at line 84 of file PtrVectorBase.h.

Referenced by art::PtrVectorBase::updateCore().

85 {
86  return core_.id();
87 }
ProductID id() const
Definition: RefCore.h:93
template<typename T >
template<typename U >
void art::PtrVector< T >::insert ( iterator  position,
size_type  n,
Ptr< U > const &  p 
)
inline

Definition at line 474 of file PtrVector.h.

References art::PtrVector< T >::ptrs_, art::Ptr< T >::refCore(), art::PtrVectorBase::updateCore(), and fhicl::detail::atom::value().

475 {
476  // Ensure that types are compatible.
479  "PtrVector: incompatible types");
480  updateCore(p.refCore());
481  ptrs_.insert(position, n, p);
482 }
std::string value(boost::any const &)
data_t ptrs_
Definition: PtrVector.h:155
Char_t n[5]
void updateCore(RefCore const &core)
template<typename T>
template<typename InputIterator >
iterator art::PtrVector< T >::insert ( PV_INSERT_POSITION_TYPE  position,
InputIterator  first,
InputIterator  last 
)
template<typename T>
template<typename U >
art::PtrVector<T>::iterator art::PtrVector< T >::insert ( iterator  position,
Ptr< U > const &  p 
)
inline

Definition at line 461 of file PtrVector.h.

References art::PtrVector< T >::ptrs_, art::Ptr< T >::refCore(), art::PtrVectorBase::updateCore(), and fhicl::detail::atom::value().

462 {
463  // Ensure that types are compatible.
466  "PtrVector: incompatible types");
467  updateCore(p.refCore());
468  return ptrs_.insert(position, p);
469 }
std::string value(boost::any const &)
data_t ptrs_
Definition: PtrVector.h:155
void updateCore(RefCore const &core)
template<typename T>
template<typename InputIterator >
auto art::PtrVector< T >::insert ( PV_INSERT_POSITION_TYPE  position,
InputIterator  first,
InputIterator  last 
) -> iterator
inline

Definition at line 487 of file PtrVector.h.

References art::PtrVector< T >::ptrs_, art::Ptr< T >::refCore(), and art::PtrVectorBase::updateCore().

490 {
491  std::for_each(
492  first, last, [this](Ptr<T> const& p) { updateCore(p.refCore()); });
493 #if GCC_IS_AT_LEAST(4, 9, 0) || CLANG_IS_AT_LEAST(3, 5, 0)
494  // C++2011.
495  return ptrs_.insert(position, first, last);
496 #else
497  // Inefficient with C++03 interface.
498  auto const orig_dist = std::distance(ptrs_.begin(), position);
499  ptrs_.insert(position, first, last);
500  iterator result = ptrs_.begin();
501  std::advance(result, orig_dist);
502  return result;
503 #endif
504 }
data_t ptrs_
Definition: PtrVector.h:155
void updateCore(RefCore const &core)
bool art::PtrVectorBase::isAvailable ( ) const
inlineinherited

Definition at line 78 of file PtrVectorBase.h.

79 {
80  return core_.isAvailable();
81 }
bool isAvailable() const
Definition: RefCore.cc:15
bool art::PtrVectorBase::isNonnull ( ) const
inlineinherited

Definition at line 66 of file PtrVectorBase.h.

67 {
68  return core_.isNonnull();
69 }
bool isNonnull() const
Definition: RefCore.h:76
bool art::PtrVectorBase::isNull ( ) const
inlineinherited

Definition at line 72 of file PtrVectorBase.h.

Referenced by vertex::AggregateVertex::MatchV2T(), and art::PtrVectorBase::updateCore().

73 {
74  return !isNonnull();
75 }
bool isNonnull() const
Definition: PtrVectorBase.h:66
template<typename T >
art::Ptr<T>::key_type art::PtrVectorBase::key ( Ptr< T > const &  ptr) const
inlineinherited

Definition at line 123 of file PtrVectorBase.h.

References art::Ptr< T >::key().

124 {
125  return ptr.key();
126 }
template<typename T >
auto art::PtrVector< T >::max_size ( ) const
inline

Definition at line 315 of file PtrVector.h.

References art::PtrVector< T >::ptrs_.

316 {
317  return ptrs_.max_size();
318 }
data_t ptrs_
Definition: PtrVector.h:155
template<typename T>
template<typename U >
PtrVector<T>& art::PtrVector< T >::operator= ( std::initializer_list< Ptr< U >>  il)
template<typename T>
template<typename U >
PtrVector<T>& art::PtrVector< T >::operator= ( PtrVector< U > const &  other)
template<typename T>
template<typename U >
art::PtrVector<T>& art::PtrVector< T >::operator= ( std::initializer_list< Ptr< U >>  il)
inline

Definition at line 198 of file PtrVector.h.

References art::PtrVector< T >::assign(), and fhicl::detail::atom::value().

199 {
202  "PtrVector: incompatible types");
203  assign(il);
204  return *this;
205 }
std::string value(boost::any const &)
void assign(size_type n, Ptr< U > const &p)
Definition: PtrVector.h:409
template<typename T>
template<typename U >
art::PtrVector<T>& art::PtrVector< T >::operator= ( PtrVector< U > const &  other)
inline

Definition at line 210 of file PtrVector.h.

References fhicl::other, art::PtrVector< T >::ptrs_, and fhicl::detail::atom::value().

211 {
213  "PtrVector: incompatible types");
214  this->PtrVectorBase::operator=(other);
215  ptrs_.clear();
216  std::copy(other.cbegin(), other.cend(), std::back_inserter(ptrs_));
217  return *this;
218 }
std::string value(boost::any const &)
data_t ptrs_
Definition: PtrVector.h:155
bool art::PtrVectorBase::operator== ( PtrVectorBase const &  other) const
inlineprotectedinherited

Definition at line 129 of file PtrVectorBase.h.

References art::PtrVectorBase::core_.

Referenced by art::PtrVector< T >::operator==().

130 {
131  return core_ == other.core_;
132 }
template<typename T >
bool art::PtrVector< T >::operator== ( PtrVector< T > const &  other) const
inline

Definition at line 545 of file PtrVector.h.

References art::PtrVectorBase::operator==(), and art::PtrVector< T >::ptrs_.

546 {
547  return ptrs_ == other.ptrs_ && this->PtrVectorBase::operator==(other);
548 }
bool operator==(PtrVectorBase const &) const
data_t ptrs_
Definition: PtrVector.h:155
template<typename T >
art::Ptr< T > const & art::PtrVector< T >::operator[] ( unsigned long const  idx) const
inline

Definition at line 357 of file PtrVector.h.

References art::PtrVector< T >::begin().

359 {
360  return *(begin() + idx);
361 }
iterator begin()
Definition: PtrVector.h:223
template<typename T >
void art::PtrVector< T >::pop_back ( )
inline

Definition at line 453 of file PtrVector.h.

References art::PtrVector< T >::ptrs_.

Referenced by trkf::SpacePointCheater::produce(), and trkf::SpacePointFinder::produce().

454 {
455  ptrs_.pop_back();
456 }
data_t ptrs_
Definition: PtrVector.h:155
art::EDProductGetter const * art::PtrVectorBase::productGetter ( ) const
inlineinherited

Definition at line 90 of file PtrVectorBase.h.

Referenced by art::PtrVector< T >::fill_from_offsets().

91 {
92  return core_.productGetter();
93 }
EDProductGetter const * productGetter() const
Definition: RefCore.h:105
template<typename T >
template<typename U >
void art::PtrVector< T >::push_back ( Ptr< U > const &  p)
inline

Definition at line 441 of file PtrVector.h.

References art::PtrVector< T >::ptrs_, art::Ptr< T >::refCore(), art::PtrVectorBase::updateCore(), and fhicl::detail::atom::value().

Referenced by trkf::BezierTrackerAlgorithm::AddPtrVectors(), vertex::AggregateVertexAna::analyze(), caldata::CalWireAna::analyze(), opdet::TrackTimeAssocAna::analyze(), detsim::SimWireAna::analyze(), cluster::ClusterAna::analyze(), pfpf::PFPAna::analyze(), detsim::WienerFilterAna::analyze(), cluster::DBclusterAna::analyze(), cluster::HoughLineFinderAna::analyze(), vertex::FeatureVertexFinderAna::analyze(), trkf::Track3DKalmanHitAlg::chopHitsOffSeeds(), cluster::BlurredClusteringAlg::ConvertBinsToRecobHits(), cluster::EndPointAlg::EndPoint(), cluster::HoughBaseAlg::FastTransform(), art::View< T >::fill(), cluster::ClusterMatchAlg::FillHitInfo(), trkf::KGTrack::fillHits(), trkf::SpacePointAlg::fillSpacePoints(), filt::EmptyFilter::filter(), filter::MuonFilter::filter(), trkf::SeedFinderAlgorithm::FindSeeds(), trkf::FeatureTracker::Get3DFeaturePoints(), trkf::Track3DKalmanHit::getAllHits(), evd::RecoBaseDrawer::GetBezierTracks(), trkf::BezierTrack::GetCalorimetryObject(), trkf::BezierTrack::GetClosestApproaches(), evd::RecoBaseDrawer::GetClusters(), evd::RecoBaseDrawer::GetEdges(), evd::RecoBaseDrawer::GetEndPoint2D(), evd::RecoBaseDrawer::GetEvents(), evd::GraphClusterAlg::GetHitList(), trkf::BezierTrackerModule::GetHitsFromClusters(), trkf::SeedFinderModule::GetHitsFromEvent(), evd::RecoBaseDrawer::GetOpFlashes(), evd::RecoBaseDrawer::GetPFParticles(), evd::RecoBaseDrawer::GetSeeds(), trkf::SeedFinderAlgorithm::GetSeedsFromSortedHits(), trkf::SeedFinderModule::GetSortedHitsFromClusters(), evd::RecoBaseDrawer::GetVertices(), evd::RecoBaseDrawer::GetWires(), trkf::SpacePointAlg::makeSpacePoints(), trkf::BezierTrackerAlgorithm::MakeTracks(), cluster::ClusterMatchAlg::Match_SpacePoint(), vertex::AggregateVertex::MatchV2T(), event::EventMaker::produce(), vertex::VertexCheater::produce(), trkf::TCTrack::produce(), trkf::SpacePointCheater::produce(), trkf::SpacePointFinder::produce(), trkf::TrackCheater::produce(), vertex::AggregateVertex::produce(), trkf::FeatureTracker::produce(), opdet::OpFlashFinder::produce(), cluster::DBcluster::produce(), trkf::SpacePts::produce(), shower::EMShower::produce(), event::AggregateEvent::produce(), vertex::VertexMatch::produce(), trkf::Track3Dreco::produce(), trkf::TrackKalmanCheater::produce(), shwf::ShowerFinder::produce(), vertex::HarrisVertexFinder::produce(), cluster::EndPointModule::produce(), ems::EMShower3D::produce(), CRHitRemovalByPCA::produce(), vertex::VertexFinder2D::produce(), shwf::ShowerReco::produce(), trkf::Track3DKalman::produce(), trkf::PMAlgTrajFitter::produce(), trkf::Track3DKalmanSPS::produce(), vertex::FeatureVertexFinder::produce(), evd::GraphCluster::produce(), trkf::PMAlgTrackMaker::produce(), trkf::CosmicTracker::produce(), evd::HitSelector::SaveSeedLines(), and trkf::StitchAlg::WalkStitch().

442 {
443  // Ensure that types are compatible.
446  "PtrVector: incompatible types");
447  updateCore(p.refCore());
448  ptrs_.push_back(p);
449 }
std::string value(boost::any const &)
data_t ptrs_
Definition: PtrVector.h:155
void updateCore(RefCore const &core)
template<typename T >
auto art::PtrVector< T >::rbegin ( )
inline

Definition at line 251 of file PtrVector.h.

References art::PtrVector< T >::ptrs_.

252 {
253  return ptrs_.rbegin();
254 }
data_t ptrs_
Definition: PtrVector.h:155
template<typename T >
auto art::PtrVector< T >::rbegin ( ) const
inline

Definition at line 258 of file PtrVector.h.

References art::PtrVector< T >::ptrs_.

259 {
260  return ptrs_.rbegin();
261 }
data_t ptrs_
Definition: PtrVector.h:155
template<typename T >
auto art::PtrVector< T >::rend ( )
inline

Definition at line 265 of file PtrVector.h.

References art::PtrVector< T >::ptrs_.

266 {
267  return ptrs_.rend();
268 }
data_t ptrs_
Definition: PtrVector.h:155
template<typename T >
auto art::PtrVector< T >::rend ( ) const
inline

Definition at line 272 of file PtrVector.h.

References art::PtrVector< T >::ptrs_.

273 {
274  return ptrs_.rend();
275 }
data_t ptrs_
Definition: PtrVector.h:155
template<typename T >
void art::PtrVector< T >::resize ( size_type  n)
inline

Definition at line 322 of file PtrVector.h.

References art::PtrVector< T >::ptrs_.

323 {
324  ptrs_.resize(n);
325 }
data_t ptrs_
Definition: PtrVector.h:155
Char_t n[5]
void art::PtrVectorBase::setProductGetter ( EDProductGetter g) const
inlineinherited

Definition at line 96 of file PtrVectorBase.h.

97 {
99 }
void setProductGetter(EDProductGetter const *prodGetter) const
Definition: RefCore.h:117
template<typename T >
void art::PtrVector< T >::shrink_to_fit ( )
inline

Definition at line 350 of file PtrVector.h.

References art::PtrVector< T >::ptrs_.

351 {
352  ptrs_.shrink_to_fit();
353 }
data_t ptrs_
Definition: PtrVector.h:155
template<typename T >
auto art::PtrVector< T >::size ( void  ) const
inline

Definition at line 308 of file PtrVector.h.

References art::PtrVector< T >::ptrs_.

Referenced by trkf::BezierTrackerAlgorithm::AddPtrVectors(), vertex::AggregateVertexAna::analyze(), caldata::CalWireAna::analyze(), opdet::TrackTimeAssocAna::analyze(), detsim::SimWireAna::analyze(), pfpf::PFPAna::analyze(), cluster::ClusterAna::analyze(), detsim::WienerFilterAna::analyze(), cluster::DBclusterAna::analyze(), cluster::HoughLineFinderAna::analyze(), hit::DumpHits::analyze(), vertex::FeatureVertexFinderAna::analyze(), recob::DumpTracks::analyze(), trkf::TrackAna::anaStitch(), evd::RecoBaseDrawer::BezierTrack2D(), evd::RecoBaseDrawer::BezierTrack3D(), trkf::BezierTrack::CalculatedQdx(), trkf::Track3DKalmanHitAlg::chopHitsOffSeeds(), evd::RecoBaseDrawer::Cluster2D(), trkf::SpacePointAlg::compatible(), cluster::BlurredClusteringAlg::ConvertBinsToClusters(), trkf::Track3DKalmanHit::createOutputs(), cluster::EndPointAlg::EndPoint(), evd::RecoBaseDrawer::EndPoint2D(), evd::RecoBaseDrawer::Event2D(), evd::RecoBaseDrawer::Event3D(), trkf::SpacePointAlg::fillComplexSpacePoint(), trkf::KGTrack::fillHits(), evd::RecoBaseDrawer::FillQHisto(), trkf::SpacePointAlg::fillSpacePoint(), trkf::SpacePointAlg::fillSpacePoints(), evd::RecoBaseDrawer::FillTQHisto(), evd::RecoBaseDrawer::FillTQHistoDP(), filt::EmptyFilter::filter(), filter::MuonFilter::filter(), vertex::FeatureVertexFinder::Find2dClusterVertexCandidates(), trkf::SeedFinderAlgorithm::FindSeeds(), evd::RecoBaseDrawer::GetBezierTracks(), trkf::BezierTrack::GetCalorimetryObject(), trkf::BezierTrack::GetClosestApproaches(), evd::RecoBaseDrawer::GetClusters(), evd::RecoBaseDrawer::GetEdges(), evd::RecoBaseDrawer::GetEndPoint2D(), trkf::TrackStitcher::GetHitsFromAssdSpacePoints(), trkf::TrackStitcher::GetHitsFromComponentTracks(), opdet::FlashClusterMatch::GetLightHypothesis(), evd::RecoBaseDrawer::GetOpFlashes(), evd::RecoBaseDrawer::GetPFParticles(), evd::RecoBaseDrawer::GetSeeds(), trkf::TrackStitcher::GetSpacePointsFromComponentTracks(), evd::RecoBaseDrawer::GetVertices(), evd::RecoBaseDrawer::GetWires(), trkf::Track3DKalmanHitAlg::growSeedIntoTracks(), trkf::SpacePointAlg::makeSpacePoints(), trkf::Track3DKalmanHitAlg::makeTracks(), cluster::ClusterMatchAlg::Match_SpacePoint(), vertex::AggregateVertex::MatchV2T(), cluster::MergeClusterAlg::MergeClusters(), art::PtrRemapper::operator()(), evd::RecoBaseDrawer::OpFlash2D(), evd::RecoBaseDrawer::OpFlashOrtho(), evd::RecoBaseDrawer::PFParticle3D(), evd::RecoBaseDrawer::PFParticleOrtho(), event::EventMaker::produce(), hit::HitFinder::produce(), vertex::VertexCheater::produce(), trkf::TCTrack::produce(), event::EventCheater::produce(), trkf::SpacePointCheater::produce(), trkf::SpacePointFinder::produce(), trkf::TrackCheater::produce(), cluster::DBcluster::produce(), cluster::BlurredClustering::produce(), trkf::SpacePts::produce(), shower::EMShower::produce(), vertex::VertexMatch::produce(), trkf::Track3Dreco::produce(), trkf::TrackKalmanCheater::produce(), shwf::ShowerFinder::produce(), vertex::HarrisVertexFinder::produce(), trkf::TrackStitcher::produce(), ems::EMShower3D::produce(), vertex::VertexFinder2D::produce(), shwf::ShowerReco::produce(), trkf::Track3DKalman::produce(), trkf::PMAlgTrajFitter::produce(), trkf::Track3DKalmanSPS::produce(), trkf::PMAlgTrackMaker::produce(), art::PtrVector< T >::PtrVector(), cosmic::CosmicPCAxisTagger::RecobToClusterHits(), cluster::BlurredClusteringAlg::SaveImage(), evd::HitSelector::SaveSeedLines(), evd::RecoBaseDrawer::Seed2D(), evd::RecoBaseDrawer::Seed3D(), evd::RecoBaseDrawer::SeedOrtho(), trkf::SpacePointAlg::separation(), sp_sort_nsppts(), evd::RecoBaseDrawer::Vertex2D(), evd::RecoBaseDrawer::Vertex3D(), evd::RecoBaseDrawer::VertexOrtho(), trkf::StitchAlg::WalkStitch(), and evd::RecoBaseDrawer::Wire2D().

309 {
310  return ptrs_.size();
311 }
data_t ptrs_
Definition: PtrVector.h:155
template<typename T >
void art::PtrVector< T >::sort ( void  )
inline

Definition at line 552 of file PtrVector.h.

553 {
554  sort(std::less<T>());
555 }
template<typename T >
template<class COMP >
void art::PtrVector< T >::sort ( COMP  comp)
inline

Definition at line 560 of file PtrVector.h.

References art::PtrVector< T >::ptrs_.

561 {
562  std::sort(ptrs_.begin(), ptrs_.end(), ComparePtrs<COMP>(comp));
563 }
data_t ptrs_
Definition: PtrVector.h:155
void art::PtrVectorBase::swap ( PtrVectorBase other)
inlineprotectedinherited

Definition at line 116 of file PtrVectorBase.h.

References art::PtrVectorBase::core_.

Referenced by art::PtrVectorBase::fillPtrs(), and art::PtrVector< T >::swap().

117 {
118  core_.swap(other.core_);
119 }
void swap(RefCore &other)
Definition: RefCore.h:123
template<typename T >
void art::PtrVector< T >::swap ( key_type  k1,
key_type  k2 
)
inline

Definition at line 530 of file PtrVector.h.

References art::PtrVector< T >::ptrs_, and art::swap().

531 {
532  std::swap(ptrs_[k1], ptrs_[k2]);
533 }
void swap(PtrVector< T > &, PtrVector< T > &)
Definition: PtrVector.h:599
data_t ptrs_
Definition: PtrVector.h:155
void art::PtrVectorBase::updateCore ( RefCore const &  core)
protectedinherited

Definition at line 18 of file PtrVectorBase.cc.

References art::PtrVectorBase::core_, art::PtrVectorBase::id(), art::RefCore::id(), art::errors::InvalidReference, art::PtrVectorBase::isNull(), art::RefCore::isNull(), art::RefCore::productGetter(), art::RefCore::productPtr(), art::RefCore::setProductGetter(), and art::RefCore::setProductPtr().

Referenced by art::PtrVector< T >::assign(), art::PtrVector< T >::insert(), art::PtrVector< T >::PtrVector(), and art::PtrVector< T >::push_back().

19 {
20  if (productToBeInserted.isNull()) {
21  throw art::Exception(errors::InvalidReference, "Inconsistency")
22  << "art::PtrVectorBase::updateCore: Ptr has invalid (zero) product ID,\n"
23  "so it cannot be added to a PtrVector. id should be ("
24  << id() << ")\n";
25  }
26  if (isNull()) {
27  core_ = productToBeInserted;
28  return;
29  }
30  if (core_.id() != productToBeInserted.id()) {
31  throw art::Exception(errors::InvalidReference, "Inconsistency")
32  << "art::PtrVectorBase::updateCore: Ptr is inconsistent with\n"
33  "PtrVector. id = ("
34  << productToBeInserted.id() << "), should be (" << core_.id() << ")\n";
35  }
36  if (core_.productGetter() == nullptr &&
37  productToBeInserted.productGetter() != nullptr) {
38  core_.setProductGetter(productToBeInserted.productGetter());
39  }
40  if (core_.productPtr() == nullptr &&
41  productToBeInserted.productPtr() != nullptr) {
42  core_.setProductPtr(productToBeInserted.productPtr());
43  }
44 }
bool isNull() const
Definition: PtrVectorBase.h:72
EDProductGetter const * productGetter() const
Definition: RefCore.h:105
ProductID id() const
Definition: PtrVectorBase.h:84
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
void const * productPtr() const
Definition: RefCore.h:99
void setProductGetter(EDProductGetter const *prodGetter) const
Definition: RefCore.h:117
ProductID id() const
Definition: RefCore.h:93
void setProductPtr(void const *prodPtr) const
Definition: RefCore.h:111
template<typename T >
void art::PtrVector< T >::zeroTransients ( )
inlineoverrideprivatevirtual

Implements art::PtrVectorBase.

Definition at line 591 of file PtrVector.h.

References art::PtrVector< T >::ptrs_, and tmp.

592 {
593  data_t tmp;
594  ptrs_.swap(tmp);
595 }
std::vector< Ptr< T > > data_t
Definition: PtrVector.h:51
Float_t tmp
Definition: plot.C:37
data_t ptrs_
Definition: PtrVector.h:155

Member Data Documentation


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