Template Class CatalogIterator

Inheritance Relationships

Base Type

  • public boost::iterator_adaptor< CatalogIterator< BaseT >, BaseT, BaseT::value_type::element_type >

Class Documentation

template<typename BaseT>
class CatalogIterator : public boost::iterator_adaptor<CatalogIterator<BaseT>, BaseT, BaseT::value_type::element_type>

Iterator class for CatalogT.

Iterators dereference to record references or const references, even though the CatalogT container is based on a vector of shared_ptr internally. This is usually very convenient (and is one of the reasons for having a custom container class in the first place).

Sometimes, however, we’d like to get a shared_ptr from an iterator (especially because records are noncopyable). With that in mind, CatalogIterator is implicitly convertible to the shared_ptr type it holds internally, and can also be assigned a shared_ptr to set the pointer in the underlying container. This conversion makes sense from the perspective that both iterators and smart pointers mimic the interface of pointers and provide the same interface to get at the underlying record.

Public Functions

CatalogIterator()
template<typename OtherBaseT>
CatalogIterator(CatalogIterator<OtherBaseT> const &other)
CatalogIterator(BaseT const &base)
template<typename RecordT>
operator std::shared_ptr<RecordT>() const
template<typename RecordT>
CatalogIterator &operator=(std::shared_ptr<RecordT> const &other) const

Friends

friend lsst::afw::table::CatalogIterator::boost::iterator_core_access