CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

edm::DetSetRefVector< T, C > Class Template Reference

#include <DetSetRefVector.h>

List of all members.

Public Types

typedef std::vector< ref_typecollection_type
typedef
boost::indirect_iterator
< typename
collection_type::const_iterator > 
const_iterator
typedef detset const & const_reference
typedef DetSet< Tdetset
typedef Ref< C, DetSet< T >
, refhelper::FindDetSetForDetSetVector
< T, C > > 
ref_type
typedef collection_type::size_type size_type
typedef detset value_type

Public Member Functions

const_iterator begin () const
 Return an iterator to the first DetSet.
 DetSetRefVector ()
 DetSetRefVector (const TestHandle< C > &iHandle, const std::vector< det_id_type > &iDets)
 DetSetRefVector (const Handle< C > &iHandle, const std::vector< det_id_type > &iDets)
 DetSetRefVector (const OrphanHandle< C > &iHandle, const std::vector< det_id_type > &iDets)
bool empty () const
 Return true if we contain no DetSets.
const_iterator end () const
 Return the off-the-end iterator.
const_iterator find (det_id_type id) const
DetSetRefVectoroperator= (DetSetRefVector const &rhs)
const_reference operator[] (det_id_type i) const
size_type size () const
 Return the number of contained DetSets.
void swap (DetSetRefVector &other)

Private Member Functions

 BOOST_CLASS_REQUIRE (T, boost, LessThanComparableConcept)

Private Attributes

collection_type sets_

Detailed Description

template<typename T, typename C = DetSetVector<T>>
class edm::DetSetRefVector< T, C >

Definition at line 91 of file DetSetRefVector.h.


Member Typedef Documentation

template<typename T, typename C = DetSetVector<T>>
typedef std::vector<ref_type> edm::DetSetRefVector< T, C >::collection_type

Definition at line 101 of file DetSetRefVector.h.

template<typename T, typename C = DetSetVector<T>>
typedef boost::indirect_iterator<typename collection_type::const_iterator> edm::DetSetRefVector< T, C >::const_iterator

Definition at line 106 of file DetSetRefVector.h.

template<typename T, typename C = DetSetVector<T>>
typedef detset const& edm::DetSetRefVector< T, C >::const_reference

Definition at line 103 of file DetSetRefVector.h.

template<typename T, typename C = DetSetVector<T>>
typedef DetSet<T> edm::DetSetRefVector< T, C >::detset

Definition at line 98 of file DetSetRefVector.h.

template<typename T, typename C = DetSetVector<T>>
typedef Ref<C, DetSet<T>, refhelper::FindDetSetForDetSetVector<T,C> > edm::DetSetRefVector< T, C >::ref_type

Definition at line 100 of file DetSetRefVector.h.

template<typename T, typename C = DetSetVector<T>>
typedef collection_type::size_type edm::DetSetRefVector< T, C >::size_type

Definition at line 107 of file DetSetRefVector.h.

template<typename T, typename C = DetSetVector<T>>
typedef detset edm::DetSetRefVector< T, C >::value_type

Definition at line 99 of file DetSetRefVector.h.


Constructor & Destructor Documentation

template<typename T, typename C = DetSetVector<T>>
edm::DetSetRefVector< T, C >::DetSetRefVector ( ) [inline]

Compiler-generated default c'tor, copy c'tor, d'tor and assignment are correct.

Definition at line 116 of file DetSetRefVector.h.

{}
template<typename T, typename C = DetSetVector<T>>
edm::DetSetRefVector< T, C >::DetSetRefVector ( const Handle< C > &  iHandle,
const std::vector< det_id_type > &  iDets 
) [inline]

Definition at line 118 of file DetSetRefVector.h.

References edm::DetSetRefVector< T, C >::sets_.

                                                                                     : sets_() {
        sets_.reserve(iDets.size());
        det_id_type sanityCheck = 0;
        for(std::vector<det_id_type>::const_iterator itDetId = iDets.begin(),
            itDetIdEnd = iDets.end();
            itDetId != itDetIdEnd;
            ++itDetId) {
          assert(sanityCheck <= *itDetId && "vector of det_id_type was not ordered");
          sanityCheck = *itDetId;
          //the last 'false' says to not get the data right now
          sets_.push_back(ref_type(iHandle, *itDetId, false));
        }
      }
template<typename T, typename C = DetSetVector<T>>
edm::DetSetRefVector< T, C >::DetSetRefVector ( const OrphanHandle< C > &  iHandle,
const std::vector< det_id_type > &  iDets 
) [inline]

Definition at line 132 of file DetSetRefVector.h.

References edm::DetSetRefVector< T, C >::sets_.

                                                                                           : sets_() {
        sets_.reserve(iDets.size());
        det_id_type sanityCheck = 0;
        for(std::vector<det_id_type>::const_iterator itDetId = iDets.begin(),
            itDetIdEnd = iDets.end();
            itDetId != itDetIdEnd;
            ++itDetId) {
          assert(sanityCheck <= *itDetId && "vector of det_id_type was not ordered");
          sanityCheck = *itDetId;
          //the last 'false' says to not get the data right now
          sets_.push_back(ref_type(iHandle, *itDetId, false));
        }
      }
template<typename T, typename C = DetSetVector<T>>
edm::DetSetRefVector< T, C >::DetSetRefVector ( const TestHandle< C > &  iHandle,
const std::vector< det_id_type > &  iDets 
) [inline]

Definition at line 146 of file DetSetRefVector.h.

References edm::DetSetRefVector< T, C >::sets_.

                                                                                         : sets_() {
        sets_.reserve(iDets.size());
        det_id_type sanityCheck = 0;
        for(std::vector<det_id_type>::const_iterator itDetId = iDets.begin(),
            itDetIdEnd = iDets.end();
            itDetId != itDetIdEnd;
            ++itDetId) {
          assert(sanityCheck <= *itDetId && "vector of det_id_type was not ordered");
          sanityCheck = *itDetId;
          //the last 'false' says to not get the data right now
          sets_.push_back(ref_type(iHandle, *itDetId, false));
        }
      }

Member Function Documentation

template<typename T , typename C >
DetSetRefVector< T, C >::const_iterator edm::DetSetRefVector< T, C >::begin ( void  ) const [inline]

Return an iterator to the first DetSet.

Definition at line 265 of file DetSetRefVector.h.

References edm::DetSetRefVector< T, C >::sets_.

  {
    return sets_.begin();
  }
template<typename T, typename C = DetSetVector<T>>
edm::DetSetRefVector< T, C >::BOOST_CLASS_REQUIRE ( T  ,
boost  ,
LessThanComparableConcept   
) [private]

DetSetVector requires that T objects can be compared with operator<.

template<typename T , typename C >
bool edm::DetSetRefVector< T, C >::empty ( ) const [inline]

Return true if we contain no DetSets.

Definition at line 220 of file DetSetRefVector.h.

References edm::DetSetRefVector< T, C >::sets_.

Referenced by edm::DetSetRefVector< T, C >::find().

  {
    return sets_.empty();
  }
template<typename T , typename C >
DetSetRefVector< T, C >::const_iterator edm::DetSetRefVector< T, C >::end ( void  ) const [inline]

Return the off-the-end iterator.

Definition at line 273 of file DetSetRefVector.h.

References edm::DetSetRefVector< T, C >::sets_.

Referenced by edm::DetSetRefVector< T, C >::operator[]().

  {
    return sets_.end();
  }
template<typename T , typename C >
DetSetRefVector< T, C >::const_iterator edm::DetSetRefVector< T, C >::find ( det_id_type  id) const [inline]

Return an iterator to the DetSet with the given id, or end() if there is no such DetSet.

Definition at line 236 of file DetSetRefVector.h.

References edm::DetSetRefVector< T, C >::empty(), errorMatrix2Lands_multiChannel::id, AlCaHLTBitMon_ParallelJobs::p, and edm::DetSetRefVector< T, C >::sets_.

Referenced by edm::DetSetRefVector< T, C >::operator[]().

  {
    if(empty()) {
      return sets_.end();
    }
    std::pair<typename collection_type::const_iterator,typename collection_type::const_iterator> p = 
    std::equal_range(sets_.begin(), sets_.end(), id, CompareRefDetSet<T,C>());
    if (p.first == p.second) return sets_.end();
    // The range indicated by [p.first, p.second) should be exactly of
    // length 1.
    assert(std::distance(p.first, p.second) == 1);
    return p.first;
  }
template<typename T, typename C = DetSetVector<T>>
DetSetRefVector& edm::DetSetRefVector< T, C >::operator= ( DetSetRefVector< T, C > const &  rhs)
template<typename T , typename C >
DetSetRefVector< T, C >::const_reference edm::DetSetRefVector< T, C >::operator[] ( det_id_type  i) const [inline]

Return a reference to the DetSet with the given detector ID. If there is no such DetSet, we throw an edm::Exception. DO NOT MODIFY THE id DATA MEMBER OF THE REFERENCED DetSet!**

Definition at line 253 of file DetSetRefVector.h.

References edm::dslvdetail::_throw_range(), edm::DetSetRefVector< T, C >::end(), and edm::DetSetRefVector< T, C >::find().

  {
    // Find the right DetSet, and return a reference to it.  Throw if
    // there is none.
    const_iterator it = this->find(i);
    if (it == this->end()) dsrvdetail::_throw_range(i);
    return *it;
  }
template<typename T , typename C >
DetSetRefVector< T, C >::size_type edm::DetSetRefVector< T, C >::size ( void  ) const [inline]

Return the number of contained DetSets.

Definition at line 228 of file DetSetRefVector.h.

References edm::DetSetRefVector< T, C >::sets_.

  {
    return sets_.size();
  }
template<typename T, typename C = DetSetVector<T>>
void edm::DetSetRefVector< T, C >::swap ( DetSetRefVector< T, C > &  other)

Referenced by edm::swap().


Member Data Documentation

template<typename T, typename C = DetSetVector<T>>
collection_type edm::DetSetRefVector< T, C >::sets_ [private]