LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Member Functions | Private Member Functions | Friends | List of all members
lsst::afw::table::CatalogIterator< BaseT > Class Template Reference

Iterator class for CatalogT. More...

#include <Catalog.h>

Inheritance diagram for lsst::afw::table::CatalogIterator< BaseT >:

Public Member Functions

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

Private Member Functions

BaseT::value_type::element_type & dereference () const
 

Friends

class boost::iterator_core_access
 

Detailed Description

template<typename BaseT>
class lsst::afw::table::CatalogIterator< BaseT >

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.

Definition at line 34 of file Catalog.h.

Constructor & Destructor Documentation

template<typename BaseT>
lsst::afw::table::CatalogIterator< BaseT >::CatalogIterator ( )
inline

Definition at line 39 of file Catalog.h.

39 {}
template<typename BaseT>
template<typename OtherBaseT >
lsst::afw::table::CatalogIterator< BaseT >::CatalogIterator ( CatalogIterator< OtherBaseT > const &  other)
inline

Definition at line 42 of file Catalog.h.

42  :
43  CatalogIterator::iterator_adaptor_(other.base())
44  {}
template<typename BaseT>
lsst::afw::table::CatalogIterator< BaseT >::CatalogIterator ( BaseT const &  base)
inlineexplicit

Definition at line 46 of file Catalog.h.

46 : CatalogIterator::iterator_adaptor_(base) {}

Member Function Documentation

template<typename BaseT>
BaseT::value_type::element_type& lsst::afw::table::CatalogIterator< BaseT >::dereference ( ) const
inlineprivate

Definition at line 59 of file Catalog.h.

59 { return **this->base(); }
template<typename BaseT>
template<typename RecordT >
lsst::afw::table::CatalogIterator< BaseT >::operator boost::shared_ptr< RecordT > ( ) const
inline

Definition at line 49 of file Catalog.h.

49 { return *this->base(); }
template<typename BaseT>
template<typename RecordT >
CatalogIterator& lsst::afw::table::CatalogIterator< BaseT >::operator= ( boost::shared_ptr< RecordT > const &  other) const
inline

Definition at line 52 of file Catalog.h.

52  {
53  *this->base() = other;
54  return *this;
55  }

Friends And Related Function Documentation

template<typename BaseT>
friend class boost::iterator_core_access
friend

Definition at line 58 of file Catalog.h.


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